Sitemap

Amicuk Programming Answers

App running under lock screen with StreamSocket and SpeechSynthesizer

2015-10-11   Views:1

Advertisement

On wp8 silverlight this was easy. PhoneApplicationService.Current.ApplicationIdleDetectionMode = IdleDetectionMode.Disabled; In 8.1 xaml how would I go about this? I have found an ugly hack online that keeps the screen alive, this is not a solution t

On wp8 silverlight this was easy. PhoneApplicationService.Current.ApplicationIdleDetectionMode = IdleDetectionMode.Disabled;
In 8.1 xaml how would I go about this? I have found an ugly hack online that keeps the screen alive, this is not a solution that I can use. My users need to start my app, select a car transponder that they want to hear lap times from, connect to my server
(over wifi to a local computer running my server code, no internet) hit the lock button, then put their phones in their pockets while they drive and get the lap times on their earpiece. 
I have the new and more cumbersome text-to-speech working (how you have to have an invisible media element on a the active page for mediaended to fire was especially annoying!). I have the streamsocket stuff working, just not under the lock screen. I don't
really need it to be a "background task". It is understood and preferable that it disconnects the moment you leave the page where get your live lap times. 
controlchanneltrigger seemed promising, you can use it for store apps... but not phone.
To summarize.
1. connect to server with streamsocket api
2. lock screen and put phone in pocket
3. app should stay alive and as packets arrive from the server (one packet every 10 seconds on average), store lap time results and say them out loud using text to speech.
https://youtu.be/0VnOh6s3hww
At this point I'm pretty fed up and I'm about to pull the plug on the WP8.1 version, my first experience with xaml was... unpleasant... So if you have some good keywords I can search for that would be appreciated.

The replay answer
Advertisement
Hi torg,
The most similar API on Windows Phone 8.1 is
RequestActive | requestActive method, see this for more information: How to keep the display on during audio/video playback (XAML)
--James
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Go to See the other 2 answers

App running under lock screen with StreamSocket and SpeechSynthesizer

Category:DefaultRelease time:2015-10-11Views:130

On wp8 silverlight this was easy. PhoneApplicationService.Current.ApplicationIdleDetectionMode = IdleDetectionMode.Disabled; In 8.1 xaml how would I go about this? I have found an ugly hack online that keeps the screen alive, this is not a solution t[More]

Hot
Hi, I just got my Macbook Pro with Snow Leopard May 2010. I can only print and fax with my 1 year old HP 1312nfi color laserjet multi-function printer. I cannot SCAN at all. I tried loading the software that came with the printer but it wouldn't inst [More]
I have a iPhone 3gs and I purchased 30 songs and an audio book on my iphone through itunes.  I manage my own songs on my PC's itunes.  I tried to drag and drop my legally purchased songs and audiobook onto the itunes library on my PC.  It will not al [More]
Hi Experts, Is there a variance report for planned v/s actual raw material consumption for an order when the order is still running? I mean when only the partial quantities are confirmed (PCNF, PDLV)? Regards, SachinHi, Always the plannig is done for [More]
I have saved Sent Items as a distinct .pst file. Is there a method for importing it into TB? The Sent Items in Outlook were not included when I imported mail from the original Outlook.pst file.well I have read the question and the answer and the resp [More]
I'm using Visual Studio 2010 with Crystal Report for VS 13_0_13 on Windows 7.  I create a bunch  of Crystal Report but when I try to print them nothing happen.  The Print Dialog screen also weird, non of the boxes has any setting and there are no pre [More]
Hi All, I have a very similar post in the SQL Server 2014 forums too (https://social.technet.microsoft.com/Forums/sqlserver/en-US/adb5e338-907e-4405-aa62-d3ea93c7a98a/sql-server-2014-always-on-ha-takes-814-seconds-to-fail-over-application-side-timeou [More]
FCP X has a default duration for still images when you import them. After importing, how can I edit the duration of multiple clips? I've tried selecting them all, control-click and change duration, but nothing changes. BTW I want to make them 5 frame [More]
If I do a manual download via FF website, it starts to install, asking if I want to replace an older version of FF. If I then continue, it says that it cannot process as I do not have access to 'certain components'???? I have full admin rights, it is [More]
Hi evebody, I have process that use this sql request : SELECT $code FROM DUAL WHERE $code IN ('BMW','MERCEDES','TOYOTA','PEUGEOT'); Actually, the code is a string which value is car brand. for example 'BMW'. I want to change my process and have the p [More]
Hi Team, I have to select dynamic fields from database table GLT0. This depends on period value given on screen. If period is 01 then fields will be hsl01. If period is 02 then fields will be hsl01 and hsl02. If period is 03 then fields will be hsl01 [More]