So after posting last time i went and created a Java class in src folder that is 'myappdir/.buildozer/android/platform/python-for-android/src/src/org/test' but i get a jnius.jnius.JavaException: Class not found 'org/test/CellLocationZimGsm'
Here below is the .java file::
Enter code here...package org.renpy.android;
import android.content.Context;
import android.telephony.TelephonyManager;
import android.telephony.gsm.GsmCellLocation;
public class CellLocationZimGsm {
/**
* @param args
*/
public static int look () {
TelephonyManager tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
GsmCellLocation location = (GsmCellLocation) tm.getCellLocation();
public String IMEI = tm.getDeviceId();
public int lac = location.getLac();
return lac ;
}
}
i build the app with buidozer android debug, with main.py as shown below::
Enter code here...from kivy.app import App
from jnius import autoclass
from kivy.uix.widget import Widget
from kivy.uix.boxlayout import BoxLayout
from kivy.properties import StringProperty
CellLocation = autoclass('org.test.CellLocationZimGsm')
class Location(BoxLayout):
cellid = StringProperty('00')
def getcell(self):
cell = CellLocation()
cellid = str(cell.look())
class MyTestApp(App):
pass
if __name__ == '__main__':
MyTestApp().run()
I/python ( 3148): [DEBUG ] [Cache ] register <kv.image> with limit=None, timeout=60s
I/python ( 3148): [DEBUG ] [Cache ] register <kv.atlas> with limit=None, timeout=Nones
I/python ( 3148): /data/data/org.test.beta/files/lib/python2.7/site-packages/kivy/core/image/img_pygame.py:12: RuntimeWarning: import cdrom: No module named cdrom
I/python ( 3148): (ImportError: No module named cdrom)
D/dalvikvm( 416): GC_EXPLICIT freed 85K, 21% free 23927K/30279K, paused 3ms+9ms, total 109ms
I/python ( 3148): [INFO ] [Image ] Providers: img_tex, img_dds, img_pygame, img_gif (img_pil ignored)
I/python ( 3148): [DEBUG ] [Cache ] register <kv.texture> with limit=1000, timeout=60s
I/python ( 3148): [DEBUG ] [Cache ] register <kv.shader> with limit=1000, timeout=3600s
I/python ( 3148): Traceback (most recent call last):
I/python ( 3148): File "/home/tiny/project/FfF/accumulator/accum/.buildozer/android/app/main.py", line 7, in <module>
I/python ( 3148): File "/home/tiny/project/FfF/accumulator/accum/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages/jnius/reflect.py", line 150, in autoclass
I/python ( 3148): File "jnius_export_func.pxi", line 23, in jnius.jnius.find_javaclass (jnius/jnius.c:11642)
I/python ( 3148): jnius.jnius.JavaException: Class not found 'org/test/beta/CellLocationZimGsm'
I/python ( 3148): Python for android ended.
W/dalvikvm( 3148): threadid=11: thread exiting with uncaught exception (group=0x4114d378)
E/AndroidRuntime( 3148): FATAL EXCEPTION: Thread-4840
E/AndroidRuntime( 3148): java.lang.NoClassDefFoundError: org/test/beta/CellLocationZimGsm
E/AndroidRuntime( 3148): at org.renpy.android.SDLSurfaceView.nativeInit(Native Method)
E/AndroidRuntime( 3148): at org.renpy.android.SDLSurfaceView.run(SDLSurfaceView.java:726)
E/AndroidRuntime( 3148): at java.lang.Thread.run(Thread.java:856)
E/AndroidRuntime( 3148): Caused by: java.lang.ClassNotFoundException: org.test.beta.CellLocationZimGsm
E/AndroidRuntime( 3148): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
E/AndroidRuntime( 3148): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
E/AndroidRuntime( 3148): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
E/AndroidRuntime( 3148): ... 3 more
W/ActivityManager( 416): Force finishing activity org.test.beta/org.renpy.android.PythonActivity
I/ActivityManager( 416): No longer want com.mobisystems.fileman:search (pid 2747): hidden #16
D/AndroidRuntime( 3148): Shutting down VM
W/dalvikvm( 3148): threadid=1: thread exiting with uncaught exception (group=0x4114d378)
I/Process ( 3148): Sending signal. PID: 3148 SIG: 9
I/ActivityManager( 416): Process org.test.beta:python (pid 3148) has died.
I/WindowState( 416): WIN DEATH: Window{42671720 SurfaceView paused=false}
I/WindowState( 416): WIN DEATH: Window{425feb00 org.test.beta/org.renpy.android.PythonActivity paused=false}
W/InputMethodManagerService( 416): Got RemoteException sending setActive(false) notification to pid 3148 uid 10226