Android Programming Press on the image to return to the main documentation page.

AppUpdating

Written by UDG

List of types:

cl_appupdate
Deprecated_HttpJob
Deprecated_MultipartFileData

cl_appupdate

Class module: cl_appupdate
Version: 2.00
Author: UDG
Last Modified: 18.10.2018
Location: Di Gioia Consulting - Lugano (CH)

This is an 'Activity Object', it cannot be declared under Sub Process_Globals.

Events:

None

Members:


  CanRequestPackageInstalls As Boolean

  CheckNonMarketAppsEnabled As Boolean

  CurVN As String [read only]

  DownloadApk

  ERR_DOWNLOAD As Int

  ERR_HTML As Int

  ERR_HTTP As Int

  ERR_NOAPK As Int

  ERR_NOPERM As Int

  ERR_NOPKG As Int

  ERR_NOSPACE As Int

  ERR_NOTXT As Int

  ERR_TXTROW As Int

  GetAvailableSpace As Long

  getCurVN As String

  getPackageName As String

  getStatus As Int

  getWebChangeLog As String

  getWebFileSize As String

  getWebVN As String

  Initialize (CallbackModule As Object, EventName As String) As String

  InstallApk (pstatus As Boolean) As String

  IsInitialized As Boolean

  NewVerApk As String [write only]

  NewVerTxt As String [write only]

  NO_NEWERAPK As Int

  OK_CURVER As Int

  OK_DOWNLOAD As Int

  OK_INIT As Int

  OK_INSTALL As Int

  OK_NEWERAPK As Int

  OK_WEBVER As Int

  PackageName As String

  ReadCurVN As String

  ReadWebVN

  SetAndStartSplashScreen (CallingAct As ActivityWrapper, BM As BitmapWrapper) As String

  setCredentials (UserN As String, UserP As String) As String

  setNewVerApk (NVA As String) As String

  setNewVerTxt (NVT As String) As String

  setPackageName (PN As String) As String

  setVerbose (Verbose As Boolean) As String

  Status As Int [read only]

  StopSplashScreen As String

  UpdateApk (pstatus As Boolean)

  Verbose As Boolean [write only]

  WebChangeLog As String [read only]

  WebFileSize As String [read only]

  WebVN As String [read only]

Members description:

