FORUMS PROFESSIONNELS
WINDEV
,
WEBDEV
et
WINDEV Mobile
Accueil
|
Messages récents
|
Connexion
|
Déconnexion
|
Français
Accueil
→
WINDEV Mobile 2024
→
[WM24] Utilizing Android APK Expansion Files?
[WM24] Utilizing Android APK Expansion Files?
Débuté par Claire, 15 juil. 2019 18:08 - Aucune réponse
Connectez-vous…
Claire
#1
Membre enregistré
48 messages
Posté le 15 juillet 2019 - 18:08
Does anyone have any experience with using APK expansion files?
Right now we are having an issue where upon initialization of our app (first time the app is opened) it downloads images and some information via FTP. For some reason, after it says "downloading photos" the message refreshes and it starts the process of downloading photos again? I am not entirely sure where this problem is occurring and free tech support won't look at my entire app (seeing that I sent them the whole version because I am not sure what bits and pieces are working together at the moment the error occurs.
I was thinking of changing the app to use the APK expansion files process where I can upload a zip file with the APK and access the information that way but there doesn't seem to be any information on what code is needed unless you are using Android Studio.
This is the code, from what I can tell, that is handling the extraction - has any of this language changed between WM 22 and WM 24? I don't receive any error messages at all, just the constant loop around 'downloading photos'
//GET IMAGES: WORKAROUND USING APK EXTENSIONS TO BYPASS 50 MB APK MAX LIMIT
s
APKExtensionFile
is string
s
APKExtDir
is string
//sDownLoadImagesZip is string
s
ImageZip
is string
n
Connection
is int
s
ImageZip
=
""
s
APKExtDir
=
SysDirStorageCard
(
) +
"/Android/obb/edu.misin.edu/"
fDelete
(
s
APKExtDir
+ [
"/"
] +
"*.obb"
)
s
APKExtensionFile
=
s
APKExtDir
+
"main."
+
gn
AndroidVersion
+
".edu.misin.edu.obb"
//sDownLoadImagesZip = gsTempDir + "Images.zip"
IF
NOT
fDirectoryExist
(
s
APKExtDir
)
THEN
fMakeDir
(
s
APKExtDir
)
END
//temporary to test: if it is a real APK extension, do not delete
IF
fFileExist
(
s
APKExtensionFile
)
THEN
fDelete
(
s
APKExtensionFile
)
END
WHEN EXCEPTION IN
WIN_Extract.STC_Extracting
=
"Connecting to server..."
Multitask
(
-
1
)
n
Connection
=
FTPConnect
(
gs
FTPServer
,
gs
FTPUser
,
gs
FTPPass
,
gn
FTPPort
)
IF
n
Connection
<
> -
1
THEN
gb
FirstImageZipDownload
=
True
WIN_Extract.STC_Extracting
=
"Downloading Photos..."
Multitask
(
-
1
)
fCreate
(
s
APKExtensionFile
)
IF
FTPGet
(
n
Connection
,
gs
FTPDownloadDir
+
"Resources/Images/Images.zip"
,
s
APKExtensionFile
,
FTPDownloadImagesProgress
) =
True
THEN
s
ImageZip
=
s
APKExtensionFile
ELSE
NextTitle
(
"Alert"
)
Error
(
"Unable to download images from server: "
+
ErrorInfo
(
errMessage
)
,
"Please try reloading from the Settings page."
)
END
ELSE
NextTitle
(
"Alert"
)
Error
(
"Unable to connect to the server: "
+
ErrorInfo
(
errMessage
)
,
"Images could not be downloaded."
,
"Please try reloading from the Settings page."
)
END
DO
NextTitle
(
"Alert"
)
Error
(
"Unable to connect to the server: "
+
HError
(
)
,
"Images could not be downloaded."
,
"Please try reloading from the Settings page."
)
RETURN
END
//unzip
IF
NOT
s
ImageZip
=
""
THEN
ResOpenArchiveImage
=
zipOpen
(
"ArchiveImage"
,
s
ImageZip
)
IF
ResOpenArchiveImage
=
0
THEN
// Extract all the files from the archive
ResExtractAllImage
=
zipExtractAll
(
"ArchiveImage"
,
CompleteDir
(
fCurrentDir
(
) +
"/Resources/Images"
)
)
END
zipClose
(
"ArchiveImage"
)
END
//temporary to test: if it is a real APK extension, do not delete
IF
fFileExist
(
s
APKExtensionFile
)
THEN
fDelete
(
s
APKExtensionFile
)
END
// Text that appears on the WIN_Extract page during the above process
WIN_Extract.STC_Extracting
=
"Extracting resources..."
WIN_Extract.PROGBAR_Populating
..
Visible
=
False
Multitask
(
-
1
)
Signaler
0
0
→ Revenir à WINDEV Mobile 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (précédentes versions)
Français
English
Español
Portuguesa
Fermer cette fenêtre
Type de recherche
Uniquement les sujets
Tous les messages
Période de recherche
Date indifférente
Moins d'une heure
Moins de 24 heures
Moins d'une semaine
Moins d'un mois
Moins d'un an
Annuler
Aperçu de votre message
Ajouter une image
Importer une image depuis une URL
Envoyer une image depuis un fichier de votre disque
Déposez ici un fichier ou cliquez sur "Parcourir..."
ou
Annuler
0%
WLangage
SQL
XML, HTML
JAVA, Javascript
Texte