Android installed app version

Install Two Different Versions of a Single App on Android Without Replace

You ask tech geeks for their favourite OS for mobile devices and I bet most of the answers will spontaneously spring out as Android OS. Android OS gives you loads of options for customisation, modification and development which you ain’t gonna get in any other mobile OS. So, in this post, I will tell you one such good feature of Android which can help you in many situations.

Today I will tell you how you can install different variants (versions) of the same App on Android device without any root coding. Just follow any of the methods below which suits you better and enjoy the same App with different versions without any overwrite.

How to Install & Use Different Variants of the Same App?

Method 1. Rename the Package Name (No Root)

Step 1.

Download and install APK Editor Pro (Paid) from Google Play Store or Download the APK File. (Google Search to find the latest version).

Step 2.

Download your desired App.

Step 3.

Open the APK Editor Pro and click on ‘Select an APK file’ and locate your downloaded APK file.

Step 4.

Click on the APK file and then click on ‘Common Edit’.

Step 5.

Here modify the package name to something different, Like if:

once done click on save button, it will take a while to load and then install the App. Cheers 🙂

Step 6.

Install another app version if not already installed.

Method 2. Using App Cloner Trick (No Root)

This is also a very simple trick to use two versions of the same App without much difficulty.

Step 1.

Download any App cloning apps from Google Play Store like Parallel Space.

Step 2.

Now install your desired App.

Step 3.

Open Parallel Space and clone the installed App.

Step 4.

Uninstall the App once cloned.

Download another version of the same App.

Step 5.

Enjoy both versions of the App, one in the parallel space and another one in App Drawer.

Method 3. Using Computer PC

You need Apktool (guide). And this on signing the APK after you’re done.

You need to modify the AndroidManifest.xml file. Find the line that looks like this:

and change it to something like:

After you’re finished, recompile then resign. To restore your data, try the following via ADB:

Note & Conclusion: I hope the post was helpful. Do comment below for any assistance or support if needed. Also, we do not endorse any of the App listed above. The info above is for educational purpose only.

If you’ve any thoughts on Install Two Different Versions of a Single App on Android Without Replace, then feel free to drop in below comment box. Also, please subscribe to our DigitBin YouTube channel for videos tutorials. Cheers!

Источник

Get Android .apk file VersionName or VersionCode WITHOUT installing apk

How can I get programmatically get the version code or version name of my apk from the AndroidManifest.xml file after downloading it and without installing it.

Читайте также:  Прога для usb камеры для андроид

For example I want to check if a new version is uploaded on my IIS service, after install it on device, if it is not a new version I don’t want to install it.

10 Answers 10

Following worked for me from the command line:

NOTE: aapt.exe is found in a build-tools sub-folder of SDK. For example:

If you are using version 2.2 and above of Android Studio then in Android Studio use Build → Analyze APK then select AndroidManifest.xml file.

This answers the question by returning only the version number as a result. However.

The goal as previously stated should be to find out if the apk on the server is newer than the one installed BEFORE attempting to download or install it. The easiest way to do this is include the version number in the filename of the apk hosted on the server eg myapp_1.01.apk

You will need to establish the name and version number of the apps already installed (if it is installed) in order to make the comparison. You will need a rooted device or a means of installing the aapt binary and busybox if they are not already included in the rom.

This script will get the list of apps from your server and compare with any installed apps. The result is a list flagged for upgrade/installation.

As somebody asked how to do it without using aapt. It is also possible to extract apk info with apktool and a bit of scripting. This way is slower and not simple in android but will work on windows/mac or linux as long as you have working apktool setup.

Also consider a drop folder on your server. Upload apks to it and a cron task renames and moves them to your update folder.

Источник

Detect if new install or updated version (Android app)

I have an app on the Play Store. I want to put a requirement that if users want to use a certain part of the app, they have to invite a friend before being able to do so. But I only want to impose this restriction to new installs of the app (to be fair to users that have installed the app before the restriction). Sorry for the long intro, my question is how can I find out if the current device has updated the app or is a new install?

9 Answers 9

The only solution I can see that doesn’t involve an entity outside of the device would be to get the PackageInfo for your app and check the values of

On first install, firstInstallTime and lastUpdateTime will have the same value (at least on my device they were the same); after an update, the values will be different because lastUpdateTime will change. Additionally, you know approximately what date and time you create the version that introduces this new behavior, and you also know which version code it will have.

I would extend Application and implement this checking in onCreate() , and store the result in SharedPreferences :

This is not foolproof, there are ways to circumvent this if the user really wants to, but I think this is about as good as it gets. If you want to track these things better and avoid tampering by the user, you should start storing user information on a server (assuming you have any sort of backend).

Check if the old version of your app saves some data on disk or preferences. This data must be safe, i.e. it cannot be deleted by the user (I’m not sure it’s possible).

Читайте также:  Как с андроида управлять кондиционером

When the new version is freshly installed, this data won’t exist. If the new version is an upgrade from the old version, this data will exist.

Worst case scenario, an old user will be flagged as a new one and will have a restricted usage.

My solution is use SahredPreference

