How to keep the screen on in Universal phone app? - windows-phone

Before Windows Universal, if I wanted to prevent the screen from turning off, I could use:
PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
That API is now gone and I can't find anything like it. Can someone help me find the right way to do this now?

Take a look at DisplayRequest class: https://msdn.microsoft.com/en-us/library/windows/apps/br241816.aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-2. It's intended to apps which
show video or run for extended periods without user input
so it should be a solution.

Related

How to handle this kind of situation?

I need to develop a web project for mobile devices. And I met an awkard situation.
This is customer's desire. A user come to the bar. He scan QR image with a phone camera, a banner appears to ask if he want to open the browser menu or an app.
Well, as a web developer this seems absolutely impossible. But the problem is that the customer claims that this is the most common UX those days. I am not sure what does it mean. Have you seen any kind of thing like this and know how to do it? Or is it just a customer's imagination?
Even if they implemented this via app, I just want to know how they were able to show the banner on a camera. Thanks in adavance.

What is the best way to display and interact with a skill tree

I am trying to create an interface that is similar to the interface on this website for the skill tree: http://www.pathofexile.com/passive-skill-tree. What is the best way to go about doing this and have the same or similar user interaction. ie. you click on a node and it activate or deactivates it. The movement of the tree and zooming on it would be nice as well. Would like to try to stay away from webView as I am thinking about features I want to add. Thanks in advance just want to see what a good way to do this is.
you can use webView and have almost a copy-paste of the presented webpage html source and load it.
However with native components you can have better performance, but it will "not a copy"
Native componets:
IIViewDeckController for iOS
iHasApp for iOS
iHasApp for iOS
There are more on that side. Consider a combination of they,

Updating live tiles for windows phone 8 periodically

I need to update my application's tile periodically with the count the amount of inbox items. Anyone can give me a reference or relevant link to a example or tutorial? I get my data from a webservice. I went on google, and all the examples is on button click. I need one that does this automatically every few minutes/hours? This is for the windows phone 8 start screen of the phone.
thanks in advance!
This is probably the best tutorial I have seen for live tiles in wp8:
http://www.windowsphonegeek.com/articles/live-tiles-in-windows-phone-8-part-1-tile-templates
There are a couple of different ways you can do this. You can use Azure Mobile Services OR you can use a background process for your app to update the tile. You can find information here :
http://thesociablegeek.com/windows-8/livetiles/modifying-live-tiles-in-a-background-process/
Daniel

block ipad camera

Is there any way in which the usage of the camera of the iPad2 can be restricted only to my application? even if it is using i tunes.
could not find any code related to it. some code would be helpful.
There's no way to achieve this. I think it could be done with quite a bunch of hacking if you were developing for Cydia, but I'm not sure ever then. If the user quits your application or switches from it, the system will make the camera available to any other app requesting it.

Disable iphone home button in app, is it possible?

I want to develop a screensaver-like app where the only way of getting back to the springboard is entering a code. Therefore I would need the Home Button action to be ignored, that is that when the user presses the button nothing happens..or something custom...instead of going back to the springboard and terminating the app.
Is this possible? does anybody know if apple will approve/reject this kind of app?
The answer to your question is, yes.
The answer to the question you meant to ask--can I ship an app through the iPhone store that has the home button disabled--is no.
If you are only publishing your app to jailbroken phones you can do it, but it will piss everyone off.
Edit 7 years later:
This is actually extremely possible now--there is a standard feature in the iPhone called "Guided Access". It's hidden under that "Accessibility" Link (With some other fairly cool stuff like flashing the LED whenever you get a call and allowing a Bluetooth keyboard to tab between controls)
It's called "Guided Access". You set a passcode, launch the app then triple-click the home button to start guided access.
It disables exit and allows you to designate regions of the screen you can't touch. You can also set a time limit (For kids playing which seems to be the reason a lot of people look up this question).
Tempted to edit the "Accepted answer" and throw this info in there, but that seems rude so I'll just hope people find this answer.
Annoyingly you also seem to be unable to shut off the phone--I suppose this is perfect for people who want their kids to play a game, but might not hit the original asker's problem of restricting access to a single app (I mean it WILL do that but it'll also prevent it from doing ANYTHING else).
Not with public APIS (and hopefully, not with private ones). Even if you manage it somehow, Apple will reject it for breaking UI guidelines. Moreover, even if they didn't, people could always use the iPhone's "Force Quit" equivalent to hard terminate your app.
Apple is not going to approve this type of app, they state pretty explicitly that you're app needs to respond appropriately to springboard telling the app to terminate both when things like phone calls come in and when memory warnings come in.
This is not possible with the current SDK, nor do I suspect it will ever be.
You might be able to get this behaviour via jailbreaking, but you won't be able to sell your app through iTunes, nor will Apple ever approve such an application.
You can do it like this
Install the following mobileconfig file
This will disable the home button once you launch the app
Download
Found the link Here
Apple won't allow it.
What if something emergency happens and you wan to dial an emergency phone number. You are putting the user at risk. The trade-off isn't worth it.