FOROS PROFESIONALES
WINDEV
,
WEBDEV
y
WINDEV Mobile
Inicio
|
Mensajes recientes
|
Conéctese...
|
Desconectar
|
Español
Inicio
→
WINDEV Mobile 2024
→
[WM24] Utilizing Android APK Expansion Files?
[WM24] Utilizing Android APK Expansion Files?
Iniciado por Claire, 15,jul. 2019 18:08 - No hay respuesta
Conéctese…
Claire
#1
Miembro registrado
48 mensajes
Publicado el 15,julio 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
)
Informar
0
0
→ Volver a WINDEV Mobile 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (versiones precedentes)
Français
English
Español
Portuguesa
Fermer cette fenêtre
Búsqueda Tipo
Sólo temas
Todos los mensajes
Periodo Buscar
Cualquier fecha
Última hora
Última 24 horas
Última semana
Último mes
Último año
Cancelar
Vista previa del mensaje
Añadiendo una imagen
Importar una imagen desde una URL
Enviar una imagen desde un archivo de su disco
Arrastrar un archivo o click en "Examinar..."
o
Cancelar
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Texto