Amrmsmb
Amrmsmb

Reputation: 1

how to installed apk without uninstalling the current apk of the same App

I used to work with Android studio 1.4. yesterday I downloaded the newest version of android Studio 2.1.2 and it did not work well for me, so i reverted to Android studio 1.4. the problem is, when i tried to run my App, I received a message telling me, "that the apk is already installed on the phone and to reinstall it i have to uninstall the version that is already on the phone".

Actually, I can not uninstall the apk version that is currently on the phone because it contains a huge database, and if i uninstalled it, then the databse content will be lost and i have to do it from the beginning

is there any other solution to run the App "apk" without uninstalling it

i am getting this message:

enter image description here

Upvotes: 0

Views: 2563

Answers (6)

Pararth
Pararth

Reputation: 8134

An appropriate way to do what you want would be to use ProductFlavours.

You start by adding the following to your app's build.gradle:

android {  
    productFlavors {
        dev {
            applicationId "com.yourapp.dev" //one in development mode
        }

        prod {
            applicationId "com.yourapp" //the package name for your released app
        }
    }
}

You can add parameters different for the dev and production apk(s) as BuildConfig fields.
Do study more about it, will be able to implement it in the way you want. You can start with
Mastering product flavours on android

Upvotes: 1

Bandna Prasher
Bandna Prasher

Reputation: 18

Just change the applicaiton's Id property which is located in the app module's build.gradle.

Upvotes: 0

Riyaz Parasara
Riyaz Parasara

Reputation: 154

1-First of All Please Change Your Current Application Package name 2-Build The Application 3-We can't use same package name in android 4-Work Will File after completion this steps.

Upvotes: 0

Dante
Dante

Reputation: 221

Change version code and version name in build.gradle. Hope this will help you.

Upvotes: 0

Shaishav
Shaishav

Reputation: 5312

Just change the applicaitonId property in the app module's build.gradle.

Upvotes: 0

Tomek Gozdek
Tomek Gozdek

Reputation: 226

The easiest and the fastest way is to change application package name.

Upvotes: 2

Related Questions