PROFESSIONAL NEWSGROUPS
WINDEV
,
WEBDEV
and
WINDEV Mobile
Home
|
Recent messages
|
Connect
|
Sign out
|
English
Home
→
WINDEV Mobile 2024
→
Resolution of the screen
Resolution of the screen
Started by adrianoboller, Nov., 18 2014 2:11 PM - 2 replies
Connect yourself…
adrianoboller
#1
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
gn
CentroY
=
1530
gn
CentroYinitial
=
1050
ELSE IF
H
=
800
AND
W
=
480
THEN
// mini
gn
CentroY
=
605
gn
CentroYinitial
=
525
ELSE IF
H
=
800
AND
W
=
1280
THEN
// tablet 1171 419
gn
CentroY
=
1070
gn
CentroYinitial
=
319
END
RESULT
(
Retorno
)
Report
1
0
adrianoboller
#2
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
;
}
}
Report
1
0
adrianoboller
#3
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
Report
1
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