[Q] How to detrmine physical screen resolution? - Desire Q&A, Help & Troubleshooting

Hi, I am trying to determine the physical screen resolution of my Desire, but it always returns 320x533 ???
Should not it be 480x800?
It's a simple code i use:
Code:
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
WindowManager w = getWindowManager();
Display d = w.getDefaultDisplay();
int width = d.getWidth();
int height = d.getHeight();
DisplayMetrics metrics = getApplicationContext().getResources().getDisplayMetrics();//new DisplayMetrics();
int mh = metrics.heightPixels;
int mw = metrics.widthPixels;
TextView mainText = (TextView) this.findViewById(R.id.textview);
mainText.setText("Width:" + width + "\nHeight:" + height + "\nMetrics.Height:"
+ mh + "\nMetrics.Width:" + mw + "\n");
}
I just run the HellowWorld example in eclipse, with the Desire attached.
It always returns 320x533

Never mind. I had to set in the manifest :
<supports-screens android:anyDensity="true"/>
Then it returns expected resolution.

Related

[API] HTC HD2 LEO Proximity Api

Use at your OWN risk!!!
Attached C++ class for using proximity sensor.
And small example of using, which printing to debug output changing of proximity status.
Problems:
1. By default when proximity sensor enabled - screen will be switched off when proximity detected. Use method SetAutoScreenOff to disable auto switching off the screen. But when screen switched off and proximity changed from detected => no proximity, screen will be switched on. So you need to disable proximity sensor as soon as you do not want switching screen on when no proximity.
2. Phone Canvas (dialer skin) using same way of enabling proximity sensor, so, if you do not want to interference with dialer use class constructor parameter handleActiveCalls=true
3. maybe something... but don't remember
Using
Create instance of class. Call Enable().
Set proximity detection status changed signaling method:
- with event signaling: SetProximityChangedEvent
- with window message: SetMonitorWindow
To switch off proximity sensor call Disable().
If you found bug or have advice - post here or pm me please.
If somebody creates port to managed code - it's will be nice as i think
exidler said:
Use at your OWN risk!!!
Attached C++ class for using proximity sensor.
And small example of using, which printing to debug output changing of proximity status.
Click to expand...
Click to collapse
Is the code for the LED control also working on other types of phones?
Or is this HTC specific?
Code:
HANDLE hLedDevice = CreateFile(L"LED1:",
GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
if (!hLedDevice || hLedDevice == INVALID_HANDLE_VALUE)
return false;
LEDMGR_CONTROLL ctl;
ctl.p1 = 0; // bit number
ctl.p2 = (autoScreenOffWhenProximityDetected ? 1 : 2); // 2 for set bit else - clear bit
DWORD dwRet;
BOOL bResult = DeviceIoControl(hLedDevice, IOCTL_LEDMGR_SCREENOFF_DISABLEDLED_IOCTL, &ctl, sizeof(ctl),
NULL, 0, &dwRet, NULL);
CloseHandle(hLedDevice);
Have tested on HTC HD2. I think it's HTC specific.

build.prop tweaks

hello folks...
can anybody suggest or provide some build.prop tweaks for longer battery life..
kantry123 said:
hello folks...
can anybody suggest or provide some build.prop tweaks for longer battery life..
Click to expand...
Click to collapse
Here are the main ones.
Code:
# Time between Access Points scans
# Increase seconds to minimize battery drain
wifi.supplicant_scan_interval = 180
# LCD Brightness Setting Default is 143
settings.display.brightness = 120
# ARM11 Sleep Mode
# 0 = Power Collapse Suspend
# 1 = Power Collapse
# 2 = Apps Sleep
# 3 = Slow Clock and Wait for Interrupt
# 4 = Wait for Interrupt
pm.sleep_mode = 1
# HSDPA Low Throughput
ro.ril.disable.power.collapse = 0
Tera Tike said:
Here are the main ones.
Code:
# Time between Access Points scans
# Increase seconds to minimize battery drain
wifi.supplicant_scan_interval = 180
# LCD Brightness Setting Default is 143
settings.display.brightness = 120
# ARM11 Sleep Mode
# 0 = Power Collapse Suspend
# 1 = Power Collapse
# 2 = Apps Sleep
# 3 = Slow Clock and Wait for Interrupt
# 4 = Wait for Interrupt
pm.sleep_mode = 1
# HSDPA Low Throughput
ro.ril.disable.power.collapse = 0
Click to expand...
Click to collapse
thanks for ur reply...
but will it work with HTC wildfire s a510e(GSM)...?
kantry123 said:
thanks for ur reply...
but will it work with HTC wildfire s a510e(GSM)...?
Click to expand...
Click to collapse
Yes.
On average how much longer has this increased battery life ?
Sent from my HTC_A510c using XDA App
junxracr said:
On average how much longer has this increased battery life ?
Sent from my HTC_A510c using XDA App
Click to expand...
Click to collapse
On one phone with data, wifi, bluetooth and sync enabled get about two days plus. On the other one with just the phone on I get about 4 plus days. So it will vary...
Thank you I'll give it a try.
Sent from my HTC_A510c using XDA App
I'm bumping this - anybody else got any other interesting tweaks?
Sent from my Wildfire S A510e using xda premium
To help with touch responsiveness...
CHANGE:
Code:
view.touch_slop = 2
ADD:
Code:
# Force Launcher into Memory
ro.HOME_APP_ADJ = 1
# Enable Graphic Processor Unit
debug.sf.hw = 1
# Improve Overall Touch Responsiveness
debug.performance.tuning = 1
video.accelerate.hw = 1
# Improve Scrolling Responsiveness
windowsmgr.max_events_per_sec = 150
Tera Tike said:
To help with touch responsiveness...
CHANGE:
Code:
view.touch_slop = 2
ADD:
Code:
# Force Launcher into Memory
ro.HOME_APP_ADJ = 1
# Enable Graphic Processor Unit
debug.sf.hw = 1
# Improve Overall Touch Responsiveness
debug.performance.tuning = 1
video.accelerate.hw = 1
# Improve Scrolling Responsiveness
windowsmgr.max_events_per_sec = 150
Click to expand...
Click to collapse
thanks but would u suggest any thing with max and min fling velocity..?
kantry123 said:
thanks but would u suggest any thing with max and min fling velocity..?
Click to expand...
Click to collapse
For me not really, the Minimum fling velocity is measured by the number of pixels your finger traveled per second.
You can lower the view.minimum_fling_velocity = 15 to speed up scrolling.
I would not even set the maximum velocity as the screen is to small for it to be effective.
Tera Tike said:
For me not really, the Minimum fling velocity is measured by the number of pixels your finger traveled per second.
You can lower the view.minimum_fling_velocity = 15 to speed up scrolling.
I would not even set the maximum velocity as the screen is to small for it to be effective.
Click to expand...
Click to collapse
thank u so much for ur valuable answer...!
but can u clarify my doubt..??
below i'm posting some tweaks will that work on wfs.?
ro.mot.eri.losalert.delay=1000
ro.max.fling_velocity=12000
ro.min.fling_velocity=8000
ro.telephony.call_ring.delay=0
ro.lge.proximity.delay=25
mot.proximity.delay=25
dalvik.vm.dexopt-flags=m=v,o=y
persist.sys.purgeable_assets=1
ro.config.hw_fast_dormancy=1
persist.sys.shutdown.mode = hibernate
ro.config.hw_power_saving=true
debug.kill_allocating_task=0
debug.qctwa.statusbar=1 (qualcomm device specific)
debug.qctwa.preservebuf=1 (qualcomm device specific)
debug.qc.hardware=true (qualcomm device specific)
com.qc.hardware=true (qualcomm device specific)
plz.z..z won't mind if i have botherd u but.. seriously i'm in need of those tweaks..??
kantry123 said:
thank u so much for ur valuable answer...!
but can u clarify my doubt..??
below i'm posting some tweaks will that work on wfs.?
ro.mot.eri.losalert.delay=1000
ro.max.fling_velocity=12000
ro.min.fling_velocity=8000
ro.telephony.call_ring.delay=0
ro.lge.proximity.delay=25
mot.proximity.delay=25
dalvik.vm.dexopt-flags=m=v,o=y
persist.sys.purgeable_assets=1
ro.config.hw_fast_dormancy=1
persist.sys.shutdown.mode = hibernate
ro.config.hw_power_saving=true
debug.kill_allocating_task=0
debug.qctwa.statusbar=1 (qualcomm device specific)
debug.qctwa.preservebuf=1 (qualcomm device specific)
debug.qc.hardware=true (qualcomm device specific)
com.qc.hardware=true (qualcomm device specific)
plz.z..z won't mind if i have botherd u but.. seriously i'm in need of those tweaks..??
Click to expand...
Click to collapse
Here is the list of what I am using...
Code:
# View configuration for QVGA
ro.min.fling_velocity=10
# Decrease Dialing Delay
ro.telephony.call_ring.delay = 0
# Fix Blackscreen Issue after Call
ro.lge.proximity.delay = 5
mot.proximity.delay = 5
# Dalvik Cache Settings
dalvik.vm.dexopt-flags = v=n,o=a,u=y
# Application Not Responding Timeout
keydispatchtimeout = 15000
# Qualcomm UI Tweaks
debug.qctwa.preservebuf = 1
debug.qc.hardware = true
# Improves Radio Signal
ro.config.hw_fast_dormancy = 1
I would not use these as they was not needed, degraded or bootlooped my device.
Code:
# Maximum Velocity to Initiate a Fling (measured pixels per second)
ro.max.fling_velocity = 12000
# Cellular Tower Reconnect Delay (Made Hotspot Mode Unstable)
ro.mot.eri.losalert.delay = 1000
# Purge Memory Cache Memory on reboot (UI already does that)
persist.sys.purgeable_assets = 1
# Dalvik Cache Settings (degraded performance)
dalvik.vm.dexopt-flags=m=v,o=y
# Disable Graphic Dithering (default setting)
persist.sys.use_dithering = 0
# Power Off Mode Hibernate
persist.sys.shutdown.mode = hibernate
# Enable Hardware Power Savings (not supported)
ro.config.hw_power_saving = true
# Enhanced Operator Name String
persist.cust.tel.eons = 1
# Disable Task Killing
debug.kill_allocating_task = 0
# Qualcomm UI Tweaks (Made no differance)
debug.qctwa.statusbar = 1
com.qc.hardware = true

[ROM][JB] CM10 Mr. Jun 08/01 GB Kernal(Quarx 07/30 base)

Hello all defy users. I found this rom on the mfunz site, after many google translate usages :laugh:
This is a cherry pick of Quarx's excellent work on JB for our beloved Defy/Defy+ phones.
Mr. Jun did excellent work on CM 9 picks previously. All credit goes to him for his added work to Quarx's build.
Link to site for reference
http://bbs.mfunz.com/forum.php?mod=viewthread&tid=564498
This will only work on Defy(bayer lens)/Defy+ if you want the camera to work correctly.
These are the changes I got from Google Translate.
Q large Defy + on the 30th version of the CM10 Amendment, use CM2.3.3/CH2.3.4 kernel
- For all BL levels of DEFY + to DEFY use, but before the Brush carefully to see posts.
= Completion, including the camera, alarm clock and other details of the finished, the system finished 100%
= Correction button brightness setting options in FC
= Modified kernel boot file
= Correction into the drawer menu will appear when the sawtooth
= Fixed long Caton appears BUG
= Exclude option on the phone FC
= Integrated RE Manager V2.2
= Integration 4.1.1 Advanced Settings
= Integrated the MOTO native input method
= Integrated MotoInspired_v1.5 topic
= The integration ApexLauncher1.2.5 Desktop
= Integrated the power vested with the operators
= Integration of third-generation Sony Bravia Engine Engine
= Streamlining of redundant language pack, fan the English West
= CM wallpaper streamline useless APK
= Adjust the SD cache 2048
= Adjustment of the global touch responsiveness
= Adjusted scroll up and down the FPS values
= Adjust the system's smooth scrolling
= Adjustment of the open / close the window speed of the fastest
= Adjusted deeper sleep system, substantial savings to the standby power consumption
= Open zipalign alignment
= On the pmwcachecleaner function
= Open desktop acceleration module supports
= Optimization WIFI scanning speed, power-based
= Optimal WIFI, the GPS up and down the line speed
= To optimize the startup time
= Optimize the standby release more memory
= Optimized TCP / IP data buffer
= Optimize boot to restart the speed
= V6 supercharger scripting support
= Embedded in the latest 4.0 memory management mechanism
= Modify the minfree value, memory allocation is more reasonable
= Start mandatory increase in memory
= Black against dial-up and delay
= Disable CyanogenMod Statistics
= Disable 2D, 3D threshold ceiling
= Disable kernel debugger error diary
= Modified boot the default time zone
= Modified ApexLauncher of desktop decline gesture, menu options
= Modified Brush script automatically cleared
= Harmony of a large number of icons, lock screen, search button
= Added SMS pop-up settings to CM
= Support pop-up a custom contact SMS
= Added call recording to CM settings
= Support two-way call recording function
= Join the power-saving fine-tuning, battery optimization script
= Default CPU FM mode (not recommended for replacement)
= DroidXGoveors SIO kernel scheduling
I have tested it for all day, and it is smoother and faster than Quarx's 30th build.
Once again thanks to Quarx, Epslyon3, and Maniac103 for all their continued support of CM for Defy.
LInks for downloads
https://www.dropbox.com/sh/m0chnwrogq9lha4/J0TKFJhn4s
https://docs.google.com/open?id=0B6jmUw-d1AcTTG9ZVkdDVkF0amc
Very, very fast!
Lightning fast ROM, seems stable but has one annoying thing: Some apps are in Chinese, including the Root Explorer and CallRecorder which comes with it.(Even when I chose English in System Settings)
I "ported" the build.prop tweaks to new Quarx CM10 08/02 and found out it's pretty fast too without the thing that I mentioned before - annoying, for me.
Worth to mention that Mr. Jun one is slightly faster.
WalaceW7 said:
Lightning fast ROM, seems stable but has one annoying thing: Some apps are in Chinese, including the Root Explorer and CallRecorder which comes with it.(Even when I chose English in System Settings)
I "ported" the build.prop tweaks to new Quarx CM10 08/02 and found out it's pretty fast too without the thing that I mentioned before - annoying, for me.
Worth to mention that Mr. Jun one is slightly faster.
Click to expand...
Click to collapse
Q large=Quarx:laugh:

[Q] Any way to adjust keyboard light brightness?

I'm trying to find out if there's a way to adjust the brightness of the keyboard light and capacitive buttons light. I know it can be done with the galaxy 2 by using extweaks with the siyah kernel. Is there any way to do the same thing with the captivate glide?
yes, look at https://github.com/spyke555/android_device_samsung_i927/blob/master/liblights/lights.c
You can simply
echo 5 >file
Where file one of those:
char const*const PANEL_FILE = "/sys/class/backlight/pwm-backlight/brightness";
char const*const BUTTON_FILE = "/sys/class/misc/melfas_touchkey/brightness";
char const*const KEYBOARD_FILE = "/sys/class/sec/sec_stmpe_bl/backlight";
char const*const NOTIFICATION_FILE_BLN = "/sys/class/misc/backlightnotification/notification_led";
And number is adjustment of the light, I'm not sure witch light support different value.

Large border around the screen

I have a A505FN with the rom A505FNXXS4BTCA - XEF. I flashed my device with the TWRP patched and the custom splash screen.
It was a success because I'm rooted now, but not whitout problem.
Since I have an important border on my device.
https://zupimages.net/up/20/20/uvwe.jpg
I have for example + 8mm of border on the bottom of the screen..And I can't remove it.
It's an important problem. I restored the rom stock, but the border remained... Could you help me ?
I taped the commande in adb dumpsys display | grep mBaseDisplayInfo
The answer is:
mBaseDisplayInfo=DisplayInfo{"Écran intégré, displayId 0", uniqueId "local:0", app 1080 x 2340, real 1080 x 2340, largest app 1080 x 2340, smallest app 1080 x 2340, mode 1, defaultMode 1, modes [{id=1, width=1080, height=2340, fps=60.000004}], colorMode 0, supportedColorModes [0], hdrCapabilities [email protected], rotation 0, density 420 (403.411 x 404.326) dpi, layerStack 0, appVsyncOff 0, presDeadline 17666666, type BUILT_IN, address {port=0}, state DOZE_SUSPEND, FLAG_SECURE, FLAG_SUPPORTS_PROTECTED_BUFFERS, removeMode 0}
Thank you
It seems to be normal for me, may it be you had a dark background image before? 8mm including the navigation bar? You can put your phone under some ligth and see the reel edges of the screen, if you see an extra black border then you have a problem .there is ~3mm buttom border in the A50 .
Looks normal to me

Categories

Resources