PROFESSIONAL NEWSGROUPS
WINDEV
,
WEBDEV
and
WINDEV Mobile
Home
|
Recent messages
|
Connect
|
Sign out
|
English
Home
→
WINDEV Mobile 2024
→
Install Apk's
Install Apk's
Started by adrianoboller, Nov., 24 2014 11:59 AM - 2 replies
Connect yourself…
adrianoboller
#1
Registered member
3,657 messages
Popularité : +175 (223 votes)
Posted on November, 24 2014 - 11:59 AM
//InstallApk - Funcional - Perfeito
import android.app.Activity
;
import android.content.Intent
;
import android.content.pm.PackageInfo
;
import android.net.Uri
;
import android.os.Bundle
;
import android.os.Environment
;
import android.view.View
;
import android.util
.
*
;
import java.lang
.
*
;
import java.lang.Exception
;
import java.io.ByteArrayOutputStream
;
import java.io.File
;
import java.io.FileOutputStream
;
import java.io.IOException
;
import java.io.InputStream
;
//InstallApk("/mnt/sdcard/Pado/Install/","padorun.apk")
//
//InstallApk("/mnt/sdcard/Pado/Install/","pado.apk")
PUBLIC static boolean
InstallApk
(
string
Diretorio
,
string
Aplicativo
)
{
try
{
IF
(
Aplicativo
=
=
null
)
{
RETURN
False
;
}
ELSE
{
File File
=
new File
(
Diretorio
,
Aplicativo
)
;
Intent intent
=
new
Intent
(
Intent.ACTION_VIEW
)
;
intent.setDataAndType
(
Uri.fromFile
(
File
)
,
"application/vnd.android.package-archive"
)
;
intent.setFlags
(
Intent.FLAG_ACTIVITY_NEW_TASK
)
;
getActiviteEnCours
(
)
.
startActivity
(
intent
)
;
RETURN
True
;
}
}
catch
(
EXCEPTION
e
) {
Log.e
(
"WM"
,
e.toString
(
)
)
;
RETURN
False
;
}
}
Report
0
0
adrianoboller
#2
Registered member
3,657 messages
Popularité : +175 (223 votes)
Posted on November, 24 2014 - 11:59 AM
InstallApk
(
string
Diretorio
,
string
Aplicativo
)
Report
0
0
Jacquelinebriggs
#3
Registered member
1 message
Posted on July, 27 2023 - 11:42 AM
great
Report
0
0
→ Go back to WINDEV Mobile 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (earlier versions)
Français
English
Español
Portuguesa
Close this window
Search type
Only topics
All the messages
Search period
Any time
Past hour
Past 24 hours
Past week
Past month
Past year
Cancel
Preview of your message
Adding an image
Import an image from a URL
Send an image from a file of your disk
Drop a file or click "Browse..."
or
Cancel
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Text