B4A Library [Lib] MediaBrowser

ibra939

Active Member
Licensed User
Longtime User
Nice media to create
 

Informatix

Expert
Licensed User
Longtime User
I added these functions to the new version (see post #1). I also added a function to force the scan of new media.
 

mlc

Active Member
Licensed User
Longtime User
Hello Frederic,

Sorry to bother, but with the new version I get this error message:

B4X:
java.lang.ClassNotFoundException: flm$media$browser$MediaBrowser
    at anywheresoftware.b4a.shell.Shell.getCorrectClassName(Shell.java:544)
    at anywheresoftware.b4a.shell.Shell.createObject(Shell.java:516)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:320)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:238)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:507)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:121)
    at mlc.wifitransfer.main.afterFirstLayout(main.java:91)
    at mlc.wifitransfer.main.access$100(main.java:16)
    at mlc.wifitransfer.main$WaitForLayout.run(main.java:76)
    at android.os.Handler.handleCallback(Handler.java:587)
    at android.os.Handler.dispatchMessage(Handler.java:92)
    at android.os.Looper.loop(Looper.java:130)
    at android.app.ActivityThread.main(ActivityThread.java:3691)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:507)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:670)
    at dalvik.system.NativeStart.main(Native Method)

and the app does not start.
 

Informatix

Expert
Licensed User
Longtime User
Are you sure that you use Java 7? Check Tools/Configure paths/javac.exe.
 

mlc

Active Member
Licensed User
Longtime User
Hi Frederic,

Sorry, you're right, I did not read the guide in the first post.

The rush is bad partner.
 

mlc

Active Member
Licensed User
Longtime User
Hi Frederic,
I get the same result with java 7




and the same error:

B4X:
LogCat connected to: 50D3B7A940CF533ED58A33DE39E4854
--------- beginning of /dev/log/system


--------- beginning of /dev/log/main


java.lang.ClassNotFoundException: flm$media$browser$MediaBrowser


    at anywheresoftware.b4a.shell.Shell.getCorrectClassName(Shell.java:544)
    at anywheresoftware.b4a.shell.Shell.createObject(Shell.java:516)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:320)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:238)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:507)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:121)
    at mlc.wifitransfer.main.afterFirstLayout(main.java:91)
    at mlc.wifitransfer.main.access$100(main.java:16)
    at mlc.wifitransfer.main$WaitForLayout.run(main.java:76)
    at android.os.Handler.handleCallback(Handler.java:587)
    at android.os.Handler.dispatchMessage(Handler.java:92)
    at android.os.Looper.loop(Looper.java:130)
    at android.app.ActivityThread.main(ActivityThread.java:3691)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:507)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:670)
    at dalvik.system.NativeStart.main(Native Method)


Os: windows Xp Sp2
 

mlc

Active Member
Licensed User
Longtime User
No, with my project,.
I try your demo and tell you something
 

mlc

Active Member
Licensed User
Longtime User
The error with your demo:

B4X:
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = true **
java.lang.ClassNotFoundException: flm$media$browser$MediaBrowser
    at anywheresoftware.b4a.shell.Shell.getCorrectClassName(Shell.java:544)
    at anywheresoftware.b4a.shell.Shell.createObject(Shell.java:516)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:320)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:238)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:507)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:121)
    at flm.mediabrowser.demo.main.initializeGlobals(main.java:264)
    at flm.mediabrowser.demo.main.afterFirstLayout(main.java:95)
    at flm.mediabrowser.demo.main.access$100(main.java:16)
    at flm.mediabrowser.demo.main$WaitForLayout.run(main.java:76)
    at android.os.Handler.handleCallback(Handler.java:587)
    at android.os.Handler.dispatchMessage(Handler.java:92)
    at android.os.Looper.loop(Looper.java:130)
    at android.app.ActivityThread.main(ActivityThread.java:3691)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:507)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:670)
    at dalvik.system.NativeStart.main(Native Method)
** Activity (main) Create, isFirst = true **
java.lang.RuntimeException: Unexpected command: 97
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:373)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:238)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:507)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:121)
    at flm.mediabrowser.demo.main.afterFirstLayout(main.java:98)
    at flm.mediabrowser.demo.main.access$100(main.java:16)
    at flm.mediabrowser.demo.main$WaitForLayout.run(main.java:76)
    at android.os.Handler.handleCallback(Handler.java:587)
    at android.os.Handler.dispatchMessage(Handler.java:92)
    at android.os.Looper.loop(Looper.java:130)
    at android.app.ActivityThread.main(ActivityThread.java:3691)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:507)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:670)
    at dalvik.system.NativeStart.main(Native Method)
 

Informatix

Expert
Licensed User
Longtime User
So ask Erel because something is wrong with your installation.
 

mlc

Active Member
Licensed User
Longtime User
I'll install the version 4.00, maybe solve the problem.
Now i have 3.80.
 

mlc

Active Member
Licensed User
Longtime User
Hello Frederic,
With the new version of B4a (4.00), i can compile the project without problems, but GetImageFileInfoByID and GetVideoFileInfoByID still does not work.

This is the error:

B4X:
Error occurred on line: 266 (serverservice)
java.lang.IllegalStateException: get field slot from row 0 col -1 failed

    at android.database.CursorWindow.getString_native(Native Method)
    at android.database.CursorWindow.getString(CursorWindow.java:329)
    at android.database.AbstractWindowedCursor.getString(AbstractWindowedCursor.java:49)
    at android.database.CursorWrapper.getString(CursorWrapper.java:135)
    at flm.media.browser.MediaBrowser.CommonAudioSub(MediaBrowser.java:65)
    at flm.media.browser.MediaBrowser.GetVideoFileInfoByID(MediaBrowser.java:469)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:507)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:636)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:302)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:238)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:507)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:121)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:159)
    at anywheresoftware.b4a.objects.Servlet$2.run(Servlet.java:87)
    at android.os.Handler.handleCallback(Handler.java:587)
    at android.os.Handler.dispatchMessage(Handler.java:92)
    at android.os.Looper.loop(Looper.java:130)
    at android.app.ActivityThread.main(ActivityThread.java:3691)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:507)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:670)
    at dalvik.system.NativeStart.main(Native Method)
** Activity (http) Pause, UserClosed = false **


In the fifth line I see something strange for me : at flm.media.browser.MediaBrowser.CommonAudioSub(MediaBrowser.java:65)
I have no idea, but maybe should be: CommonVideoSub
Same for images?
Thanks
 

Informatix

Expert
Licensed User
Longtime User
Fixed. Sorry for my mistakes.
 

mlc

Active Member
Licensed User
Longtime User
Hello Frederic,

I am trying to use GetExtImageFileInfo and GetExtVideoFileInfo with this code:

B4X:
Dim extt As String = "/mnt/sdcard/external_sd/dcim/Camera/20141231_235818.jpg"
Dim m As Map
m = MB.GetExtImageFileInfo(extt)

The file exists and if I use GetMediaImageList, the map returns exactly this Location, ie the extt variable.

However, GetExtImageFileInfo always returns a null map.

There's something I'm doing wrong?

Thanks
 

Informatix

Expert
Licensed User
Longtime User
Did you add the permission to read the SD card? (look at the manifest of my demo)
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…