Audio & Nexsus 7

Carcas

Member
Licensed User
Longtime User
hi

I have this audio problems.

1)Mediaplayer doesn't work on Nexsus 7 (OS 4.2). Debugging wrong. App close.

2)Mediaplayer works only emulator API8 (with API > 8 i have this error message "Unfortunately. B4A Example has stopped")

3)But... if runs on Samsung S2 (OS 4.0.3) it works.

Can you help me please

Thanks :)
 
Last edited:

Carcas

Member
Licensed User
Longtime User
This is logs from API17

now i cant for Nexsus 7 because i havent it for try



LogCat connected to: emulator-5554
** Activity (main) Create, isFirst = true **


main_activity_create (B4A line: 135)


mappa(0,0,2)=LoadBitmap(File.DirAssets,"S1N2.jpg")
java.lang.OutOfMemoryError


at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:502)
at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:601)
at anywheresoftware.b4a.objects.drawable.CanvasWrapper$BitmapWrapper.Initialize2(CanvasWrapper.java:498)
at anywheresoftware.b4a.objects.drawable.CanvasWrapper$BitmapWrapper.Initialize(CanvasWrapper.java:491)
at anywheresoftware.b4a.keywords.Common.LoadBitmap(Common.java:1028)
at b4a.example.main._activity_create(main.java:346)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:167)
at b4a.example.main.afterFirstLayout(main.java:89)
at b4a.example.main.access$100(main.java:16)
at b4a.example.main$WaitForLayout.run(main.java:74)
at android.os.Handler.handleCallback(Handler.java:725)
at android.os.Handler.dispatchMessage(Handler.java:92)


at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5041)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(Native Method)
 
Upvote 0

Carcas

Member
Licensed User
Longtime User
ok i understand that isnt audio problem but

java.lang.OutOfMemoryError

So i dont understand why in api8 runs and in api17 dont runs

help me please

Thank
 
Upvote 0

Carcas

Member
Licensed User
Longtime User
Thanks much,

i just try it but

mappa(1,0,0)=LoadBitmapSample(File.DirAssets,"S2N1.jpg",100%x,100%y)

dont work and ...

mappa(1,0,0)=LoadBitmapSample(File.DirAssets,"S2N1.jpg",480,320)

dont work

mappa(1,0,0)=LoadBitmapSample(File.DirAssets,"S2N1.jpg",50,50)

work but is very very small

I dont understand because if i have

mappa(0,0,0)=LoadBitmap(File.DirAssets,"S1N1.jpg") by (S1P1.jpg - 1280X800 96dpi) it works
and
mappa(1,0,0)=LoadBitmap(File.DirAssets,"S2N1.jpg") by(S2N1.jpg - 1280X800 96dpi) dont work

S2N1.jpg like S1P1.jpg ????????????????????????????????????

I have This Designer Script

imgVisuale.Height = 100%Y
imgVisuale.Width = 100%x

imgvisuale is imageView

lol

sorry but i'm newbe

:)
 
Last edited:
Upvote 0

Carcas

Member
Licensed User
Longtime User
yes i have this error

LogCat connected to: emulator-5554
** Activity (main) Create, isFirst = true **


main_activity_create (B4A line: 145)


mappa(1,0,0)=LoadBitmapSample(File.DirAssets,"S2N1.jpg",100%x,100%y)
java.lang.OutOfMemoryError
at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
..............

but whit

mappa(1,0,0)=LoadBitmapSample(File.DirAssets,"S2N1.jpg",50,50)

it work
 
Upvote 0

Carcas

Member
Licensed User
Longtime User
ok is true but very strange.

In emulator Api8 i havent this problem. My size app is only 6MegaBytes.

Ram emulator is 768M, storage internal is 200M.

Image is only 50K. Number Image loaded is only 15.

In real Device Samsung S2 OS 4.0.3 runs (=emulator API15 android 4.0.3-dont runs)

In real Device Nexsus 7 OS 4.2 dont runs (=emulator API17 Android 4.2 dont runs)

I would like my application is compatible with all devices

Thanks for your patience
 
Upvote 0

Carcas

Member
Licensed User
Longtime User
I solved the problem thanks

I created a procedure that loads the images every time so I can upload all the pictures that I want

example:

imgVisuale.Bitmap=LoadBitmap(File.DirAssets,Posizione & Orientamento & Particolare & TipoParticolare & StatoParticolari(Posizione,Orientamento,Particolare,TipoParticolare)& ".jpg")

File name example : 00000.jpg

the procedure is more slow because it must load each time the files in the stack but is perfect for my application. 150 milliseconds to switch from one image to another image
 
Last edited:
Upvote 0
Top