I am developing an app that has to use a floating touch button that performs some action on click. It always remains on top in every app and other apps on screen are still accessible. This is somewhat similar to assistive touch feature in iPhone. Please can anybody help me with how to code for this feature in my android app?
Related
i started working as android developer. I want to gesture that when someone press on screen, its thumb or finger. Can i do that, let me know if there is any gesture deductor in android?
No there is no way you can do this. Our hardware is not yet that developed, to distinguish between fingers. Hehe!
Unless it is a fingerprint recognizer. But that's not what you need.
So recently my phone was stolen and besides all the trouble I had with the lost files I was pretty angry about the fact that it didn't came to my mind to create an app for android that prevents easy stealing or to be precise that will act as a Trojan horse inside of the thief's pocket. So what i thought about is an application that kicks in whenever you're holding your standby button or whatever you usually do to shutdown your phone. This application then looks like the real shutdown menu and asks you to shutdown with a pin or without one and whenever you shutdown without the right pin the phone will actually fake shut down in a way where it is still transmitting GPS and connecting to the next transmission tower so it is easily locatable (by fake shutdown I mean a black screen and silent mode until you are repeating the same method you used to shut your phone down). So is there any way of creating an app that has a higher priority than the android shutdown system so a custom menu pops up whenever you're trying to shutdown your phone?
Your idea isn't entirely impossible for Android.
There is no way for an app to have a higher priority than the Android Shutdown menu. However, that doesn't mean there's no hope.
If you remember popular Alarm apps, they typically have a feature that prevent you from turning off your phone when the alarm rings. This is usually done by detecting that a Long Press of the Power Button is pressed and then dismissing the Power Off Menu.
You can look at this answer for how to do this: https://stackoverflow.com/a/53679477
However, this is just so you can dismiss Android's Power Off Menu so you can show your own Power-Off Menu.
Afterwards, with your idea of displaying a Black Screen and Silent Mode... there's actually four three problems.
Screen Backlight for non AMOLED screens
Status and Navigation Bars
Can't block a Forced Shutdown
Personally, during the early days of Android and my early years of Android development, I released an app with a similar idea (have the phone give off the illusion of being turned off, so there's a higher possibility of phone remaining on if stolen), but due to those four problematic areas, the app has been retired.
So I speak with experience in saying that:
A black screen doesn't play nicely with screens that require a backlight. Even at lowest brightness settings, a completely black screen will still easily be seen as on.
Android doesn't have a way permanently hide the Navigation and Status bars. The best you'll get is Immersive Mode, but this mode will cause the bars to temporarily appear if you touch the screen. Even if you use a Full-Screen Activity, swiping down or swiping up will still show these bars. I believe your only option for hiding both of these bars is Root.
There's absolutely no way to block someone from doing a force shutdown. This completely bypasses the Power Off Menu and it's simply unblockable. So while your app might block some thieves, it might not block the more paranoid ones.
Hopefully, my answer is enough to nudge you in the right direction for your app.
I have an Android app that is transparent that monitors for an event and then displays a message and toggles the background between transparent and a translucent red. The app itself is working exactly as I was hoping. The problem is that only the top most app (my app) is active and updating the view. The app displays over a 3rd party app that runs a live video stream. I want the live video stream app to continue to update while my transparent app is on top. Since I have no control over the other app and it doesn't support multi-window approach, I am looking for a different approach or work around to accomplish the same thing.
I have read of people trying to use a system popup based on a service. Does anyone have experience trying to solve a similar problem and found a good approach for designing the app or a work around?
Try to google about Activity lifecycle. When another app comes as the top application (let's say your transparent app) the last playing application goes to onPause until the user bring the last app back to the top again.
The short answer is: what you want is not possible.
any question?
I'm currently working on a map/navigational project for Android, and I chose OpenLayers because it claimed to support mobile development and the examples worked well on my Android phone.
I made a basic map prototype with one marker, a popup from the marker, and a layer switch control. All of this works as intended on both my PC and my Android, except for one weird issue with Android. I'm the .html file and all dependencies through a WebView in my app, and there are some weird issues coming up. For one, whenever I tap something like my marker or the zoom controller, an orange box appears briefly around it, and sometimes it doesn't register the tap.
To clarify, I have touch navigation enabled on my map, and all events for the popups are on-touch and working for the most part. But the orange boxes and occasional failure to register a tap are really ruining any degree of polish that the app has. Just wondering if anyone else has encountered this at before, and possibly has a fix?
whenever i see this type of behavior, i.e. orange crisscrossed boxes in openlayers, it is many times caused by failure to locate icon graphics files. try creating a marker whose icon file does not exist where it should and see if that is the "orange box" that you describe.
if so, then you should check any broken links (mouseovers, especially).
I am currently working on a calculator application for android. I am finding it difficult to conveniently take a screen shot of the app. So i have put my calculator on pause so I can write a simple screen shot app. It runs in the notification bar and when you click the notification the notification bar slides away and a few seconds later a snapshot is taken. This works perfectly. Now I would like to add functionality to take snapshots even for full screen apps. I have seen apps that put a sliding drawer on the screen onto of whatever app is running. That is there is always a button on the screen no matter what you are doing that when you click/drag it that sliding drawer came out. How did they do that? It should be a simple process to use a button instead of a drawer and when it's clicked hide it, snapshot and unhide it.
So my question bsically is
How can i put a usable button on the screen that stays above whatever app is running, even the homescreen
I realize I'm not answering your question directly, but if you simply want to get a screen capture of your application running, I would use ddms in your android tools directory. It has a menu option for getting a screen grab. I use it frequently.
Just go to Device > Screen Capture
More details here :
http://developer.android.com/guide/developing/debugging/ddms.html