com.google.android autoclass

90 views
Skip to first unread message

purushottam yadav

unread,
Nov 11, 2022, 4:07:29 AM11/11/22
to Kivy users support

I am trying to implement  Turn ON location services (GPS) without navigating to settings page from your Android App using 

any other alternatives  to do that ?

and is it possible to import below things  using autoclass/pyjnius    ...?


package com.programmerworld.gpsonoffwithoutgoingtosettings;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;

import android.Manifest;
import android.content.IntentSender;
import android.content.pm.PackageManager;
import android.location.LocationManager;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.google.android.gms.common.api.ResolvableApiException;
import com.google.android.gms.location.LocationRequest;
import com.google.android.gms.location.LocationServices;

import com.google.android.gms.location.LocationSettingsRequest;
import com.google.android.gms.location.LocationSettingsResponse;
import com.google.android.gms.location.SettingsClient;
import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.android.gms.tasks.Task;
 

Mohit Narwani

unread,
Nov 11, 2022, 5:45:58 AM11/11/22
to Kivy users support
is tts working fine now with kingdroid?

purushottam yadav

unread,
Nov 11, 2022, 5:54:09 AM11/11/22
to Kivy users support
I  am not using kingdroid .  i am using pyjnius code , it is working  .  

what about present issue ..? 

Robert

unread,
Nov 11, 2022, 4:13:51 PM11/11/22
to Kivy users support
Pyjnius is a Python-Java interface, nothing in Pyjnius is specific to Android Java apis.
Autoclass is used to obtain a reference to a Java class

Android View and TextView may conflict with Kivy for screen ownership.

Just because you can autoclass, does not mean you should autoclass everything. Sometimes it is simpler to create a Java module and autoclass that. Same as we sometimes do for performance https://github.com/Android-for-Python/Android-for-Python-Users#pyjnius-performance

Mohit Narwani

unread,
Nov 13, 2022, 6:39:15 AM11/13/22
to Kivy users support
oh great! how you did that could you send me code
Reply all
Reply to author
Forward
0 new messages