Is there a way to turn off, not the backlight, not the pda, but just the screen?
All I know is, I have Linux on my ipaqs, and you can turn off just the screen (the backlight will be off too of course), to save battery power. I usually do this when I'm listening to mp3 with it.
I imagine the hardware itself is capable to do this, but pocketpc by default does not have such an option. Now I'm wondering if pocketpc has exposed any APIs to do this.
Thanks.
I just know PocketDiVX in the new ROM can map a button to do this. No idea how to do it from code though...
this works on my xda with media player
http://homepage.ntlworld.com/gazzaman2k//a/Software/Display off.zip
Apart from setting the power pref's in system/settings, no such luck ... I've searched the XDA for a program that does this with no luck.
Has anyone found a ROM link ?
I like and use Pocket Toolman
http://members.shaw.ca/pockettoolman/
HTH
here's one that's hopefully the answer to your request. the file is called sleepscreen and it does exactly what you mentioned; turns off the screen while applications are running. i've installed it in my "start" menu so that anytime i want to switch off the screen i can do so.
when you click on the icon on your start menu; the screen goes blank and if you'll notice the LED of the xda is blinking...meaning apps are running while the screen is off. all you have to do to activate the screen is press any button (e.g. the contacts or calendar button)...but DON'T hit the power button because that switches off all the apps running.
how do i attach the file in this forum? it's only 24kb zipped. or give me your email address and i'll mail it to you.
hope that helps mate!
Code:
// offDisplay.cpp : Defines the entry point for the application.
//
#include "stdafx.h"
#include <stdlib.h>
#include <nled.h>
// LED support
extern "C" BOOL NLedGetDeviceInfo(INT nID, PVOID pOutput);
extern "C" BOOL NLedSetDevice(INT nID, PVOID pOutput);
// GDI Escapes for ExtEscape()
#define QUERYESCSUPPORT 8
// The following are unique to CE
#define GETVFRAMEPHYSICAL 6144
#define GETVFRAMELEN 6145
#define DBGDRIVERSTAT 6146
#define SETPOWERMANAGEMENT 6147
#define GETPOWERMANAGEMENT 6148
typedef enum _VIDEO_POWER_STATE {
VideoPowerOn = 1,
VideoPowerStandBy,
VideoPowerSuspend,
VideoPowerOff
} VIDEO_POWER_STATE, *PVIDEO_POWER_STATE;
typedef struct _VIDEO_POWER_MANAGEMENT {
ULONG Length;
ULONG DPMSVersion;
ULONG PowerState;
} VIDEO_POWER_MANAGEMENT, *PVIDEO_POWER_MANAGEMENT;
// LED handling functions
int GetLedCount()
{
NLED_COUNT_INFO nci;
int wCount = 0;
if(NLedGetDeviceInfo(NLED_COUNT_INFO_ID, (PVOID) &nci))
wCount = (int) nci.cLeds;
return wCount;
}
void SetLedStatus(int wLed, int wStatus)
{
NLED_SETTINGS_INFO nsi;
nsi.LedNum = (INT) wLed;
nsi.OffOnBlink = (INT) wStatus;
NLedSetDevice(NLED_SETTINGS_INFO_ID, &nsi);
}
int WINAPI WinMain ( HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPWSTR pszCommandLine, int nCommandShow)
{
HDC gdc;
int iESC=SETPOWERMANAGEMENT;
gdc = ::GetDC(NULL);
if (ExtEscape(gdc, QUERYESCSUPPORT, sizeof(int), (LPCSTR)&iESC, 0, NULL)==0)
MessageBox(NULL, L"Sorry, your Pocket PC does not support toggleDisplay",
L"Pocket PC toggleDisplay",
MB_OK);
else
{
VIDEO_POWER_MANAGEMENT vpm;
ExtEscape(gdc, GETPOWERMANAGEMENT, 0, 0, sizeof(vpm), (char *) &vpm);
if (vpm.PowerState == VideoPowerOff) {
vpm.Length = sizeof(VIDEO_POWER_MANAGEMENT);
vpm.DPMSVersion = 0x0001;
vpm.PowerState = VideoPowerOn;
ExtEscape(gdc, SETPOWERMANAGEMENT, vpm.Length, (LPCSTR) &vpm, 0, NULL);
if (GetLedCount()) {
SetLedStatus(0, 0);
}
} else {
vpm.Length = sizeof(VIDEO_POWER_MANAGEMENT);
vpm.DPMSVersion = 0x0001;
vpm.PowerState = VideoPowerOff;
ExtEscape(gdc, SETPOWERMANAGEMENT, vpm.Length, (LPCSTR) &vpm, 0, NULL);
if (GetLedCount()) {
SetLedStatus(0, 1);
}
}
::ReleaseDC(NULL, gdc);
}
return 0;
}
uff, binaries for arm, probably compiled with debug on
but who cares with such a BIG file
http://pgate.host.sk/toggleDisplay.exe [4kB]
pigeon said:
Is there a way to turn off, not the backlight, not the pda, but just the screen?
I came across some silly software named PocketLight or PocketTorch or so, just can't find it right now. It turns off the screen but the backlight stays on. This way you can use your PDA as a light source in case you lost something in the dark ....
Is that what you're looking for?
Martin
Click to expand...
Click to collapse
Click to expand...
Click to collapse
i have a free program for this but i dont know how to upload it
http://www.mywirelessoffice.com/xda/screenoff.zip
Thanks emilk
Adrian
emilk said:
uff, binaries for arm, probably compiled with debug on
but who cares with such a BIG file
http://pgate.host.sk/toggleDisplay.exe [4kB]
Click to expand...
Click to collapse
Cant link to that exe file, I get a "not authorised", error message.
I know, my webhosting is not perfect
SOLUTION: when I use rightclick and choose 'save target as..'
it goes through
if you are unsuccesful with linking, that was probably intention
of my provider
Just press and hold the power button, this allows Windows Media Player to still play my mp3's but turns off my screen to reserve power.
Simply as that.
Mike
MIke Gascoigne said:
Just press and hold the power button, this allows Windows Media Player to still play my mp3's but turns off my screen to reserve power.
Simply as that.
Mike
Click to expand...
Click to collapse
If I press and hold the power button, it turns off only the backlight, not the screen.
Sorry, just press the power button, this turns the screen off, DONT HOLD IT as I told you to do before.
Just press it!
Mike
That suspends the device. It doesn't just turn off the screen.
If I have Media Player turned on and I just tap the power it turns off the whole device (MP3 player too)
Related
I was getting utterly annoyed by the fact that the TF3D music player had no sleep funtion (turn of the music after a set amount of time). After doing some searches I was unable to find anything that suits my needs (anything at all in fact).
Now I have been using an application that pauses my music when I press the headset button for 1 second. What that app in fact does is: run an executable that somehow pauses the TF3D music player.
So in combination with 3 lines of mortscript I had my sleep application. Just run it (you will need to have mortscript installed, http://www.sto-helit.de/index.php?module=page&entry=ms_overview&action=view) and enter the amount if time (in minutes) after which you wan't the music player to stop playing. I usually set this to 1 hour, put on my headphones and fall somewhere within that hour to sleep. The players turns off and I won't wake up at 3 'o clock in the morning when I would rather be sleeping because of some loud track that starts playing.
The sddialer.exe file (which pauses the player) was developed by DYNAMIC+ (http://forum.xda-developers.com/showthread.php?t=502881). If the original developer has any problems with me redistributing a piece of his work, contact me.
The mortscript file (for the interested ones)
Code:
t = Input("Minutes until sleep","TF3D Music Sleep",1);
Sleep(60000*t);
Run("SDDialer.exe");
That's all there is to it, the pausing is handled by the SDDialer.exe file. which I did NOT write myself. So in case you find any error related to SDDialer.exe, you should contact DYNAMIC+ (the original dev). Because the SDDialer.exe file was originally written to be used in conjuction with a headset, it only works when a headset is plugged in! (don't know how bluetooth headsets are handled though)
Cabbed using the wonderfully simple QuickCab!
After installation you will have a new shortcut in your startmenu, just tap it, enter the amount of minutes and lay back. This works when your device is in sleep-mode, as well as in normal active mode. One remark: the SDDialer.exe file in fact toggles the music playback, so when you don't play music, and you set the timer to for example 10 minutes, the music will start playing after 10 minutes. Could be useful for a countdowncounter with music or something
Test results are ALWAYS appreciated
ill post you the requested source....
Code:
#define AUDIO_MANAGER_COMMAND_PAUSE 0x3
HWND GetAudioManagerWindow( )
{
return FindWindow( TEXT("AUDIO_MANAGER_ENG"), NULL );
}
BOOL IsAudioManagerPlaying( )
{
BOOL bIsAudioManagerPlaying = FALSE;
HKEY hkAudioManagerInformation;
if ( ERROR_SUCCESS == RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("Software\\HTC\\AudioManager_Eng\\information"), 0, 0, &hkAudioManagerInformation) )
{
DWORD dwType, dwStatus, dwCbStatus = sizeof(dwStatus);
if ( ERROR_SUCCESS == RegQueryValueEx(hkAudioManagerInformation, TEXT("status"), 0, &dwType, (LPBYTE)&dwStatus, &dwCbStatus) && dwType == REG_DWORD )
{
if ( dwStatus == 4 )
bIsAudioManagerPlaying = TRUE;
}
RegCloseKey( hkAudioManagerInformation );
}
return bIsAudioManagerPlaying;
}
LRESULT SendAudioManagerMessage( HWND hAudioManagerWnd, DWORD dwCommand )
{
return SendMessage( hAudioManagerWnd, WM_USER + 1, dwCommand, 0 );
}
Code:
if ( IsAudioManagerPlaying() )
{
HWND hAudioManagerWnd = GetAudioManagerWindow( );
if ( hAudioManagerWnd )
SendAudioManagerMessage( hAudioManagerWnd, AUDIO_MANAGER_COMMAND_PAUSE );
}
Is it possible to make this work with the speaker function? I quite like the speaker quality on my TP2.
Another feature I would love to see is the gradual decrease in volume. I have a sleep machine that slowly lowers the volume, so when the sound stops it isnt abrupt and possibly causing the person to wake.
Id be a willing beta tester...
sleep machine functionality for TF3D
Nice one, thank you!
I'd second the above suggestion for a gradual lowering of volume, it would be great to have some sort of sleep machine functionality.
Please not that I won't be adding any features/fix bugs on this 'application'. In fact: I don't even use TF3D anymore (Titanium + Nitrogen music player). But if it works for you, I always like to hear that.
Hi all~!
I'm user of my Lumia 620 and I'm looking for free alarm app . The alarm must repeat every 30 seconds . Is there any app ? I need it , because I'm starting ABS for my chest
kukusiek97 said:
Hi all~!
I'm user of my Lumia 620 and I'm looking for free alarm app . The alarm must repeat every 30 seconds . Is there any app ? I need it , because I'm starting ABS for my chest
Click to expand...
Click to collapse
Hello,
What kind of sound would you like? Pick your own music? etc..
Sounds more like a repeative timer to me...this wouldn't even be that hard to make...
C#:
In App.xaml.cs input:
Code:
using System.Threading;
private static DispatcherTimer m_Timer;
private static bool RepeatTimer;
private static int m_Days, m_Hours, m_Minutes, m_Seconds;
public static void beginTiming(int Days, int Hours, int Minutes, int Seconds, bool Repeative)
{
RepeatTimer = Repeative; //Set repeat
m_Days = Days;
m_Hours = Hours;
m_Minutes = Minutes;
m_Seconds = Seconds;
m_Timer = new DispatcherTimer();
m_Timer.Tick += new EventHandler(m_Timer_Tick);
m_Timer.Interval = new TimeSpan(Days, Hours, Minutes, Seconds);
m_Timer.Start();
}
static void m_Timer_Tick(object sender, EventArgs e)
{
if (RepeatTimer == true)
beginTiming(m_Days, m_Hours, m_Minutes, m_Seconds);
//Play Sound Here (Max Limit 10 Seconds)
}
Then have a sound selector and button to begin timing the fields on the MainPage.xaml, if the user's phone turns off (due to WP8 lacking capability of real multitasking -- Thank you Microsoft!) use the background to set a timer to run every thirty seconds or disable screen powering off in the application.
That's basically how it can be created.
So, if anyone decides to do this really quick (5 minutes?) it's quite simple.
I'll give it a go if no one else completes this for you.
kuzcoed said:
Hello,
What kind of sound would you like? Pick your own music? etc..
Sounds more like a repeative timer to me...this wouldn't even be that hard to make...
C#:
In App.xaml.cs input:
Code:
using System.Threading;
private static DispatcherTimer m_Timer;
private static bool RepeatTimer;
private static int m_Days, m_Hours, m_Minutes, m_Seconds;
public static void beginTiming(int Days, int Hours, int Minutes, int Seconds, bool Repeative)
{
RepeatTimer = Repeative; //Set repeat
m_Days = Days;
m_Hours = Hours;
m_Minutes = Minutes;
m_Seconds = Seconds;
m_Timer = new DispatcherTimer();
m_Timer.Tick += new EventHandler(m_Timer_Tick);
m_Timer.Interval = new TimeSpan(Days, Hours, Minutes, Seconds);
m_Timer.Start();
}
static void m_Timer_Tick(object sender, EventArgs e)
{
if (RepeatTimer == true)
beginTiming(m_Days, m_Hours, m_Minutes, m_Seconds);
//Play Sound Here (Max Limit 10 Seconds)
}
Then have a sound selector and button to begin timing the fields on the MainPage.xaml, if the user's phone turns off (due to WP8 lacking capability of real multitasking -- Thank you Microsoft!) use the background to set a timer to run every thirty seconds or disable screen powering off in the application.
That's basically how it can be created.
So, if anyone decides to do this really quick (5 minutes?) it's quite simple.
I'll give it a go if no one else completes this for you.
Click to expand...
Click to collapse
For me something like this http://www.youtube.com/watch?v=uJ2SqGfURyY is enough . But could you give me more instructions ? I'm new user of my Lumia .
kukusiek97 said:
For me something like this http://www.youtube.com/watch?v=uJ2SqGfURyY is enough . But could you give me more instructions ? I'm new user of my Lumia .
Click to expand...
Click to collapse
Hi,
To play the sound you'll need some code that allows play music, in App.xaml.cs you can use multiple options, but, for what you're looking for I think this would work fine:
Code:
Stream musStr = TitleContainer.OpenStream("alarm.wav");
SoundEffect musEffect = SoundEffect.FromStream(musStr);
FrameworkDispatcher.Update();
musEffect.Play();
Put that code inside the "m_Timer_Tick" event or put another
Code:
private / public static void
in your code, then call it.
For example:
Code:
private static void playSound(string Sound)
{
Stream musStr = TitleContainer.OpenStream(Sound);
SoundEffect musEffect = SoundEffect.FromStream(musStr);
FrameworkDispatcher.Update();
musEffect.Play();
}
Call that with the m_Timer_Tick event using:
Code:
playSound(mysound.wav);
Requirements of doing this way is that:
1) Sample Rate must be between 8k Hz and 48k Hz
2) The audio file must be a PCM wave file
3) Can only be mono or stereo
4) Must be 8 or 16 bit
wondering if the new moto e has a led notification that moto disabled? i know the previous moto e and g had one. any thoughts as i see some type of sensor or led by the vga front cam.
fix-this! said:
wondering if the new moto e has a led notification that moto disabled? i know the previous moto e and g had one. any thoughts as i see some type of sensor or led by the vga front cam.
Click to expand...
Click to collapse
Sorry, but there is no led notification in new moto e. it has active display. when you up the device the screen will lit up it self and show if you have any notification or not. Now I am quite frustrated for this reason.:crying::crying::crying::crying::crying:
fix-this! said:
wondering if the new moto e has a led notification that moto disabled? i know the previous moto e and g had one. any thoughts as i see some type of sensor or led by the vga front cam.
Click to expand...
Click to collapse
hey I found let notification light just right sight of the speaker grill. it is white. i connect my device with my laptop while it was completely out of power. and boom the led light showed up. but i don't know how to use it.
CeruleanLineage said:
hey I found let notification light just right sight of the speaker grill. it is white. i connect my device with my laptop while it was completely out of power. and boom the led light showed up. but i don't know how to use it.
Click to expand...
Click to collapse
That's the battery LED, used only when the battery goes low. As far as I know, the Moto E 2nd gen unfortunately doesn't have a software-accessible notification LED.
With a custom rom you can access it, im using cm12.1 and i have text notifications blink it
I made a custom binary for the leds so in CM12.1 and AOSP when you plug the USB you have the notifcations..
For so unknown reasons, when you unplug it, the "led driver" is told that there are no more notifications to show.
I'll be investigating on this when I have more time. If I find who and why I am told to stop notifications in the project, I'll be able to make it work with cable unplugged to.
For missed calls and sms will be modding?
scritch007 said:
I made a custom binary for the leds so in CM12.1 and AOSP when you plug the USB you have the notifcations..
For so unknown reasons, when you unplug it, the "led driver" is told that there are no more notifications to show.
I'll be investigating on this when I have more time. If I find who and why I am told to stop notifications in the project, I'll be able to make it work with cable unplugged to.
Click to expand...
Click to collapse
Hey, let me know if there's anything I can do to help, I've been looking at the led code and comparing to see where the difference is. I don't have a ton of time to mess with it, but look at drivers/leds/leds-qpnp.c around line 3115, comparing to nexus4 sources
MOTO E:
Code:
led->default_on = false;
rc = of_property_read_string(node, "qcom,default-state",
&temp_string);
if (!rc) {
if (strncmp(temp_string, "on", sizeof("on")) == 0)
led->default_on = true;
} else if (rc != -EINVAL)
return rc;
NEXUS 4:
Code:
led->default_on = true;
rc = of_property_read_string(node, "qcom,default-state",
&temp_string);
if (!rc) {
if (!strncmp(temp_string, "off", sizeof("off")))
led->default_on = false;
} else if (rc != -EINVAL)
return rc;
Like I said, I haven't had time to test, the logic is clearly inverted in the moto e driver but there's got to be something tied to the charger state too.
ronasimi said:
Hey, let me know if there's anything I can do to help, I've been looking at the led code and comparing to see where the difference is. I don't have a ton of time to mess with it, but look at drivers/leds/leds-qpnp.c around line 3115, comparing to nexus4 sources
MOTO E:
Code:
led->default_on = false;
rc = of_property_read_string(node, "qcom,default-state",
&temp_string);
if (!rc) {
if (strncmp(temp_string, "on", sizeof("on")) == 0)
led->default_on = true;
} else if (rc != -EINVAL)
return rc;
NEXUS 4:
Code:
led->default_on = true;
rc = of_property_read_string(node, "qcom,default-state",
&temp_string);
if (!rc) {
if (!strncmp(temp_string, "off", sizeof("off")))
led->default_on = false;
} else if (rc != -EINVAL)
return rc;
Like I said, I haven't had time to test, the logic is clearly inverted in the moto e driver but there's got to be something tied to the charger state too.
Click to expand...
Click to collapse
I might be wrong but led driver is working fine. If you go by hand and set manually the values in the /sys/classes ... you'll get a blinking led. There real issue is why does the NotificationManager doesn't ask for a blinking led, unless the power cable is plugged in.
If you use my binary you'll see that I added some logs for the lights requested. And NotificationManager explicitly ask to stop blinking when unplugging the USB cable.
its posible to use cyanogen kernel with stock rom so we can use notification led??? because en cyanogen and pacman the led its full working but i prefer stock rom
Hello,
I have a motorola Moto Z2 Force. Like many other motorola, it has a problem: the minimum Media volume (one step above mute) is WAY to lout. (step one is about 36% of the max scale).
In Engineer mode you can set values for each step. But on my Moto there is no Engineer mode since as far as I understood it is only available for Mediatek devices.
I am wondering, in wich file are the volume steps defined? I would like to edit them manually. (>Yes my device is rooted..)
I do not want to use programs like precise volume or things like that.. I would just like to edit the setting and have it done.. I already increased the steps of the slider.. but that does nothing more than adding more steps between 36% volume and 100% volume.
I would like to transform that 36% to about 5%...
I am on Android 8.0.0 latest security update.
Thank you!
Best regards
Sharky
ok guys,
i found out that i have to edit this:
/** Minimum volume index values for audio streams */
protected static int[] MIN_STREAM_VOLUME = new int[] {
1, // STREAM_VOICE_CALL
0, // STREAM_SYSTEM
0, // STREAM_RING
0, // STREAM_MUSIC
1, // STREAM_ALARM
0, // STREAM_NOTIFICATION
0, // STREAM_BLUETOOTH_SCO
0, // STREAM_SYSTEM_ENFORCED
0, // STREAM_DTMF
0, // STREAM_TTS
1 // STREAM_ACCESSIBILITY
};
Click to expand...
Click to collapse
inside the audioservice.java file.. problem is, i dont seem to be able to find this file.. where is it located??
Nobody has an idea on how to change the min. volume of the media, keeping the max volume the same? I am still stuck and found nothing so far...
Hello,
I would like to detect the ringer mode..so here is the code I am currently using.
Below is the code inside onCreate...
BroadcastReceiver receiver=new BroadcastReceiver(){
@override
public void onReceive(Context context, Intent intent) {
AudioManager am = (AudioManager)context.getSystemService(Context.AUDIO_SERVICE);
Log.i("MyApp", String.valueOf(am.getRingerMode()));
}
};
IntentFilter filter=new IntentFilter(
AudioManager.RINGER_MODE_CHANGED_ACTION);
registerReceiver(receiver,filter);
1. When the app runs first time, it printed 0. (Even if my phone ringer mode was normal, it always prints 0 first time when my app runs)
2. I tried to change to vibrate mode...normal mode......however, it never printed. I think that onReceive is not getting called even if I changed the ringer mode to vibrate/normal...
Here is another testing...
I created a simple button..and when the button is clicked, I called getSystemService and getRingerMode to print the value...
I noticed it always prints 0, which is RINGER_MODE_SILENT... I changed my phone to vibrate mode..and it still prints 0....I changed my phone to normal mode..but it still prints 0...
BTW, SDK version is 28 (API 28: Android 9.0(Pie))...
Could this be a permission issue? I don't think I would need to add some permission in order to use RINGER_MODE_CHANGED_ACTION...
Any idea?
Any help much appreciated.
Thanks,