Update android application programmatically [duplicate] - android

This question already has answers here:
Updating an application OTA
(3 answers)
Closed 9 years ago.
I have created a simple application and I wonder what are method of updating it directly from its interface. I want to create a script that checks for new updates and if any are found a button saying "Download new update" should be displayed. If the user clicks on it either the new version is downloaded from the server, the running instance is closed and the downloaded file (.apk) is executed (to be installed), or update the existing one as the application is running (maybe the Android API has something for that).
Well, I am asking for some references, links or some clues. I also must specify that I don't want the settings and other local data to be deleted when installing the new version.

A much simpler way to do that is have to host the apk on your server and having a button in your app that opens the apk in the browser were the user can install it.

Related

How do I know that user is going to uninstall my app [duplicate]

This question already has answers here:
When I uninstall my app , Can we remove my folder which is created through my app?
(4 answers)
Closed 5 years ago.
Is this possible to know that user is going to uninstalling my application. Because I want to delete the folder that is created by my application. So for the task, I am not getting how to do that? Please help me.
Because I want to delete the folder that is created by my application
Save your data in the location returned by getFilesDir(). It will get cleared automatically by android system when your app got uninstalled. So you don't have to worry.
see the official doc

Launch app in market if not installed [duplicate]

This question already has answers here:
Detect from browser if a specific application is installed in Android
(5 answers)
Closed 8 years ago.
I can launch my app from the browser if it is installed using intent-filters. If the app is not installed, I would like the user brought to the app specific page in the market. I don't care if I have to handle this or if the platform does this for me, I only need to know how to set up the intent-filter, protocols, anchor tags, etc.
thank you!
There is no "normal" way to do it. What you can do, however, is to always provide a link to your app in Google Play and have an intent in your app handle that link. Thus, the app will open when the market link is clicked if it has already been installed. The downside is if the app is installed, the user will be presented with a dialog and will have to make a choice of whether to launch the link in a browser or in your app.
See this answer for a code sample: https://stackoverflow.com/a/12901352/379245

Android - Determine which store my app was installed from [duplicate]

This question already has answers here:
How android app can detect what store installed it?
(3 answers)
Closed 9 years ago.
Is it possible to find out which store my app was installed from? I have it available on Samsung store, Amazon and Google Play and I want to be able to determine which of these stores my app was installed from and prompt the user with a message like "Thank you for downloading the app from (store)..."
The method linked by FD_, sadly, is not reliable as the information it returns can be edited, and may be null in some cases.
The best way would be to have an enum, or some sort of flag in your application, and flipping that flag before building a new release for each store. Simply check the status of that flag at runtime, to determine which store the apk came from.

Do some cleanup operations if my app is uninstalled [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Perform a task on uninstall in android
My android app creates some folders on sd card when it is installed on device.
Now If user uninstall the application, I would like to clean up these folders created at the time of creation...so is it possible to implement it in the android OS?
You can not manage the things when your application gets uninstalled from the device. still if you want to delete your folders there is one way(NOT RECOMMENDED), you can make one other application that will watch on your application so when your application gets uninstalled, that app will delete your folders that were created by your app. But it is not the way to achieve this. there are unfortunately no other way to handle things at the time of uninstalling the application.

Sending Android app to friend [duplicate]

This question already has answers here:
How can I send an Android app that I'm developing to someone over e-mail?
(10 answers)
Closed 9 years ago.
Hey, this might be simple but I dunno how to go about it. I have an app that I'm working on, and I'd like my friend to take a look at it. How can I go about sending them the apk package so they can play with the app?
You can send it as an email attachment, for instance. The process for installing it is the same as if you get the app from a source other than Market, and is documented in many places. This is the first hit that I got on Google.
You can find the .APK file in the bin directory of the Eclipse project. Also, keep in mind that if you don't sign your application with a valid certificate your friend will have to explicitly enable the 'install third party applications'; otherwise the SO won't let you install it.
Send it to them and use appsinstaller (available from the market) if android os < 2.2. Or onymous (cant remember the spelling, but a market search of installer pulls it up) if using android os 2.2 +.
From my experience, I am unable to save email attachments (if sending the apk via email and using the default email app). Otherwise, they could use their browser and download the attachment and use the programs above to install it.

Categories

Resources