Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: Android Java API  (Read 8264 times)
.
Posts: 9


« on: May 15, 2017, 06:45:50 pm »

Hi, I'm hoping that someone might be able to assist with the following code example.  We are using Genero Mobile and have developed an app for use on Android.  We wish to use the Android DonwloadManager Service to manage the download of new software versions of our app.  The apps are hosted on a website that the devices have access to.  We are not using Android Market.

We are using GMA 1.20.15, BDL 3.00.14. 

I must also stress that we are not that familiar with Java, although by looking at the examples in the Documentation and also on line at similar Java code we have a good idea what is needed.  The test code attached covers what we have tested so far.  The problem is the line below the comment.  I'm not sure if this is the correct way to add the DownloadManager Request to the download queue.  The syntax passes ok within Genero Studio and it compile ok.  There might also be mistakes in the lines above that but when deployed to a device the code executes without any issues up until it reaches the CALL dm.enqueue(dr) line.  At that point GMA stops with the message "Unfortunately, <appname> has stopped".

The Android Developer docs indicate that a value of type Long is returned when adding a download to the queue.  This may be the issue but I can't see how to assign that value from the code.  All Android permissions etc have been set as required for the purpose of the Android API.

download.4gl attached.

If anyone can assist with the syntax that would be appreciated.

Thanks
Darren



* download.4gl (1.42 KB - downloaded 659 times.)
Neil M.
Four Js
Posts: 21


« Reply #1 on: May 18, 2017, 03:06:14 pm »

Can you clarify the versions of the Android environment you are using. I tried to compile the code and 'setAllowedOverMetered' is not a valid method.
No member function 'setAllowedOverMetered(boolean)' for class 'android.app.DownloadManager$Request' defined.

Removing that line allows the code to compile okay.

You can also just use an INTEGER for the return of the 'enqueue' call.
Unfortunately it still crashes for me ( using GMA 3.10.03 ) on that call.

i'll investigate some more.
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines