PROFESSIONAL NEWSGROUPS
WINDEV
,
WEBDEV
and
WINDEV Mobile
Home
|
Recent messages
|
Connect
|
Sign out
|
English
Home
→
WINDEV 25
→
WM - Java Android GPS ON/OFF com Windev Mobile
WM - Java Android GPS ON/OFF com Windev Mobile
Started by adrianoboller, Feb., 27 2016 2:41 AM - 2 replies
Connect yourself…
adrianoboller
#1
Registered member
3,659 messages
Popularité : +175 (223 votes)
Posted on February, 27 2016 - 2:41 AM
Prezados,
Segue mais um exemplo usando Java Nativo no Windev Mobile:
//BroadcastReceiver GPS_On
import android.app.Activity
;
import java.lang
.
*
;
import android.util
.
*
;
import java.lang.Exception
;
import android.util.Log
;
import android.content.BroadcastReceiver
;
import android.content.Context
;
import android.content.Intent
;
import android.os.Bundle
;
PUBLIC static
void GPS_On
(
)
{
Intent intent
=
new
Intent
(
"android.location.GPS_ENABLED_CHANGE"
)
;
intent.putExtra
(
"enabled"
,
True
)
;
getActiviteEnCours
(
)
.
sendBroadcast
(
intent
)
;
}
Modo de usar
GPS_On
(
)
//BroadcastReceiver GPS_Off
import android.app.Activity
;
import java.lang
.
*
;
import android.util
.
*
;
import java.lang.Exception
;
import android.util.Log
;
import android.content.BroadcastReceiver
;
import android.content.Context
;
import android.content.Intent
;
import android.os.Bundle
;
PUBLIC static
void GPS_Off
(
)
{
Intent intent
=
new
Intent
(
"android.location.GPS_ENABLED_CHANGE"
)
;
intent.putExtra
(
"enabled"
,
False
)
;
getActiviteEnCours
(
)
.
sendBroadcast
(
intent
)
;
}
Modo de usar
GPS_Off
(
)
Bons estudos!
--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 9949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.blogspot.com.br/
Report
0
0
Willian Fernando
#2
Registered member
123 messages
Popularité : +46 (46 votes)
Posted on February, 27 2016 - 4:28 PM
Isto so funciona para os android 3.2 < os 4.> não permite mais ligar ou desligar o GPS via Codigo, sim o sim o usuario tem que fazer
--
Atte. Willian Fernando
Report
1
0
adrianoboller
#3
Registered member
3,659 messages
Popularité : +175 (223 votes)
Posted on March, 15 2016 - 10:29 PM
Exatamente Willian...
Ou seja cada vez a programação que use códigos que usem o CORE do sistema operacional do celular esta cada vez mais fechado e mais seguro por outro lado.
Bons estudos a todos
--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 9949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.blogspot.com.br/
Report
0
0
→ Go back to WINDEV 25
WINDEV 25
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