Fetch Local Storage Items before Android Native App - java

HTML5 app (Cordova Supported)
is running on Google Play and i do hold lot of local storage items of user . Now i am going to release Android pure native app so i don't want user to register again for my app instead i want to use earlier local storage items from app which is running.
Using those earlier user preferences stored in local storage , i would rather not to run new registration and run on old user registration Preferences .
Is their any way that i can do it ??

Following steps can answer it precisely :
Keep Cordova in your android native build .
Keep index.html in Assest folder .
Run Webview(index.html) using cordova
Fetch local storage variables using window.location .
Run Only first time with splash screen and as soon as you get the all the existing app storage variables and later on never start run the app with webview only native view completely.
Store all variables in SharedPreferences.

Related

Dropbox Java API : Limit access for an user

I'm working on an android app, that has to get resources from a database located on dropbox for various reasons.
I created an app limited to a folder on my dropbox's app page.
I hava data stored on this folder (i know how to do that), and want my android app to get this data. I don't want the app to be able to put files on this dropbox folder.
I know that I can generate an auth token for my app, but I need to manually "activate" it on a web browser to make it usable.
Is there a way to automatically anthenticate my android app, on any device running it, and prevent users to alterate my database, only allowing them to read data from the folder, through the dropbox's java API ?
Thanks for any answers !

Store data on device on application install without opening app

Is it possible to save data to a device upon the installation of my application prior to the opening of the application?
If not, I'm looking for a way I can somehow mark a mobile device as "test device" without my application ever being opened on it (only installed).
If you want to distinguish between the shipped devices and every other device, use the build variants. You can add a variable to the BuildConfig class in gradle and specify a value for this sort of "prerelease" you are making and other for the build you are shipping to the store. Then, in the relevant code, check the value of the variable you created in BuildConfig.

Android automatically download and install apk

we have our android application which is running in kiosk mode. We would like to have feature to automatically check for updates, install those updates and run application again.
We can use some android service for that (actually, that's preferable way).
Do anybody has idea how we can accomplish that?
Thank you.
When the user has activated the auto update option in Play Store, then your update will automatically installed once the user has Wifi. If the user hasn't set this option you can do nothing about that.
You can ping your API every time your app starts, and your API has to tell you whether there is a new version. With this information you can display a popup to the user which forwards him to your PlayStore entry. But the user must select to update your app, you can not automate this process.
What you could do: If you write an HTML5 app, or you have a WebView which loads content from the network, then you can do your magic updates by simple updating the sources on server side.

Application crash on SD card removal

My application has android:installLocation="preferExternal" . After the application has been installed and launched , the background services of app gets initiated. When I hard remove the SD card , the application gets crashed giving the "ClassNotFoundException" for the application class (which extend android.app.application) .
Following is the error log:
java.lang.RuntimeException: Unable to instantiate application com.sample.MyApplication: java.lang.ClassNotFoundException: com.sample.MyApplication in loader dalvik.system.PathClassLoader[/mnt/asec/com.com.sample-1/pkg.apk]
How could this be handled in such a way that the crash can be avoided?
I think the app you use that stores the data in the External Storage SD card ,that what the app crash I think.and even the app has been installed in the SD card i think and while to try to retrieve the data your app crashes...
Instead try to move the app from SD card to phone memory by going to setting of the app
If you declare "preferExternal", you request that your application be installed on the external storage, but the system does not guarantee that your application will be installed on the external storage. If the external storage is full, the system will install it on the internal storage. The user can also move your application between the two locations.
If you declare "auto", you indicate that your application may be installed on the external storage, but you don't have a preference of install location. The system will decide where to install your application based on several factors. The user can also move your application between the two locations.
Source

Changing the UID of a system app

I know that we can get the UID of a system app using ApplicationInfo().uid(). But can I set the UID of my app to what that function returns?
I need to do this because I am attempting to copy a shared_pref file belonging to a target system app to a location on the sdcard. Btw, my device is rooted.
More details on my problem at Error in Copying file of a system app into another location.
You can run shell commands as root using the "su" program which is installed when rooting. There is no way to do it directly with the Android SDK.
http://www.stealthcopter.com/blog/2010/01/android-requesting-root-access-in-your-app/

Categories

Resources