Additional libraries, classes and official updatesUsers contributed libraries, classes and official updates.
This forum is open for licensed users only.
I got an error when I try to use my own .gif file with 36 frames
width: 301
heigth: 100
Error:
"An error has occured in sub:main_btnload_click(B4a line: 42)
Timer1.Enabled = true
java.lang.IllegalstateException: Intevral must be larger than 0.
Continue?"
How do I solve this?
running on my SE Xperia X10i
XverhelstX
EDIT: I solved the problem, It was something weird.
All gif files on my pc didn't worked, then I used some of the internet and those worked.
I went to iaza.com and uploaded my gif file there and resaved it and it worked.
XverhelstX
I am facing the same problem, the gif file I have is not working...giving the same error that you mentioned. I have also tried uploading my image to iaza.com and downloading it again but still its not working. However, i can see the animation in the internet explorer fine.
Help please.
I got an error when I try to use my own .gif file with 36 frames
width: 301
heigth: 100
Error:
"An error has occured in sub:main_btnload_click(B4a line: 42)
Timer1.Enabled = true
java.lang.IllegalstateException: Intevral must be larger than 0.
Continue?"
How do I solve this?
running on my SE Xperia X10i
XverhelstX
EDIT: I solved the problem, It was something weird.
All gif files on my pc didn't worked, then I used some of the internet and those worked.
I went to iaza.com and uploaded my gif file there and resaved it and it worked.
XverhelstX
I just downloaded another gif from the internet but when i use it in my app, it crashes with the following message.
Code:
java.lang.NullPointerException at anywheresoftware.b4a.objects.Timer$TickTack.run(Timer.java:102) 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:3683) 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:839) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) at dalvik.system.NativeStart.main(Native Method) Force finishing activity com.home.soft.test/.orderfeedback
Last edited by salmander : 03-15-2012 at 12:26 PM.
Reason: More info
Yes I am pausing the timer1 on activity_pause. what strange thing I observed is when I create a new project and copy paste the code of gif_decoder from my project into the new one, it works fine. On the other hand in my project, the application crashes.
I have the following libraries in my project.
* ABWifi 1.20
* GifDecoder v1.0
* HTTP v1.10
* JSON v1.0
* Phone v1.75
* Reflection v1.6
* SQL v1.02
* TabHostExtras v1.5
* Turn GPS v1.10
I cannot post the entire project here, as its for my company. But if you would like to see, I can post the activity's code here.
This might draw some criticism, but I'm starting to get the impression that B4A is more of a playtoy than a real Android development product. Every time I come up with an app I want to write in B4A, apps that others are writing out there in the Java world, and seemingly no matter how simplistic, I hit a brick wall. This is getting extremely frustrating, and I'm having a real hard time taking B4A seriously at this point.
It feels like I'm being told at nearly every turn to finally just get off my butt, do it right, and learn Java.
I'd LOVE to be wrong here, but...
Hi, I doubt that difficulties come from B4A (or from Java, or do not exist in Java). Especially with things like live wallpapers you should remember that Android is a real time environment with big restrictions on performance, memory consumption and power consumption. Build live wallpapers wrong, and the battery of the phone is empty quickly, or performance deteriorates. Building them right needs to know how a service oriented multitasking operating system works. (Guess why first iOS could not really do multitasking...)
__________________
Unclutter your code -- use an obfuscator
well,I like this library ,I am trying to use it but sometimes it causes :
<!>anywheresoftware.b4a.BA 466<!> java.lang.ArrayIndexOutOfBoundsException
or <!>anywheresoftware.b4a.BA 466<!> java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0
the code is here:
Code:
Sub btn_load_gif_askisis_Click 'Try Timer1.Initialize("Timer1",0) 'πρεπει να γινεται και εδω initialize γιατι αλλιως σκαει ο TIMER Dim what_picture AsString gif.DisposeFrames If number_askisis=1Then what_picture="BBBenchPress-no1.gif" If number_askisis=2Then what_picture="BBInclineBenchPress-no2.gif" If number_askisis=3Then what_picture="BBDeclineBenchPress-no3.gif" If number_askisis=4Then what_picture="DBBenchPress-no4.gif" If number_askisis=5Then what_picture="DBDeclineBenchPress-no5.gif" If number_askisis=6Then what_picture="DBInclineBenchPress-no6.gif" If number_askisis=7Then what_picture="DBPullover-no7.gif" If number_askisis=8Then what_picture="DBFly-no8.gif"
If number_askisis=9Then what_picture="BBDeadlift-no9.gif" If number_askisis=10Then what_picture="Clean-no10.gif" If number_askisis=11Then what_picture="WTChinUp-no11.gif" If number_askisis=12Then what_picture="WTpullUp-test-no12.gif" If number_askisis=13Then what_picture="WTRearPullup-no13.gif" If number_askisis=14Then what_picture="CBFrontPulldown-no14.gif" If number_askisis=15Then what_picture="DBBentoverRow-no15.gif" If number_askisis=16Then what_picture="BBBentOverRow-no16.gif" gif.Load(File.DirAssets,what_picture)
Timer1.Enabled = True gif.SaveFrame(0, File.DirRootExternal, "frame0.png", "P", 85) gif.SaveFrame(0, File.DirRootExternal, "frame0.jpg", "J", 85) 'Catch 'Msgbox("PLEASE CHOOSE AN EXERCISE FIRST !","") 'End Try End Sub Sub Timer1_Tick Timer1.Enabled = False Frame = Frame + 1 If Frame >= gif.FrameCount Then Frame = 0 EndIf Timer1.Interval= gif.Delay(Frame) ImageView1.Bitmap = gif.Frame(Frame) Timer1.Enabled = True End Sub
WHAT I AM TRYING TO DO IS EVERYTIME I SELECT A bodybuiding EXERCISE (FROM AN ITEMVIEW CLICK,AND THEN FROM A SQL DATABASE) TO LOAD A DIFFERENT ANIMATED GIF FOR THAT EXERCISE NUMBER, BUT WHILE WORKS OK FOR SOMETIME,THEN STARTS TO THROW THE EXCEPTION ERROR ON the gif.LOAD
SORRY FOR MY ENGLISH...
Last edited by zeuspower : 12-03-2012 at 03:02 PM.