GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEV
,
WEBDEV
e
WINDEV Mobile
Inicio
|
Mensagens recentes
|
Conecte-se...
|
Disconnect
|
Português
Inicio
→
WINDEV Mobile 2024
→
[WM24] Utilizing Android APK Expansion Files?
[WM24] Utilizing Android APK Expansion Files?
Iniciado por Claire, jul., 15 2019 6:08 PM - Sem resposta
Conecte-se…
Claire
#1
Membro registado
48 mensagems
Publicado em julho, 15 2019 - 6:08 PM
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
)
Denunciar
0
0
→ Voltar para WINDEV Mobile 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (versões anteriores)
Français
English
Español
Portuguesa
Fermer cette fenêtre
Tipo de Pesquisa
Apenas tópicos
Todas as mensagens
Período de pesquisa
Qualquer momento
Última hora
Últimas 24 horas
Semana passada
Mês passado
Ano passado
Cancelar
Pré-visualização da sua mensagem
Adicionar imagem
Importar uma imagem de uma URL
Enviar uma imagem a partir do seu disco
Deixe um ficheiro ou clique em "Procurar ..."
ou
Cancelar
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Texto