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

AppUpdating

Written by UDG

List of types:

cl_appupdate
HttpJob
MultipartFileData

cl_appupdate


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

Permissions:

android.permission.WRITE_EXTERNAL_STORAGE

Events:

None

Members:


  CurVN As String [read only]

  DownloadApk As String

  ERR_HTTP As Int

  ERR_NOAPK As Int

  ERR_NOPKG As Int

  ERR_NOTXT As Int

  ERR_TXTROW As Int

  getCurVN As String

  getPackageName As String

  getStatus As Int

  getWebChangeLog As String

  getWebVN As String

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

  InstallApk 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 As String

  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 As String

  Verbose As Boolean [write only]

  WebChangeLog As String [read only]

  WebVN As String [read only]

Members description:

CurVN As String [read only]
Returns current version number value (as a string)
Valid only after calling ReadCurVN
DownloadApk As String
Downloads newer apk from webserver
ERR_HTTP As Int
ERR_NOAPK As Int
ERR_NOPKG As Int
ERR_NOTXT As Int
ERR_TXTROW As Int
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 .txt file on the webserver
Valid only after calling ReadWebVN
getWebVN As String
Returns the version number value (as a string) as read from the .txt file on the webserver.
Valid only after calling ReadWebVN
Initialize (CallbackModule As Object, EventName As String) As String
Initializes the object. You can add parameters to this method if needed.
InstallApk As String
Installs an already downloaded apk
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
NewVerTxt As String [write only]
Complete path to the .txt file having a single line of text formatted as
ver=x.xx where x.xx corresponds to the newest web-published app's version
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 #VersionName).
Valid if StatusCode = OK_CURVER
ReadWebVN As String
Reads version number as published in the .txt file on 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
setNewVerTxt (NVT As String) As String
Complete path to the .txt file having a single line of text formatted as
ver=x.xx where x.xx corresponds to the newest web-published app's version
setPackageName (PN As String) As String
Sets package name for this app. It should equal the value in menu "Project.Package Name"
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
UpdateApk As String
Check on website for a newer apk version and (if any exists) downloads it.
We don't know if the user will then 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 .txt file on the webserver
Valid only after calling ReadWebVN
WebVN As String [read only]
Returns the version number value (as a string) as read from the .txt file on the webserver.
Valid only after calling ReadWebVN

HttpJob

version 2.61
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

  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.
Success As Boolean
Tag As Object
Username As String

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