In the newer versions of Android (> 3.0) there is an onscreen button that
will display a list of the recent apps with their names and snapshots.
Even though my app itself is password protected, this overview might
show sensitive data in that snapshot. So is there any way to force a
certain image (like a logo) to be shown rather than let the OS decide?
It seems to be impossible for now. There's a method called onCreateThumbnail but it is not used currently by the system I guess, since it is not called. I see two possible solutions:
1. To disable thumbnail on the activity containing sensitive data by adding FLAG_SECURE to your window: getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
2. To exclude your activities from recent apps, set android:excludeFromRecents attribute to true for activities in AndroidManifest.xml
The solution provided by Azat continues to be valid also in Lollipop.
Just a note, if you want to continue to not see snapshots in recent list for the entire app, ALL the implemented activities should specify in the onCreate() method the flag getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
before setContentView();
Otherwise a snapshot in the recent list will show the first activity without the flag if the user navigated through it.
There is an approach to archive this requirement besides using that flag is HardwareKeyWatcher but it can not cover all of the cases due to fragmented device configurations and custom ROMs, then we have to fulfill missing cases with other approaches.
To ease the way of implementation, we had built a lib for Recent Apps thumbnail hiding mechanism, which supports implement a custom layout to show an empty screen with the app's logo when the app is going to Recents Screen.
Related
I was wondering if anyone had a relatively simple solution for us.
We created an app to be used by our clients on android devices that we give them.
We would like the client to only be able to use our app and have limited access to everything else (i.e. settings, email etc.) What is the best way to achieve this without using 3rd party apps.
Thank you in advance!
This may not help but the L preview has a task locking feature included that may be of some insight, I'm not aware of how it functions as yet
Task locking
The L Developer Preview introduces a new task locking API that lets you temporarily restrict users from leaving your app or being interrupted by notifications. This could be used, for example, if you are developing an education app to support high stakes assessment requirements on Android. Once your app activates this mode, users will not be able to see notifications, access other apps, or return to the Home screen, until your app exits the mode.
http://developer.android.com/preview/api-overview.html
Hope this helped
Suppress the Title Bar & Make Your App a Launcher
Root Your Tablet
Modify System Files and Settings to hide the soft keys
On the next link you can find the complete solution for the Nexus 7 (2012)
http://thebitplague.wordpress.com/2013/04/05/kiosk-mode-on-the-nexus-7/
simple Answer is:
Lock Install button with modify system settings.
Create your own customized-ROM and apply your requirement to that ROM.
more info, visit XDADavelopers
Is it possible to get the user behavior on the phone (for example Alpesh has an Android phone and he uses multiple apps, browser YouTube etc). Whatever he is doing on the phone I want to get all those things from behind (which apps he has installed, which app he opens and what he search on the phone, All these data I want to get programmatically so what all can be get in android).
For now I am aware that installed apps list can be get easily but I want to get usage history and what he do all on mobile.
This is not a code solution, but an answer to your question, so you can get start some where.
In my opinion your question title are asking about two things.
(part 1) Getting User Behavior on the Android Phone (part 2)(App History, Browse
History etc)
1- First part Getting User Behavior on the Android Phone:
There is a concept called context awareness. Short described; it is about gathering different information from the phone, like light sensor, motion sensor, sound, location or even user behavior etc. and depending on your app requirement and the gathered information:
You could send these information over cloud data store for statically usage
You could make your phone doing (behavior) different things depending on location, motion or what ever.
etc.
For context awareness it is an open area for pervasive computing research. And it is not just few lines of code to write, it is typically a complete solution depending on requirement. Example I have built a context awareness application to gather noise collected by phones from different locations for research purpose inspired from this framework, but I am pretty sure you can find other frameworks or even build your own, as I did in my case.
The mentioned framework has some examples.
2- The second part is about App History, Browse History etc.:
This is possible, but you still need to build a peace of software (App) to collect all these information (logs) from the phone. Hereafter you can make phone act on different conditions and/or again send it over a RESTful API over cloud service data store, there is no limit for it.
The problem is, there is no thing out of the box for your requirement. Even if you find frameworks you still need to research it and further work on it.
You can find different examples for your requirement, like to collect browser history, you can find SO question here:
Get browser history and search result in android
Or get list of installed application:
How to get a list of installed android applications and pick one to run
My point here is you need to solve small goals at a time and put your knowledge together at the end.
Both 1 and 2 can also be related to each other, depending on your achievement.
Conclusion
Make a goal to your project.
Define the main requirements and tasks of your project.
Research your options (Technology, Cost, Target Audience, What data I can or I should not collect, what is possible to collect, what is the limits, Privacy issues etc.).
Split your project in small assets and try to solve small problems/goals.
Finally you would be able to put the puzzles together and build your final application
but i want to get usage history and what he do all on mobile
This is not possible and shouldn't ever be possible. Each app is sandboxed by Android so apps cannot inspect what other apps are doing. Think about it, you wouldn't want apps to be able to intercept private information such as banking details.
Every app is isolated from the other ones. Unless you develop a system signed app, you will not be able to gather all that data.
What you could do is to develop your own Android Rom where you then develop your data collection the exact way you want. Then you need to distribute your rom, which is another story...
I wanted to know if there is any feature in Android where I could select a word from a third party application and send or share that word to my application. I could store that word in my application for further processing.
Implementing a "share" action is easiest if you are targeting API level 14+ (Android 4.0), as documented here: Adding an Easy Share Action.
If you need to target an earlier API level, the process is a bit more involved, as documented here: Receiving Content from Other Apps.
(Note that while I normally consider link-only answers on Stack Overflow to be a poor choice, the process of implementing "share" actions is somewhat involved and fully documented on the Android developer site. This is a case where simply pointing you at the documentation seems like the most appropriate thing to do.)
Here is Android copy/paste desciption: http://developer.android.com/guide/topics/text/copy-paste.html.
But I don't think there is way to modify 3rd-party app's context menu to add custom option like share, without changing this app's source code or changing Android platform (to add your own sharing mechanism to context menu).
I am wanting to make a reusable 'landing page' activity similar to like the activity when you first launch the official twitter app, facebook, or google io app, etc. Reusable is really the key here I would like for the activity to dynamically populate its gridview with the other activities in the application.
Is it possible to parse through the android manifest file to find my other activities? If so is it also possible to add my own xml attributes to the manifest file to distinguish which activities should show up in the gridview?
Or, is there some other way to find all existing activity classes in the package? Is there a way in java to look for any Class in a package that implements a particular interface?
edit: here is a screen shot as per request
Is it possible to parse through the android manifest file to find my other activities?
No, but you can iterate over your activities via PackageManager and getPackageInfo().
If so is it also possible to add my own xml attributes to the manifest file to distinguish which
activities should show up in the gridview?
You should be able to use a <meta-data> element to point to an XML resource file that contains your extra data, just like app widgets and searching do. Use loadXmlMetaData() to access the contents.
That being said, I agree with Juri -- you're using a Buick to swat a fly here. Having a reusable dashboard activity is great -- working out the details of one is on my 18,000-item to-do list. Having one that tries to dynamically populate itself seems overkill.
I guess what you want is a dashboard. For ideas on how to implement it you could look at the source code of the Google I/O android app, more specifically at the activity_home.xml.
Parsing the manifest.xml could be an idea although I'm not sure whether you're able to access it. Honestly, being on a mobile where you want to use as little resources as possible I'd suggest you to reference your items hardcoded in the xml file, just as they did it on the Google I/O app.
The reason is that you probably want to promote just the most important activities of your app, not the detail views of a list or some custom popup alert which is also registered in the manifest and would therefore be difficult to distinguish from others.
How many activities do you have to put on the dashboard? Will the user ever be able to promote inactive activities because they want them? I think you have to consider those factors as well. Otherwise, you would weight the ones you want to show up first (different ways to do this) and then let them trickle into the dashboard.
As far as how to display which where, if you're using HTML/CSS then you could use a set width and a float model. Otherwise, just iterate through the list of promoted activities. I've done both in HTML/CSS dashboards I've done. It's just according to what your parameters are.
It's relatively easy to build a list in memory and loop from 1 to 6 assigning values to each of 6 locations on screen. Making them dynamically sized could be tricky.
Looking for more info to help you out, but not sure exactly how you're having issues. Unless you have something directly patentable, I would suggest showing code and what you're struggling with ...
I know this in general is beyond the scope of SO, but I am looking for some basic yes/no info to see if it is even feasible to proceed... I am thinking about building and Android 'note-taking/annotation' app that runs 'over' other installed Android apps, such as the web browser for example.
Essentially, while the user is browsing, my app would be running in the bg as a service, and then they could activate it which would then essentially intercept user inputs and translate those on a transparent canvas over the web browser into lines, shapes, etc. The user could then take a screen-cap of their marking with the underlying web page, which would be stored to the sd card.
This is a very good idea and a great question, but sadly, I do not believe it is possible.
The way Android is designed only one Activity can have focus at a time, while a Service could run in the background, the user would not be able to interact with it. The user can only interact with the currently active Activity.
Again, love the idea, but it is sadly not supported.
You might be able to achieve this with the WindowManager service. You can then use that to call addView() with a view of type TYPE_SYSTEM_ALERT, or possibly TYPE_SYSTEM_OVERLAY (but see the notes in the documentation about taking input focus).
I haven't tried it myself, but I've seen several apps (often dictionary apps that translate whatever words you tap on) that do overlays, and they always seem to require the SYSTEM_ALERT_WINDOW permission.