Read data from an active system activity (Android) - android

I am working on an app that opens the Network Settings screen, where available networks search takes place (done automatically), after which I would like to read the activity's data.
Meaning, when all the networks that were found, appear as options on the Network Settings Activity's screen, I would like to get a feedback, somehow, and to read the data on the screen.
Listening to the logcat is not possible since 4.1 (if i'm not mistaking), and bottom line, even with the READ_LOGS permission, I can't do it on my Android 4.3 device. (Solved my problem before)
If so, is such a thing possible, and how?

Related

Is it possible to clear an Android application RAM content when the user logs off/closes the app?

As an example, take an Android app that manages sensitive information such as credit card details. Is it possible from a code level to effectively erase the sensitive data the app might store in RAM when the user logs off or closes the application? How can this be done?
Your can do something like that in your Developer Settings
How to unlock developer settings?
You can unlock your developer settings by going to: Settings > About phone > Software info > Build number., Remember that the names of the folders can be different depending on your brand/model of your phone. Once you've reaced Build number, click it about 7 times. After a while you should get a toast message saying how many clicks left. Keep clicking until it says you've finished all the clicks. CONGRATS! Your have unlocked delevopers mode
Now that you have unlocked your developer settings, scroll right down to the bottom. A little bit to the top you should have a categorie about apps. There you find: Don't keep activities, when you turn that on, instead of closing the app a normal way, every app is forced to shut down. I know it's not the same as clearing everything. But that's the best I know

Change default activity after activation

I currently have three activities for my Android app, two of these are for logging in. The first is used for authorizing a device and requires the user to input more user information (FullLogin), the second is used once a device has been authorized (ReducedLogin).
The idea is to show the FullLogin activity all new users until their device has been authorized. The ReducedLogin activity will then show for all logins thereafter.
Is this possible and how would I go about doing this? I've seen some posts online for using/accessing values from a preferences.xml file but am not 100% sure if this is correct for my needs.
This scenario is formulated quite generally. There exist many possible solutions.
You could save the information whether a user is fully authorized on an external server and each time you start the app, you request the server and then show the corresponding activity.
You could store this information locally on the smartphone (e.g. in SharedPreferences), but for security reasons i would rather recommend the first way. One big advantage of local storage may be the avoidance of the additional internet permission as you don't have to request a server.
You could use cryptography to create a challenge that can only be solved by an authorized user.
You could combine these approaches.
You can't modify the manifest, and that's what's going to control what runs when the user presses your launcher icon.
What you can do is have a "router" Activity that inspects the state of the system and starts the real Activity you want. You do have to put in some extra effort here to ensure you don't get a screen flash between the router and real activity (starting with no animation, not setting a content view in the router, using a blank theme, and probably other things).
Another solution is to use fragments. The "main" activity just inspects the state and adds the correct fragment ... full or reduced.

Disable the possibility to hide notifications in Android Lollipop

Since Android Lollipop, the user can hide notifications of an application from Android settings.
I'm writing a parental control application and I'm searching for a way to disable this functionality.
Indeed, I want notifications to be always displayed, even if the child doesn't want to see them.
I saw that on tablets (not on phones) we can create a specific profile to block access to the settings app, but I don't want to lock the settings app, and the trick needs to work on phones too.
I also looked in manifest file to see if an option was there to explicitly enable/disable this but I found nothing.
Please note that my app does have admin privileges.
After hours of head scratching and hundred of coffees, nothing came to me from Android developer website or any other website, I'm desparated.
So finally, is there a way to disable the possibility to hide notifications in Android Lollipop?
Disabling the ability to hide unwanted notification would be undoing what that feature is. As far as I know there is no way to do that.
EDIT:
However - there is an broadcast send after each settings change (WiFi turn on / off etc.). Some settings blocking apps are using this to revert changes made before entering password - maybe there is an intent that does the same for hiding notification.

Dynamic Services URL property for Android

My App has the "Dynamic Services URL" set to true.
This is because we have several Application Servers and, also, the URL might change depending on the network we are connected to.
Android:
The App gets a menu on the AppBar (upper-right corner) with a "Settings" option in it.
The App startup invokes an Authentication procedure, that requires access to the Application Server.
Q1: If the last Application Server is unavailable (eg, device connected to a different network) the App will return a "Error: Connect time out" and will not give the Settings Menu, not allowing me to change the URL.
Even if i go to the device settings and Clear the app data, still, the app will try to reconect to the last / default Services URL.
It seems impossible to use the App again, until the previous Application Server becomes available so I can have access to the Settings Menu.
Is there any other way to change the Service URL?
Q2: I will have to create my own "settings" screen for the App (where user can select a default theme, default nÂș of rows, etc).
Can I add a new option into the menu that genexus creates (so I don't have 2 Settings menus)?
The fist point is officially recognized as a bug. See this SAC
The second point: I have no clue on how to achieve that (unify the 2 settings screens or create a custom edit box for setting the dynamic services URL). If there is a way, it may be programming an external object.

Android How to tell if Internet connection is being used?

My app download a lot of content (json and image) from the server as the user navigate through the app. For the sake of user experience, instead of downloading the content on the spot, I would like to precache them on memory and SD card so that they can be available without too much waiting.
Since I do not want the precacheing process take up too much network traffic so that the user operation is hindered by the network traffic jam, I would only let the app start precacheing these content when there are not any Internet activity from my app.
Therefore, I would like to ask if there are any way to determine whether there are any internet activity from my app.
Thank you.
The user's experience of not being about to use the app when it is first opened because there are other downloads sounds like it would hinder a user. Warning the user about the amount of data could be another solution. At the warning screen (On first open) the user could be directed into the settings where they could setup the network. This allows the user to customize if needed, otherwise they continue with a smooth transition into the app.
The network settings could be setup with ConnectivityManager. This would allow you to see if the user is on Wifi vs mobile data.
http://developer.android.com/training/monitoring-device-state/connectivity-monitoring.html
The DDMS tool includes a tool for monitoring network traffic. This could be an option.
http://developer.android.com/tools/debugging/ddms.html

Categories

Resources