return 3 posibles values:

  • 0: The APP is First Install
  • 1: The APP run once time
  • 2: The APP is Updated

Update

(thanks for the comments below my answer for prodding for a more specific/complete response).

Because you can’t really retroactively change the code for previous versions of your app, I think the easiest is to allow for all current installs to be grandfathered in.

So to keep track of that, one way would be to find a piece of information that points to a specific version of your app. Be that a timestamped file, or a SharedPreferences , or even the versionCode (as suggested by @DaudArfin in his answer) from the last version of the app you want to allow users to not have this restriction. Then you need to change this. That change then becomes your reference point for all the previous installs. For those users mark their «has_shared» flag to true. They become grandfathered in. Then, going forward, you can set the «has_shared» default to true

(Original, partial answer below)

Use a SharedPrefence (or similar)

Use something like SharedPreferences . This way you can put a simple value like has_shared = true and SharedPreferences will persist through app updates.

Something like this when they have signed someone up / shared your app

Then you can only bug people when the pref returns true

Источник

How to set app’s version number in Android Studio

I would like to upgrade an app’s version number (that is displayed in the Play Store) in Android Studio, but I’m not an Android developer so I’m not sure what I’m doing is right. I googled how to do it, and the Android guide says I should have to do it in the AndroidManifest.xml , but I can’t find android:versionCode , android:versionName in that file. However I found these lines in the build.gradle :

The actual version number is 1.1 in the Play Store, so I assume I got this, but I would really appreciate if somebody could confirm it for me. So is it enough if I edit only the versionName in the build.gradle ? Or do I need to do anything else? What is the common practice to do this?

2 Answers 2

Yes, every time you release an update on PlayStore you need to update these two lines in your gradle file by incrementing the digits in front of them —

Your versionCode should always be incremented but versionName is totally up to you when you plan to release an update. I usually increment my versionName based on how big is the update that I’m releasing.

If its a huge update to the previous version like new UI OR too many new features then I increment versionName by 1 and change it to 2.0, 2.1 etc

If its a small one, for instance I fixed few bugs then I usually increment versionName to 1.1.1, 1.1.2 etc.

If its just one new feature or I changed some vital content in my app then I increment the versionName to 1.2, 1.3 etc.

For ex. Minimum increment from versionCode 1 and versionName 1.1 can be —

You can find more info here — Versioning an Android app. Just keep in mind this document still explain versioning using AndroidManifest which still works but not recommended anymore as the values will be overridden by values in gradle file.

Читайте также:  Teddy bear dressup android

NOTE

As CommonsWare mentioned in his comment, you can change your versionCode to be something meaningful like date or anything that makes more sense to you. Play store will not raise any issue till the time its an integer and the newer one is higher than the older one.

Источник

How to get a list of installed android applications and pick one to run

I asked a similar question to this earlier this week but I’m still not understanding how to get a list of all installed applications and then pick one to run.

and this only shows application that are preinstalled or can run the ACTION_MAIN Intent type.

I also know I can use PackageManager to get all the installed applications, but how do I use this to run a specific application?

20 Answers 20

Here’s a cleaner way using the PackageManager

Following is the code to get the list of activities/applications installed on Android :

You will get all the necessary data in the ResolveInfo to start a application. You can check ResolveInfo javadoc here.

Another way to filter on system apps (works with the example of king9981):

Here a good example:

Getting list of installed non-system apps

To filter on sytem based apps :

To get al installed apps you can use Package Manager..

To run you can use package name

You can Find the List of installed apps in Android Device by using below code, «packageInfo» Contains Installed Application Information in Device. we can retrive Intent for the application installed from the packageinfo object and by using startactivity(intent), can start application. it is up to you how you organize the UI either Listview or Gridview. so on click event based on position, you can retrive intent object and start activity intent.

I had a requirement to filter out the system apps which user do not really use(eg. «com.qualcomm.service», «update services», etc). Ultimately I added another condition to filter down the app list. I just checked whether the app has ‘launcher intent’.

So, the resultant code looks like.

If there are multiple launchers in a one package above code has a problem. Eg: on LG Optimus Facebook for LG, MySpace for LG, Twitter for LG contains in a one package name SNS and if you use above SNS will repeat. After hours of research I came with below code. Seems to work well.

@Jas: I don’t have that code anymore, but I’ve found something close. I’ve made this to search for «components» of my application, they are just activities with a given category.

I’ve commented the part where it gets the activity name, but it’s pretty straightforward.

Clean solution that filter successfuly out system apps

The idea behind this solution is that the main activity of every system app does not have a custom activity icon. This method gives me an excellent result:

context.getPackageManager().getInstalledApplications(PackageManager.GET_META_DATA); Should return the list of all the installed apps but in android 11 it’ll only return the list of system apps. To get the list of all the applications(system+user) we need to provide an additional permission to the application i.e

Since Android 11 (API level 30), most user-installed apps are not visible by default. You must either statically declare which apps and/or intent filters you are going to get info about in your manifest like this:

Or require the QUERY_ALL_PACKAGES permission.

After doing the above, the other answers here still apply.

Источник

Оцените статью