Pages

Showing posts with label greenDao. Show all posts
Showing posts with label greenDao. Show all posts

Friday, June 1, 2012

Yet another XMPP Client for Android

First of all, git it from github: https://github.com/Buggaboo/android_xmpp_client

The features

  • GreenDao, database access. Say goodbye to e.g. SQL injection exploits, crap manual data type conversions;
  • Smack library (xmpp), modified for Android, with bugs, but not crashworthy;
  • It vibrates messages to morse code; (3 june 2012: WIP)
  • The messages can be translatable to different languages, just by leveraging the xml resources;
  • Multiple provider support, i.e. connect with google, microsoft, meebo, whatever you want;
  • Licence: GPLv3;
  • Support for android api levels 10 thru 15 (from gingerbread to ice cream sandwich due to compatibility library, 80% of the android  market);
  • Support for android api level 15 (pure ice cream sandwich, less than 10%);
  • Support for fragments (12 june 2012: WIP);
  • Support for android Notifications;


 

 

  The general design

  • Sharing data between Contexts via the database: A context alpha (e.g. Activity or Service) pokes another context beta with an Intent with a Bundle payload containing the record id of a certain database table.
  • To prevent competition for the same database resource, certain services take randomized naps, aka Thread.sleep(Long);
  • A message entity has a buddy entity has a connection entity, i.e. I use foreign keys, to sort and group data etc., GreenDao generates all the code you need;
  • BroadcastReceivers and ArrayAdapters work together to refresh your ListViews.

Known Issues

  1.  There are no bounds on how much data is pulled from the database and rendered as a view, the ListViews are potential memory hogs;
  2. There are no arbitrary limits on data input, which could eat all your memory;
  3. I have not stress-tested how many connections can be kept alive at the same time, before thread-related issues arise;
  4. I suspect that the smack library has its own issues with regard to Presence;
  5. I have not checked  for memory leakages, I use nested classes for my BroadcastReceivers, I haven't checked for cyclical references, I don't understand fully how garbage collection on android works;
  6. The vibrator notification can get annoying, or fun, depending on your mood.