How to implement UndoManager (with example in Java on Android)

Undo-redo is a must-to-have feature in editing programs. This blog post describes how to implement undo-redo in your program. The example taken here is in Java but the concept is very simple and can be implemented easily in any language.

Here is idea to implement the undo-redo. First of all you need these:
UndoManager - a class that implements undo-redo features.
UserAction - an abstract base class for all user actions.

Making the iOS text field/view visible which is located under keyboard.

The text view being hidden by keyboard is a very common issue faced by iPhone/iPad developers. When you touch a text view, the text view becomes first responder and keyboard automatically appears. If the text view is lying somewhere in lower part of the screen, most probably it will get hidden under the keyboard.

The solution is to scroll the text view up enough so that it comes above the keyboard. To do that, you need to add the text view in UIScrollView so that it can be scrolled up.


Here is the strategy:

Drawing and erasing using touch on Android

Drawing/Erasing using touch is a common feature in many mobile phone/tablet based apps.
Writing code for this feature is pretty simple for android. Here are steps to do that:

My first android app: learning+coding+publishing in 5 days

Hey! don't be surprised.  This is not a game like "Angry Birds". Typically, 5 days are not sufficient for a beginner to create a descent app. But my app is not just a "Hello World" app. This is Scratchpad: a simple drawing app. This can be used mostly by kids to draw/erase with touch and can also share the drawing using emails or any other image sharing app.

Recent comments

Subscribe to www.avabodh.com RSS