manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.pvijayalakshmi.previousversion">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
grade file
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "27.0.1"
defaultConfig {
applicationId "com.example.pvijayalakshmi.previousversion"
minSdkVersion 15
targetSdkVersion 26
versionCode 2
versionName "1.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:26.+'
testCompile 'junit:junit:4.12'
}
I have developed an application. And I have installed it on my phone.
Now I have a requirement of adding one column to the my application. I have added one column to the database. I have made changes to the onUpgrade()
. I have changed the database version from 1 to 2.
I have changed the version code and version name in gradle
file.
I don't want to uninstall the app and re installing. I want to upgrade the app automatically.
Now I am trying to install my application(after adding column to database) in phone where previous application is also existed.
I need to upgrade my previously existed application. But I am facing issue here. The present app does not overwrite the previous application. Both applications packages names are same here.
How can I overcome this. I need the programmatic solution.
For example we have many apps like whatsapp. They have made changes to the app and releases. So, we directly update to the new version with out uninstalling our existing whatsapp. Like wise I am trying to do.
Any help would be appreciated.
When I am trying to install application, It is showing like this.