FORUMS PROFESSIONNELS
WINDEV
,
WEBDEV
et
WINDEV Mobile
Accueil
|
Messages récents
|
Connexion
|
Déconnexion
|
Français
Accueil
→
WINDEV Mobile 2024
→
Suggestion code Java: Extract Model Celular/Tablet
Suggestion code Java: Extract Model Celular/Tablet
Débuté par adrianoboller, 03 oct. 2014 16:05 - 1 réponse
Connectez-vous…
adrianoboller
#1
Membre enregistré
3 657 messages
Popularité : +175 (223 votes)
Posté le 03 octobre 2014 - 16:05
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;
}
}
Signaler
0
0
adrianoboller
#2
Membre enregistré
3 657 messages
Popularité : +175 (223 votes)
Posté le 03 octobre 2014 - 16:07
/////////////////////////////////////////////////////////
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
/////////////////////////////////////////////////////////
Signaler
0
0
→ Revenir à WINDEV Mobile 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (précédentes versions)
WEBDEV (précédentes versions)
WINDEV Mobile (précédentes versions)
Etats & Requêtes
Hors-sujet
Outils
Français
English
Español
Portuguesa
Fermer cette fenêtre
Type de recherche
Uniquement les sujets
Tous les messages
Période de recherche
Date indifférente
Moins d'une heure
Moins de 24 heures
Moins d'une semaine
Moins d'un mois
Moins d'un an
Annuler
Aperçu de votre message
Ajouter une image
Importer une image depuis une URL
Envoyer une image depuis un fichier de votre disque
Déposez ici un fichier ou cliquez sur "Parcourir..."
ou
Annuler
0%
WLangage
SQL
XML, HTML
JAVA, Javascript
Texte