Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

MAF: LifeCycleListener.Start("Does Installed App have newer version in PlayStore-AppStore")?

TreeStrepek-JavaNetJul 1 2014 — edited Jul 2 2014

Good Day:

I have spent time trying to decode how to get my app to programmatically check if there is a newer version on the AppStore or PlayStore on launch.  Now that MAF is out I am wondering it the framework provides a direct solution for this?  Here's what my research has revealed thus far:

  • the code will be called from the app's LifeCycleListener.Start() method which fires at launch
  • I found these code solutions:

ANDROID OPTION:

String response = SendNetworkUpdateAppRequest(); // Your code to do the network request
  
// should send the current version to the server
if(response == "YES") // Start Intent to download the app user has to manually install it by clicking on the notification
  startActivity
(new Intent(Intent.ACTION_VIEW, Uri.parse("URL TO LATEST APK")));

ANDROID OPTION:

intent.setDataAndType (Uri.fromFile(new File(Environment.getExternalStorageDirectory() + "/download/" + ApkName.toString())), "application/vnd.android.package-archive"); startActivity(intent);

Does MAF framework have a solution?

This post has been answered by Timo Hahn on Jul 2 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 30 2014
Added on Jul 1 2014
2 comments
1,364 views