PROFESSIONAL NEWSGROUPS
WINDEV
,
WEBDEV
and
WINDEV Mobile
Home
|
Recent messages
|
Connect
|
Sign out
|
English
Home
→
WINDEV Mobile 2024
→
Suggestion code Java: Extract Marca Model Celular/Tablet
Suggestion code Java: Extract Marca Model Celular/Tablet
Started by adrianoboller, Oct., 03 2014 4:03 PM - 3 replies
Connect yourself…
adrianoboller
#1
Registered member
3,659 messages
Popularité : +175 (223 votes)
Posted on October, 03 2014 - 4:03 PM
Suggestion code: Model Celular
CODE EXAMPLE
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.os.*;
import android.os.Bundle;
import android.telephony.TelephonyManager;
import android.util.Log;
import android.widget.Toast;
import android.provider.Settings.Secure;
public static String getDeviceName() {
String manufacturer = android.os.Build.MANUFACTURER;
String model = android.os.Build.MODEL;
String brand = android.os.Build.BRAND;
String product = android.os.Build.PRODUCT;
String board = android.os.Build.BOARD;
String bootloader = android.os.Build.BOOTLOADER;
String cpu_abi = android.os.Build.CPU_ABI;
String cpu_abi2 = android.os.Build.CPU_ABI2;
String device = android.os.Build.DEVICE;
String display = android.os.Build.DISPLAY;
String fingerprint = android.os.Build.FINGERPRINT;
String hardware = android.os.Build.HARDWARE;
String host = android.os.Build.HOST;
String id = android.os.Build.ID;
String radio = android.os.Build.RADIO;
String serial = android.os.Build.SERIAL;
String tags = android.os.Build.TAGS;
String type = android.os.Build.TYPE;
String user = android.os.Build.USER;
if (model.startsWith(manufacturer)) {
return (model);
} else {
String MarcaModeloCelular = "manufacturer: " + (manufacturer) + "; model: " + (model) + "; brand: " + (brand) + "; product: " + (product) + "; board:" + (board) + "; bootloader: " + (bootloader) + "; cpu_abi: " + (cpu_abi) + "; cpu_abi2: " + (cpu_abi2) + "; device: " + (device) + "; display: " + (display) + "; fingerprint: " + (fingerprint) + "; hardware: " + (hardware) + "; host: " + (host) + "; id: " + (id) + "; radio: " + (radio) + "; serial: " + (serial) + "; tags: " + (tags) + "; type: " + (type) + "; user: " + (user);
MarcaModeloCelular = MarcaModeloCelular.toUpperCase();
return MarcaModeloCelular;
}
}
Report
0
0
adrianoboller
#2
Registered member
3,659 messages
Popularité : +175 (223 votes)
Posted on October, 03 2014 - 4:04 PM
Button in Form Windev Mobile:
Info(getDeviceName())
Report
0
0
adrianoboller
#3
Registered member
3,659 messages
Popularité : +175 (223 votes)
Posted on October, 03 2014 - 4:08 PM
PROCEDURE ResolucaoTela()
// Horizontal resolution of the screen
ResHorizRes is int = SysXRes()
gloResHorizRes = ResHorizRes
// Vertical resolution of the screen
ResVertRes is int = SysYRes()
gloResVertRes = ResVertRes
Retorno is string = ResHorizRes +"X"+ ResVertRes
W = gloResHorizRes
H = gloResVertRes
IF H = 1920 AND W = 1080 THEN //s4
gnCentroY = 1530
gnCentroYinitial = 1050
ELSE IF H = 800 AND W = 480 THEN // mini
gnCentroY = 605
gnCentroYinitial = 525
ELSE IF H = 800 AND W = 1280 THEN // tablet 1171 419
gnCentroY = 1070
gnCentroYinitial = 319
END
RESULT(Retorno)
Report
0
0
adrianoboller
#4
Registered member
3,659 messages
Popularité : +175 (223 votes)
Posted on October, 03 2014 - 4:08 PM
/////////////////////////////////////////////////////////
ResolucaoTela()
//Verifica modelo de celular = MOTO G = XT1033
MODELO is string = getDeviceName() //Funcao Java
//Info(MODELO) //
IF PositionOccurrence(MODELO,"MANUFACTURER: MOTOROLA; MODEL: XT1033",firstRank,FromBeginning) > 0 THEN // MOTO G
//info("Esse aparelho é um Moto G")
//Tela
WIN_Menu..Height = H - 150 // Janbela
nInicio is int = 73
nFinal is int = 365
Media is int = (nInicio + nFinal) / 6
//Botoes
IMG_Cadastro..Y = nInicio
IMG_Agendamento..Y = nInicio + (Media * 1)
IMG_Favoritos..Y = nInicio + (Media * 2)
IMG_Historico..Y = nInicio + (Media * 3)
IMG_Pesquisa..Y = nInicio + (Media * 4)
IMG_Site..Y = nInicio + (Media * 5)
IMG_Email..Y = nFinal
//Textos
BTN_Cadastro..Y = nInicio
BTN_Agendamento..Y = nInicio + (Media * 1)
BTN_Favoritos..Y = nInicio + (Media * 2)
BTN_Historico..Y = nInicio + (Media * 3)
BTN_Pesquisa..Y = nInicio + (Media * 4)
BTN_Site..Y = nInicio + (Media * 5)
BTN_Email..Y = nFinal
END
/////////////////////////////////////////////////////////
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