PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WINDEV Mobile 2024 → Resolution of the screen
Resolution of the screen
Started by adrianoboller, Nov., 18 2014 2:11 PM - 2 replies
Registered member
3,662 messages
Popularité : +175 (223 votes)
Posted on November, 18 2014 - 2:11 PM
Procedure Resolucao()

// 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)
Registered member
3,662 messages
Popularité : +175 (223 votes)
Posted on November, 18 2014 - 2:11 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.*;
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;
}
}
Registered member
3,662 messages
Popularité : +175 (223 votes)
Posted on November, 18 2014 - 2:12 PM
Resolucao()

IF InSimulatorMode() = False

//Verifica modelo de celular = MOTO G = XT1033

MODELO is string = getDeviceName() //Funcao Java

IF PositionOccurrence(MODELO,"MANUFACTURER: MOTOROLA",firstRank,FromBeginning) > 0 THEN // MOTO G

//info("Esse aparelho é um Moto G")

//Tela
WIN_TermoUso..Height = H - 150

END

END