CanRequestPackageInstalls As Boolean
Starting from Android 8 (API 26) each app needs to explicitly request a special permission to install other apps.
CheckNonMarketAppsEnabled As Boolean
Check if installation of non-market apps is allowed
CurVN As String [read only]
Returns current version number value (as a string)
Valid only after calling ReadCurVN
DownloadApk
Downloads newer apk from webserver
ERR_DOWNLOAD As Int
ERR_HTML As Int
ERR_HTTP As Int
ERR_NOAPK As Int
ERR_NOPERM As Int
ERR_NOPKG As Int
ERR_NOSPACE As Int
ERR_NOTXT As Int
ERR_TXTROW As Int
GetAvailableSpace As Long
Returns device's available space. Use to test whether there's enough room to load apk from webserver
getCurVN As String
Returns current version number value (as a string)
Valid only after calling ReadCurVN
getPackageName As String
Gets back the package name set for this app. Used internally.
getStatus As Int
Returns current internal status. Negatives denote ERRORS/WARNINGS.
getWebChangeLog As String
Returns optional change log data (as a string) as read from the info text file on the webserver
Valid only after successfully calling ReadWebVN
getWebFileSize As String
Returns optional apk's file size (as a string) as read from the info text file on the webserver
Valid only after successfully calling ReadWebVN
getWebVN As String
Returns the version number value (as a string) as read from the info text file on the webserver.
Valid only after successfully calling ReadWebVN
Initialize (CallbackModule As Object, EventName As String) As String
Initializes the object. You can add parameters to this method if needed.
InstallApk (pstatus As Boolean) As String
Installs an already downloaded apk. Pstatus = result from a call to CheckInstallationRequirements in calling activity
IsInitialized As Boolean
Tests whether the object has been initialized.
NewVerApk As String [write only]
Complete path to the new apk for your app, available for download from the webserver
NewVerTxt As String [write only]
Complete path to the info text file having a first line of text formatted as
ver=x.yz where x.yz corresponds to the newest app's version available on the webserver
Optionally that first line of text could be followed by ChangeLog and FileSize sections
NO_NEWERAPK As Int
OK_CURVER As Int
OK_DOWNLOAD As Int
OK_INIT As Int
OK_INSTALL As Int
OK_NEWERAPK As Int
OK_WEBVER As Int
PackageName As String
Gets back the package name set for this app. Used internally.
ReadCurVN As String
Reads current version number from running copy of apk (see Attribute #VersionName).
Valid if StatusCode = OK_CURVER
ReadWebVN
Reads version number as published in the text info file on the webserver
Valid if StatusCode = OK_WEBVER
SetAndStartSplashScreen (CallingAct As ActivityWrapper, BM As BitmapWrapper) As String
Optional sub - superimposes a simple splash screen on the calling Activity.
To remove the splash screen, call StopSplashScreen from Activity (generally in the callback function. See "Initialize")
CallingAct - Activity object whose layout will be superimposed with BM in a panel
BM - Bitmap object to be shown while apk checking is in progress
setCredentials (UserN As String, UserP As String) As String
Sets Username and Password to use when downloading from a protected website folder
setNewVerApk (NVA As String) As String
Complete path to the new apk for your app, available for download from the webserver
setNewVerTxt (NVT As String) As String
Complete path to the info text file having a first line of text formatted as
ver=x.yz where x.yz corresponds to the newest app's version available on the webserver
Optionally that first line of text could be followed by ChangeLog and FileSize sections
setPackageName (PN As String) As String
Sets package name for this app. It should equal the value in menu "Project.Build configurations.Package"
Example: com.test.myapp
setVerbose (Verbose As Boolean) As String
Sets verbose mode on/off
Status As Int [read only]
Returns current internal status. Negatives denote ERRORS/WARNINGS.
StopSplashScreen As String
Stops and removes the superimposed splash screen if it's showing
UpdateApk (pstatus As Boolean)
Check website for a newer apk version and (if any exists) try to download it, then ask user to install it.
Note: we don't know if the user will then accept to install it..
Verbose As Boolean [write only]
Sets verbose mode on/off
WebChangeLog As String [read only]
Returns optional change log data (as a string) as read from the info text file on the webserver
Valid only after successfully calling ReadWebVN
WebFileSize As String [read only]
Returns optional apk's file size (as a string) as read from the info text file on the webserver
Valid only after successfully calling ReadWebVN
WebVN As String [read only]
Returns the version number value (as a string) as read from the info text file on the webserver.
Valid only after successfully calling ReadWebVN

Deprecated_HttpJob

version 2.70
Class module

Events:

None

Members:


  Class_Globals As String

  Complete (id As Int) As String

  Delete (Link As String) As String

  Delete2 (Link As String, Parameters() As String) As String

  Download (Link As String) As String

  Download2 (Link As String, Parameters() As String) As String

  ErrorMessage As String

  GetBitmap As Object

  GetBitmapResize (Width As Int, Height As Int, KeepAspectRatio As Boolean) As Object

  GetBitmapSample (Width As Int, Height As Int) As Object

  GetInputStream As Object

  GetRequest As Object

  GetString As String

  GetString2 (Encoding As String) As String

  Head (Link As String) As String

  Initialize (Name As String, TargetModule As Object) As String

  IsInitialized As Boolean

  JobName As String

  Password As String

  PatchBytes (Link As String, Data() As Byte) As String

  PatchString (Link As String, Text As String) As String

  PostBytes (Link As String, Data() As Byte) As String

  PostFile (Link As String, Dir As String, FileName As String) As String

  PostMultipart (Link As String, NameValues As Object, Files As Object) As String

  PostString (Link As String, Text As String) As String

  PutBytes (Link As String, Data() As Byte) As String

  PutString (Link As String, Text As String) As String

  Release As String

  Response As Object

  Success As Boolean

  Tag As Object

  Username As String

Members description:

Class_Globals As String
Complete (id As Int) As String
Called by the service when job completes
Delete (Link As String) As String
Delete2 (Link As String, Parameters() As String) As String
Download (Link As String) As String
Submits a HTTP GET request.
Consider using Download2 if the parameters should be escaped.
Download2 (Link As String, Parameters() As String) As String
Submits a HTTP GET request.
Encodes illegal parameter characters.
Example:
job.Download2("http://www.example.com", _
  Array As String("key1", "value1", "key2", "value2"))

ErrorMessage As String
GetBitmap As Object
Returns the response as a bitmap
GetBitmapResize (Width As Int, Height As Int, KeepAspectRatio As Boolean) As Object
Returns the response as a bitmap loaded LoadBitmapResize.
GetBitmapSample (Width As Int, Height As Int) As Object
Returns the response as a bitmap loaded with LoadBitmapSample.
It is recommended to use GetBitmapResize instead.
GetInputStream As Object
Returns the response input stream.
GetRequest As Object
Called by the service to get the request
GetString As String
Returns the response as a string encoded with UTF8.
GetString2 (Encoding As String) As String
Returns the response as a string.
Head (Link As String) As String
Sends a HEAD request.
Initialize (Name As String, TargetModule As Object) As String
Initializes the Job.
Name - The job's name. Note that the name doesn't need to be unique.
TargetModule - The activity or service that will handle the JobDone event.
IsInitialized As Boolean
Tests whether the object has been initialized.
JobName As String
Password As String
PatchBytes (Link As String, Data() As Byte) As String
Sends a PATCH request with the given data as the request payload.
PatchString (Link As String, Text As String) As String
Sends a PATCH request with the given string as the request payload.
PostBytes (Link As String, Data() As Byte) As String
Sends a POST request with the given string as the post data
PostFile (Link As String, Dir As String, FileName As String) As String
Sends a POST request with the given file as the post data.
This method doesn't work with assets files.
PostMultipart (Link As String, NameValues As Object, Files As Object) As String
Sends a multipart POST request.
NameValues - A map with the keys and values. Pass Null if not needed.
Files - List of MultipartFileData items. Pass Null if not needed.
PostString (Link As String, Text As String) As String
Sends a POST request with the given data as the post data.
PutBytes (Link As String, Data() As Byte) As String
Sends a PUT request with the given string as the post data
PutString (Link As String, Text As String) As String
Sends a PUT request with the given data as the post data.
Release As String
Should be called to free resources held by this job.
Response As Object
Success As Boolean
Tag As Object
Username As String

Deprecated_MultipartFileData


Events:

None

Members:


  ContentType As String

  Dir As String

  FileName As String

  Initialize

  IsInitialized As Boolean

  KeyName As String

Members description:

ContentType As String
Dir As String
FileName As String
Initialize
Initializes the fields to their default value.
IsInitialized As Boolean
Tests whether the object has been initialized.
KeyName As String

Top