New Plans

Having to work on mornings, and studying in the afternoons, leaves not much spare time, so I have to plan how to spend it…

I’ve been thinking about improving my final thesis code, to make the interface fancier, and improve some functionalities BUT I have an already started project, which is going to take longer because it involves learning C++/Qt, and this is a challenging task!!!

I will publish further advances in the thesis aspects, as the other project is still in «planning phase», such as interface pictures or some pieces of code.

Have fun!

How to exit from your app, or kill it

Get an Activity Manager, and then ask for a package restart:

ActivityManager m_activityManager = (ActivityManager) getSystemService(Activity.ACTIVITY_SERVICE);
m_activityManager.restartPackage(PACKAGE_NAME);

And that’s it, it just works.

I know its not recommended, and that it’s against activities lifecycle, but sometimes it is necessary for your app.

Have fun!

Spam Problems

Some spambots are messing around this blog (and I suppose that everyone’s else), so I’ve set comment moderation, just in case spam comes around.

Common comments are welcome!!!

Have fun!

Navigate through form fields in Android

When having EditText as form fields, you might want to navigate from one to another by using the soft keyboard. This is easy if you use the following property in the layout xml:

For inputs that have a «following» element :

[code=»xml»»»»»»»»»»»]android:imeOptions=»actionNext»[/code]

For the final item:

[code=»xml»»»»»»»»»»»]android:imeOptions=»actionDone»[/code]

There are several options to control the Enter/Next… key in soft keyboard, here are a list of possible values (what do they display and if there is a special action)

  • actionDone: Done, hides the soft keyboard if not the last text input box
  • actionGo: Go
  • actionNone: Enter key simbol, inserts a new line (cursor goes to next line)
  • actionNext: Goes to next item, displays «Next» (or equivalent in your language)
  • actionSearch: displays a magnifying glass
  • actionSend: Send

some image examples (in Spanish locale) for action buttons (for «navigation» you should need next and done):

Search action button

Search action button



Go Action Button (Ir in Spanish)



Next Action button (Sig. from Siguiente in Spanish locale)

Next Action button (Sig. from Siguiente in Spanish locale)



Done Action button (Listo in Spanish locale)

Done Action button (Listo in Spanish locale)



Default Action Button

Default Action Button



For further information, you should look at the official documentation page, on Onscreen Inputs