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 <[email protected]> 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
> [email protected]
> http://lists.qt-project.org/mailman/listinfo/interest

_______________________________________________
Interest mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to