Android Question Problem on Upload with Dropbox API V2

stefanoa

Active Member
Licensed User
Longtime User
when i start dbx.UploadSessionStart(session), upload is stopped when the phone going in standby (display with savescreen)
how can I keep it from seizing the upload or resume upload?
thanks
 

DonManfred

Expert
Licensed User
Longtime User
Prevent the app from going to sleep (set a partial wakelock)
 
Upvote 0

stefanoa

Active Member
Licensed User
Longtime User
ok, i solved with this code:
B4X:
Sub uploadFile

    '-- set Phone alive ---
    Dim pws As PhoneWakeState
    pws.KeepAlive(True)

        ....

and when finished:
B4X:
Sub DropBox_UploadSessionFinish(session As Map)
   
    '-- reset Phone state ---
    Dim pws As PhoneWakeState
    pws.ReleaseKeepAlive

       ......

thanks
 
Upvote 0
Top