Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4android > Additional libraries, classes and official updates
Documentation Wiki Register Members List Windows Mobile Search Today's Posts Mark Forums Read

Additional libraries, classes and official updates Users contributed libraries, classes and official updates. This forum is open for licensed users only.

Animated GIF decode library

Reply
 
LinkBack Thread Tools Display Modes
  #31 (permalink)  
Old 03-15-2012, 10:18 AM
Knows the basics
 
Join Date: Dec 2011
Posts: 238
Default

Quote:
Originally Posted by XverhelstX View Post
Hello there,

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.
Reply With Quote
  #32 (permalink)  
Old 03-15-2012, 11:48 AM
Knows the basics
 
Join Date: Dec 2011
Posts: 238
Default

Quote:
Originally Posted by XverhelstX View Post
Hello there,

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
Reply With Quote
  #33 (permalink)  
Old 03-16-2012, 07:48 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 25,859
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

This is a strange error. Are you pausing the timer in Activity_Pause?
Reply With Quote
  #34 (permalink)  
Old 03-16-2012, 09:55 AM
Knows the basics
 
Join Date: Dec 2011
Posts: 238
Default

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.

Thanks Erel.
Reply With Quote
  #35 (permalink)  
Old 03-17-2012, 02:50 AM
Junior Member
 
Join Date: Mar 2011
Posts: 82
Default

Try using PhotoScape (free Gif animator-EDitor) to test your Gifs.
Tom
Reply With Quote
  #36 (permalink)  
Old 03-17-2012, 10:19 AM
Knows the basics
 
Join Date: Dec 2011
Posts: 238
Default

My gifs are working fine mate ...as I can open them and see the animation. Thanks mate.
Reply With Quote
  #37 (permalink)  
Old 05-16-2012, 08:16 PM
Woinowski's Avatar
Knows the basics
 
Join Date: Aug 2007
Posts: 130
Awards Showcase
Beta Tester 
Total Awards: 1
Default Difficulties not from B4A?

Quote:
Originally Posted by Highwinder View Post
Thanks for your reply.

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
Reply With Quote
  #38 (permalink)  
Old 05-17-2012, 01:31 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 25,859
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

Where is your timer declared? It should be in process globals.
Reply With Quote
  #39 (permalink)  
Old 12-03-2012, 01:53 PM
Junior Member
 
Join Date: Mar 2012
Posts: 33
Default

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 As String
        gif.DisposeFrames
        
If number_askisis=1 Then what_picture="BBBenchPress-no1.gif"
        
If number_askisis=2 Then what_picture="BBInclineBenchPress-no2.gif"
        
If number_askisis=3 Then what_picture="BBDeclineBenchPress-no3.gif"
        
If number_askisis=4 Then what_picture="DBBenchPress-no4.gif"
        
If number_askisis=5 Then what_picture="DBDeclineBenchPress-no5.gif"
        
If number_askisis=6 Then what_picture="DBInclineBenchPress-no6.gif"
        
If number_askisis=7 Then what_picture="DBPullover-no7.gif"
        
If number_askisis=8 Then what_picture="DBFly-no8.gif"
        
        
If number_askisis=9 Then what_picture="BBDeadlift-no9.gif"
        
If number_askisis=10 Then what_picture="Clean-no10.gif"
        
If number_askisis=11 Then what_picture="WTChinUp-no11.gif"
        
If number_askisis=12 Then what_picture="WTpullUp-test-no12.gif"
        
If number_askisis=13 Then what_picture="WTRearPullup-no13.gif"
        
If number_askisis=14 Then what_picture="CBFrontPulldown-no14.gif"
        
If number_askisis=15 Then what_picture="DBBentoverRow-no15.gif"
        
If number_askisis=16 Then what_picture="BBBentOverRow-no16.gif"
gif.Load(
File.DirAssets,what_picture)
    
    
'ToastMessageShow(gif.FrameCount & " frames", True)
    Frame = 0
    Timer1.Interval = gif.Delay(Frame)    
    ImageView1.Bitmap = gif.Frame(Frame)
    
    Timer1.Enabled = 
True
    gif.SaveFrame(
0File.DirRootExternal, "frame0.png""P"85)    
    gif.SaveFrame(
0File.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
    
End If
    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.
Reply With Quote
  #40 (permalink)  
Old 12-03-2012, 02:46 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 25,859
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

You should run your code in debug mode and check the logs to find the exact error line.

Seems like you are trying to access a zero size array.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 2 (1 members and 1 guests)
luis_german
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Animated GIF decoder library agraham Additional Libraries 19 04-11-2011 06:43 PM
Animated GIF display SarahWard Questions (Windows Mobile) 11 04-01-2010 03:47 AM
Animated gif scott93727 Questions (Windows Mobile) 4 02-11-2009 06:19 PM
GPS - Decode event not firing daveo84 Questions (Windows Mobile) 24 10-14-2008 05:32 AM
Animated box, How? magi6162 Questions (Windows Mobile) 2 09-07-2007 07:27 AM


All times are GMT. The time now is 01:00 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0