Forum Stats

  • 3,815,688 Users
  • 2,259,067 Discussions
  • 7,893,207 Comments

Discussions

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

TreeStrepek
TreeStrepek Member Posts: 260
edited Jul 2, 2014 12:22PM in JDeveloper and ADF

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:

<span class="typ" style="color: #2b91af; background: transparent;">String</span><span class="pln" style="background: transparent;"> response </span><span class="pun" style="background: transparent;">=</span><span class="pln" style="background: transparent;"> </span><span class="typ" style="color: #2b91af; background: transparent;">SendNetworkUpdateAppRequest</span><span class="pun" style="background: transparent;">();</span><span class="pln" style="background: transparent;"> </span><span class="com" style="color: #808080; background: transparent;">// Your code to do the network request</span><span class="pln" style="background: transparent;"><br/>   </span><span class="com" style="color: #808080; background: transparent;">// should send the current version </span><span class="com" style="color: #808080; background: transparent;">to the server</span><span class="pln" style="background: transparent;"><br/></span><span class="kwd" style="color: #00008b; background: transparent;">if</span><span class="pun" style="background: transparent;">(</span><span class="pln" style="background: transparent;">response </span><span class="pun" style="background: transparent;">==</span><span class="pln" style="background: transparent;"> </span><span class="str" style="color: #800000; background: transparent;">"YES"</span><span class="pun" style="background: transparent;">)</span><span class="pln" style="background: transparent;"> </span><span class="com" style="color: #808080; background: transparent;">// Start Intent to download the app user has to manually install it by clicking on the notification</span><span class="pln" style="background: transparent;"><br/>  startActivity</span><span class="pun" style="background: transparent;">(</span><span class="kwd" style="color: #00008b; background: transparent;">new</span><span class="pln" style="background: transparent;"> </span><span class="typ" style="color: #2b91af; background: transparent;">Intent</span><span class="pun" style="background: transparent;">(</span><span class="typ" style="color: #2b91af; background: transparent;">Intent</span><span class="pun" style="background: transparent;">.</span><span class="pln" style="background: transparent;">ACTION_VIEW</span><span class="pun" style="background: transparent;">,</span><span class="pln" style="background: transparent;"> </span><span class="typ" style="color: #2b91af; background: transparent;">Uri</span><span class="pun" style="background: transparent;">.</span><span class="pln" style="background: transparent;">parse</span><span class="pun" style="background: transparent;">(</span><span class="str" style="color: #800000; background: transparent;">"URL TO LATEST APK"</span><span class="pun" style="background: transparent;">)));</span>

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?

Tagged:

Best Answer

Answers

This discussion has been closed.