PROFESSIONAL NEWSGROUPS
WINDEV
,
WEBDEV
and
WINDEV Mobile
Home
|
Recent messages
|
Connect
|
Sign out
|
English
Home
→
WINDEV Mobile 2024
→
Celular Sim Card Serial
Celular Sim Card Serial
Started by adrianoboller, Nov., 24 2014 12:01 PM - 3 replies
Connect yourself…
adrianoboller
#1
Registered member
3,651 messages
Popularité : +175 (223 votes)
Posted on November, 24 2014 - 12:01 PM
import android.app.Activity
;
import android.content.Context
;
import android.content.Intent
;
import android.content.SharedPreferences
;
import android.content.SharedPreferences.Editor
;
import android.os.Bundle
;
import android.telephony.TelephonyManager
;
import android.util.Log
;
import android.widget.Toast
;
import android.provider.Settings.Secure
;
PUBLIC static string
CelularSimCardSerial
(
)
{
TelephonyManager tm
;
tm
= (
TelephonyManager
)
getApplicationContext
(
)
.
getSystemService
(
Context.TELEPHONY_SERVICE
)
;
string
num
=
tm.getSimSerialNumber
(
)
;
RETURN
(
num
)
;
}
Report
0
0
adrianoboller
#2
Registered member
3,651 messages
Popularité : +175 (223 votes)
Posted on November, 24 2014 - 12:02 PM
import android.app.Activity
;
import android.content.Context
;
import android.content.Intent
;
import android.content.SharedPreferences
;
import android.content.SharedPreferences.Editor
;
import android.os.Bundle
;
import android.telephony.TelephonyManager
;
import android.util.Log
;
import android.widget.Toast
;
import android.provider.Settings.Secure
;
PUBLIC static string
CelularGetDeviceId
(
)
{
TelephonyManager tm
;
tm
= (
TelephonyManager
)
getApplicationContext
(
)
.
getSystemService
(
Context.TELEPHONY_SERVICE
)
;
string
num
=
tm.getDeviceId
(
)
;
RETURN
(
num
)
;
}
Report
0
0
adrianoboller
#3
Registered member
3,651 messages
Popularité : +175 (223 votes)
Posted on November, 24 2014 - 12:02 PM
import android.app.Activity
;
import android.content.Context
;
import android.content.Intent
;
import android.content.SharedPreferences
;
import android.content.SharedPreferences.Editor
;
import android.os.Bundle
;
import android.telephony.TelephonyManager
;
import android.util.Log
;
import android.widget.Toast
;
import android.provider.Settings.Secure
;
//Android Manisfest
//<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
//Requires READ_PHONE_STATE uses-permission
PUBLIC static string
CelularDadosGerais
(
)
{
TelephonyManager tm
;
tm
= (
TelephonyManager
)
getApplicationContext
(
)
.
getSystemService
(
Context.TELEPHONY_SERVICE
)
;
//SimCard
int
simState
=
tm.getSimState
(
)
;
string
SimStateStatus
=
""
;
SWITCH
(
simState
)
{
CASE
(
TelephonyManager.SIM_STATE_ABSENT
)
:
SimStateStatus
=
"SimState: ABSENT"
;
BREAK
;
CASE
(
TelephonyManager.SIM_STATE_NETWORK_LOCKED
)
:
SimStateStatus
=
"SimState: NETWORK_LOCKED"
;
BREAK
;
CASE
(
TelephonyManager.SIM_STATE_PIN_REQUIRED
)
:
SimStateStatus
=
"SimState: PIN_REQUIRED"
;
BREAK
;
CASE
(
TelephonyManager.SIM_STATE_PUK_REQUIRED
)
:
SimStateStatus
=
"SimState: PUK_REQUIRED"
;
BREAK
;
CASE
(
TelephonyManager.SIM_STATE_UNKNOWN
)
:
SimStateStatus
=
"SimState: UNKNOWN"
;
BREAK
;
CASE
(
TelephonyManager.SIM_STATE_READY
)
:
SimStateStatus
=
"SimState: READY"
;
BREAK
;
}
//Numero da Linha 1
string
NumCelular1
=
tm.getLine1Number
(
)
;
//Numero da Linha 2
//String NumCelular2 = tm.getLine2Number();
//Retorna o ID único dispositivo, por exemplo, o IMEI para o GSM eo MEID ou ESN para celulares CDMA.
string
IMEI
=
tm.getDeviceId
(
)
;
//Get SIM Serial Number - Retorna o número de série do SIM, se for o caso.
string
SIMSerial
=
tm.getSimSerialNumber
(
)
;
//Retorna a identificação de assinante original, por exemplo, o IMSI para um telefone GSM.
string
SubscriberId
=
tm.getSubscriberId
(
)
;
//Get SIM Country ISO Code - Retorna o código do país ISO equivalente para o código de país do fornecedor SIM.
string
SIMCountryISO
=
tm.getSimCountryIso
(
)
;
//Retorna o número da versão do software para o dispositivo, por exemplo, o IMEI / SV para telefones GSM.
string
SoftwareVersion
=
tm.getDeviceSoftwareVersion
(
)
;
//Get Network Country ISO Code - Retorna o código de país ISO equivalente do MCC do atual operador registado (Country Code Mobile).
string
NetworkCountryISO
=
tm.getNetworkCountryIso
(
)
;
//Retorna o nome numérico (MCC + MNC) do atual operador registado.
string
networkOperator
=
tm.getNetworkOperator
(
)
;
//Retorna o nome alfabética do atual operador registado
string
NetworkOperatorName
=
tm.getNetworkOperatorName
(
)
;
//Retorna o MCC + MNC (código do país + código de rede móvel celular) do provedor do SIM.
string
Operator
=
tm.getSimOperator
(
)
;
//Retorna o nome do provedor de serviço (SPN).
string
OperatorName
=
tm.getSimOperatorName
(
)
;
//Recupera o identificador alfabético associado com o número de correio de voz.
string
VoiceMailAlphaTag
=
tm.getVoiceMailAlphaTag
(
)
;
//Retorna o número de correio de voz.
string
VoiceMailNumber
=
tm.getVoiceMailNumber
(
)
;
//Resultado
string
RetornoNumCelular
=
NumCelular1
+
"; "
+
IMEI
+
"; "
+
SIMSerial
+
"; "
+
SubscriberId
+
"; "
+
SIMCountryISO
+
"; "
+
SoftwareVersion
+
"; "
+
NetworkCountryISO
+
"; "
+
networkOperator
+
"; "
+
NetworkOperatorName
+
"; "
+
Operator
+
"; "
+
OperatorName
+
"; "
+
VoiceMailAlphaTag
+
"; "
+
VoiceMailNumber
+
"; "
+
SimStateStatus
;
RETURN
(
RetornoNumCelular
)
;
}
Report
0
0
COULOLIB PHILIP
#4
Posted on July, 24 2020 - 10:32 PM
Bonsoir,
merci de m'aider.
Lorsque j'ajoute cette function java à win mobile 23, J'ai cette erreur à la compilation:
Echec de la création de l'application Android <C:\Mes Projets Mobile\TestApiSMS\Exe\TestApiSMS.apk>.
Ligne de commande : "C:\Program Files\Java\jdk1.8.0_172\bin\java.exe" "-Dorg.gradle.appname=C:\Mes Projets Mobile\TestApiSMS\Android\Gen" -classpath "C:\WINDEV Mobile 23\Personnel\Android\Gradle\lib\gradle-launcher-2.14.1.jar" org.gradle.launcher.GradleMain assembleDebug -b "C:\Mes Projets Mobile\TestApiSMS\Android\Gen\build.gradle"
Erreur retournée :
:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
C:\Mes Projets Mobile\TestApiSMS\Android\Gen\src\com\masociete\testapisms\wdgen\GWDCPCOL_TESTAPISMS.java:109: error: <identifier> expected
PUBLIC void CelularGetDeviceId()
^
C:\Mes Projets Mobile\TestApiSMS\Android\Gen\src\com\masociete\testapisms\wdgen\GWDCPCOL_TESTAPISMS.java:109: error: invalid method declaration; return type required
PUBLIC void CelularGetDeviceId()
^
2 errors
:compileDebugJavaWithJavac FAILED
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