So its time to add an in-build updater to your application , so as i did in previous tutorial this post will be also a continuation of the Android Studio Tutorials .
We are doing Android Studio projects as a continuation , so am just moving on to the main part . I will explain the basic things here as post and rest you can refer to my youtube video .
Watch The Video And Follow Me :
We are doing Android Studio projects as a continuation , so am just moving on to the main part . I will explain the basic things here as post and rest you can refer to my youtube video .
Watch The Video And Follow Me :
- Start a new project or you can add it in an existing project .
- Choose Application name , domain name , package name ...
- And i am doing this project on Navigation Drawer Activity .
- After gradle building and all follow the bellow steps .
- Download volley.jar file from the download options or click here .
- Now we have to add it to our project .
- Choose Project instead of Android .
- Open your project -> app -> libs .
- Now copy the downloaded file volley.jar and paste it on the libs file .
- Now after pasting left click and select the option Add as Library .
- Now the gradle will build and after that you need to go back to Android .
- Go to AndroidManifest.xml .
- Select the entire codes and replace it with this and be sure that you don't change your package name for me its com.appname.app .
- Now go to java part .
- Select your package name , left click and select New -> Java Class .
- Name the class UpdateService .
- Select the entire code except the package name and replace it with this .
- Here you need a github account and create a github page .
- For that you need to make a repository with the same name of that of your user name that you used in the github account .
- Now you must create a page with content just number "1" .
- Now copy the link of the page and replace my github page link https://vishnutechmobs.github.io/update-link.html with yours .
- When you change this number "1" to any link "2" update box appears .
- And also the content inside " boolean resp = response.contains("1"); " this line which is 1 here must be same as that of the github page content .
- Then by changing the github page content "1" to "2" etc you can announce update .
- In short it works in a synchronous manner . If any one of the content is different then update box comes .
- An important note : don't forget to change the value "1" on the UpdateService to the change value on your updated application . If you have any doubt feel free to contact me .
- Now create another java class . New -> Java Class .
- Name it UpdateDialog .
- Select the entire code except the package name and replace it with this .
- Now go to MainActivity .
- Select the entire code except the package name and replace it with this .
- Thats it your application with In-Build Updater is ready to be build .
- Go to build option and choose option Build APK .
Part 1 - Build An Application For Your Website ( Link To The Post - Click Here )
Post A Comment:
0 comments: