I have in mind one simple application, but I would like to add some animations, transitions and so on. What technologies should I use besides Android SDK?
Concrete example: I have an activity with an animated background in constant loop (some waves, fancy shadows and graphics - maybe do it in Flash and import is or...?) and I have a big TextView in front. When user taps on screen - text explodes or burns or something like that and new text reappear. If I click on some button it also provides some fancy animation.
Should I use AndEngine or...?
I would recommend you use libgdx: http://code.google.com/p/libgdx/
It has a bit of a learning curve, but its really flexibel
Related
In this mock up, see the screen where it said "Decrease Traffic", the traffic light pops up from below.
https://dribbble.com/shots/2106573-Intro-App-Interaction
I'm wondering how to create that effect on Android, if possible, any library to do that. Thanks
you can achieve this with Android Property Animations
in your example it seems to be a scale animation from 0 to 1 in x and y direction.
you can also combine different animations to get such or other effects.
My guess is that these kind of animation are to develop with a 3rd party program, and are not done by Android itself.
This way you have a ready-to-instantiate file (.gif maybe?) that you just call when the view pager is switched.
Looking also to the other animations in the example (look # "Meet New Friends", how every circle pops by himself) I think this was the used approach in your example-link.
If you are anyway looking for something that would look like what is done there, I'd suggest you start playing around Animator objects (and its subclasses like Value/ObjectAnimator) to animate the view you want.
This can be done also via XML files, describing the animation you need.
An important role in this do-it-yourself animation is played by Interpolators , who give you the chance to further customize the animation in an easier way (take a look at OvershootInterpolator, which lets your animation go a bit after the destination value you set, just to turn back later, giving you a "blob" effect. This might give a better idea what I'm meaning)
I am implementing a piano tiles clone for an educational purposes. I've created 5 Views (that's the rows) which extends LinearLayout. Each one of them has 4 childs (that's the 4 tiles).
I am using an Handler for the animation, and change the Y property manually every "tick".
Problem is, the animation is somewhat twitching and not smooth.
I have two questions:
Is that a good design? I know for example about surfaceView as alternative for drawing and animating but that seemed to me a bit complicated for my cause.
How would you animate those tiles? currently I use an Handler (actually I was guided on another thread to use Animation. What do you think the most feet to my case?
Thanks!
I like your grid idea, but you may have to change it if you would like the tiles to be procedurally generated. Also, here is a thread on how to make animations smoother in Java (This can probably apply to Android too):
How can I make a Java Swing animation smoother
Here is one for Android: Moving animation not smooth in android
Also, I feel you are a bit behind, the Piano Tiles phase has disappeared now, much like Flappy bird.
I currently have an android application that utilises the native android views for the UI (e.g. imageviews/buttons etc)
Although this app is not a game, nor requires any heavy graphics or OpenGL, I would like to incorporate a little physics-related interaction. Nothing too significant but maybe display minor collisions/bounces, deceleration/acceleration or possibly friction.
Is this possible to simulate either within the android framework or using an external physics library like jbox2d without having to utilize an entire game engine (like andengine, libgx etc).
P.S. this is for API 15+
Thanks all.
As long as you can set/update the position of the UI elements every frame (e.g. with View.setTranslationX()), you can do it.
Animating the UI by hand would mean keeping a mapping between the UI elements and the physical (e.g. jbox2d) bodies that correspond to them. Then you update the respective positions of the UI elements to what the simulated bodies have each frame (such as body.getPosition()).
In event-driven apps, something like a Timer object is useful for scheduling the physics updates.
The easiest way (not that flexible) is using ViewPropertyAnimator.
With it you can animate properties even in parallel. Maybe you want to change a view margin from the parent left. You can change that margin there, setting up the time to move and else. Some examples on this blog
ValueAnimator is other alternative, which uses the AccelerateDecelerateInterpolator by default and you have to provide the code that changes the property you need. This official guide may suffice to get them working.
what you want is quite impossible - your options are:
you may fake stuff like bounces with animations
you can implement a whole new ui lib
you use openGL what i would do
I think this can be achieved, at least at some point.
You have access to a pretty complete Animations API. This last, together with some view bounds, distance, and probably device orientation calculations, can be used to simulate almost all the cases you mentioned.
You can create Accelerate/Decelerate, form change... and almost whatever animation you want.
How you can achieve what you are asking for:
Having different animations, one after another, creating and applying them dynamically depending on the view item state. And by state, I mean the "physical state": falling, collisioning, in touch with another view, and so on...
I'm making a board for Android. I use .png images for the board (background) and checker pieces. Basically, it's a game where the graphics are updated upon touch events. It's a school-assignment so I have to use View implementations. For the graphics I've considered two options:
Making a whole "BoardView" class (that extends View) and draw all the graphic components directly on the canvas using onDraw(canvas).
Using ImageView objects to represent each checker piece and the board and putting them on a Layout.
My intuition tells me to use the first method. But my thoughts are that I want to use the pre-implemented TranslateAnimation when a checker is moved. From my understandings; this forces me to use the second method, since I can't animate a Drawable.
Now, to the question: what method is best for me? And if the second; which Layout is preferred to use? I want to be able to overlap the checkers over the board image and compare the ImageView objects' positions to each other to determine where to put the checkers on the board.
Regarding to your simple requirement, I think you can adopt method 2.
Trust me, I have done this kind of stuff years ago, on a legacy linux platform. For these kind of simple game applications, you really do not need to bother with all the frame drawing stuff. Just stick with the existing UI widgets.
This is because the visible elements are all very simple, like cards, static images, blocks etc. You don't need to perform pixel drawing. I have tried to make tetris, mine sweep, and card match games. I even create simple visual effects for it using existing animation facility. That is very easy to do so.
And, of cause, as a software programmer, to write a game using the typical frame by frame approach is much more professional. But it depends on the requirements. Why not using less code to create more value?
I am trying to write a simple slideshow with various transitions between images.
I would like to have various transitions like fade in, fade out, slide left/right which could probably be done with android's API Animation. But I would also like to have more complex transitions like checkerboard left/right, box in/out, circle in/out, curtain, spiral, split horizontal, and so on which I believe can't be done with Animation.
I know that names of transitions like I named them above are not enough to know exactly how the transitions should look like, but I think you get the general idea.
So, my question is:what should be used to achieve those effects/transitions? I am not asking for the code (though some links to examples would be great of course), but more generally what should I be using? OpenGL? Regions? Clip Paths? BitmapShaders?
I just don't feel like spending a week investigating this, when I am sure you guys know the answer ;)
If possible I would like to avoid OpenGL since I haven't used it. On Android 3.0+ devices I will use hardwareAcceleration="true" in Manifest, and on devices less than 3.0 I could limit to simple slide in/out, fade in/out if necessary (read: if other transitions would be too slow not using openGL).
Check view animation and property animation.