Thanks everyone.
 
I'll try to figure out how to use this. I don't know Objective C at all.
Rather than set it once for the app, I'd just like specific screens to do it.
 
Is there a way we can get this integrated as part of QML Window? Or is there some other more apropriate element? Screen maybe?
Sent: Monday, April 13, 2015 at 1:24 PM
From: "Nuno Santos" <nunosan...@imaginando.pt>
To: "Thiago Macieira" <thiago.macie...@intel.com>
Cc: interest@qt-project.org
Subject: Re: [Interest] Preventing sleep on mobile platforms
You need to override the app delegate and activities on both iOS and Android and then the following does the trick
 
iOS:
 
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    [[UIApplication sharedApplication] setIdleTimerDisabled:YES];
 
    return YES;
}
 
Android:
 
public class YourActivity extends QtActivity
{
 
...
 
@Override
protected void onStart()
{
    super.onStart();
 
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
    getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
}
 
Nuno Santos
Founder / CEO / CTO
www.imaginando.pt
+351 91 621 69 62
 
On 13 Apr 2015, at 18:09, Thiago Macieira <thiago.macie...@intel.com> wrote:
 
On Monday 13 April 2015 18:59:34 Gianluca wrote:
Dear Jason,
I don’t think it’s possible. Doing this means override the user’s
preferences about the energy saving. These kind of preferences are usually
beyond the possibility of any Android and iOS app. Anyway, even if it’s
possible, all guides about user experience on mobile platform always
recommend to never override this kind of user preferences.

I think it is possible. How do mapping applications do it?
--
Thiago Macieira - thiago.macieira (AT) intel.com
 Software Architect - Intel Open Source Technology Center

_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to