Saturday, January 1, 2011

KNXDroid + Gira Home Sever = BFF

Hi all,

KNXDroid Version 2.0 is just around the corner, the beta testers are sending now the final reports, and everything is just ready for this release.

this version will include some major new features:

1. You can connect, monitor & control you KNX Installations via the Gira home server.
2. You can import your devices list into KNXDroid with a single button click
3. You can Export the monitor screen information to CSV file for later analysis.
4. You can set a custom icon for each device
5. KNXDroid will now be available in German, French, Spanish in addition to English

and of course, this release contains many bug fixing and performance improvements.
leave a comment if you have further questions or some requests for another features.

here are some screen shots...


Monday, November 29, 2010

KNXDroid updates & News



KNXDroid has been updated last week with some new features and few bug fixings.
The KNXMonitor in the application now supports filters, and will soon have the option to
export all the events to a CSV file.
Few UI improvements are also included in this update and you can get much more information from the monitor screen.

You can read more about the application in the UK folks website: Automated Home

Yosi.

Thursday, November 11, 2010

KNXDroid is in the wild!



KNXDroid is in the wild now!

KNXDroid application will allow you to control your smart building environment using your android phone.
The application has beautiful User interface and if you use & enjoy it, please leave a nice comment on the market.

use the QR code, and just search the market...

Saturday, October 30, 2010

Custom Links

in one of my projects i needed to create custom links. My goal was to create few text views that will look and feel like normal links, but i wanted to catch the "OnClick" event for these text views.
normally, you could just create a style for the text view (make the text underlined, blue colored etc.) but i found
that this is not enough if the user is using the keys to navigate inside the view since the text views are not highlighted correctly, and also the click event doesn't get the text highlighted the way normal links are highlighted.
the solution to the problem was to create a simple class that will act in the same way as the framework Linkify class.

public class CustomLinkify {

 public static class CustomLinkSpan  extends ClickableSpan {

  private OnClickListener mListener;
  
  public void setOnClickListener(OnClickListener l){
   mListener = l;
  }
  
  @Override
  public void onClick(View widget) {
   if(mListener != null){
    mListener.onClick(widget);
   }
   if(widget instanceof TextView){
    final TextView tv = (TextView)widget;
    SpannableString s  = (SpannableString)tv.getText();
    Selection.setSelection(s, 0, 0);
   }
  } 
 }
 
 public static CustomLinkSpan addLinks(int resId, TextView v) {
  return addLinks(resId, v, null);
 }
 
 public static CustomLinkSpan addLinks(int resId, TextView v, OnClickListener l) {
  CharSequence text = v.getContext().getText(resId);
  return addLinks(text, v, l);
 }
 
 public static CustomLinkSpan addLinks(CharSequence text, TextView v) {
  return addLinks(text, v, null);
 }
 
 public static CustomLinkSpan addLinks(CharSequence text, TextView v, OnClickListener l) {
  SpannableString s = SpannableString.valueOf(text);
  CustomLinkSpan span = new CustomLinkSpan();
  span.setOnClickListener(l);
  s.setSpan(span, 0, text.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
  v.setText(s);
        v.setMovementMethod(LinkMovementMethod.getInstance());
  return span;
 }
 
}

The new class is called CustomLinkify and expose the desired functionality in a simple static method called addLinks.
the method takes the TextView target and a String that will be filled inside the TextView. (the method has another convieniet versions using resourceId or with ClickListener).
The method return value is an instance of CustomLinkSpan class, which can be used to attach the OnClick listener later on (i.e. if you don't have the listener at the time of calling the addLinks method)

i found that in android 1.6 when you click on the link, the highlight remains which is not the behavior i wanted, so i added the call to setSelection method to clear the highlighting after the click.

Friday, October 29, 2010

Being alive!



In this blog i will post my insights and knowledge about android development.
some of the stuff will be deep inside the technical details, and some other parts will be about thoughts and ideas with the android framework.

and finally, i have 2 major hopes with this blog:
  1. i will have enough self-discipline to keep this blog alive and updateed (personally, i find it hard to keep my intereset with such "social" platform) 
  2. you will enjoy ready it.