Thursday, December 2, 2010

WhereAmI Available for Free in Android market!


Finally WhereAmI App, the application that lets you view your location (GPS or network based) and post a wall  message in your facebook account with your location and a link to google maps is available for free in Android market!!


Tell your friends where they can find you or update a meeting point on the go!

No  more need to wait for all your friends standing in a place, just move to another one and tell them your new location!

If you're interested, you can download it using this QR Code:


And if you're in the mood,  please reccomend it on facebook (which will be very appreciated)!


Thanks!

Friday, October 22, 2010

Using Facebook SDK in Android Applications

Howto publish images and links with Android in your Facebook Wall using stream.publish method from Facebook SDK:

1st: Download Facebook SDK using git. http://github.com/facebook/facebook-android-sdk
(highly recommended to play a little with Example.java and other methods)

2nd: create a new project from Example.java

3rd: create a Bundle with all the parameters to post and publish it using SampleDialogListener
             Bundle parameters = new Bundle();

               parameters.putString("method","stream.publish");
               String mylink="http://kinesina.blogspot.com";
                String myimagelink="http://kinesina.blogspot.com";
               String attachments = "{
                                   \"name\":\"Location Here\",
                                   \"href\":\""+mylink + "\",
                                   \"caption\":\"Click to view in Google Maps\",
                                   \"media\":[{
                                           \"type\":\"image\",
                                           \"src\": \"http://myimgurl\",
                                           \"href\": \""+myimagelink+"\"}]}";

                parameters.putString("attachment", attachments);
                mFacebook.dialog(Example.this, "stream.publish", parameters, new SampleDialogListener()) ;

4th: Using LocationManager and Google Maps API (which I will explain soon), you can post your location and a link to google maps in your facebook wall! 


If you liked this app (WhereAmI) you can download it from Android Market for free, or mark/like it on facebook (available soon).

Hope you like it, 'cause it is gonna be my first app published in Android Market!

Tuesday, October 19, 2010

Android SDK for Eclipse running in Ubuntu 10.10

After upgrading my Ubuntu to 10.10, I got the same error as explained in http://sonalsantan.blogspot.com/2010/10/eclipse-adt-plugin-on-ubuntu-1010-after.html


"I found that my Eclipse Android Development Toolkit plugin stopped working. The Eclipse Help>Installation Details Menu would list ADT under Installed Software Tab. However, neither the Features Tab nor the Plug-ins Tab would list ADT."


Also, the installation of  gef would fail due to the lack of some packages, solution found here http://ubuntuforums.org/showthread.php?t=1305691


Finally, in order to get Eclipse working with ADT plugin in Ubuntu 10.10, I did the following steps:


1. Exit eclipse if running
2. Delete ~/.eclipse/org.eclipse.platform_(your platform)
3. Start eclipse
4. Open Help > Install New Software
5. Add this sites:
      5.1 http://download.eclipse.org/datatools/updates
      5.2 http://download.eclipse.org/webtools/updates
      5.3 http://download.eclipse.org/modeling/emf/updates
6. Install GEF Plugin (previously add the site http://download.eclipse.org/tools/gef/updates/releases)
7. Install ADT Plugin (previously add the site https://dl-ssl.google.com/android.eclipse



Monday, September 27, 2010

Seth Goding on Standing Out

Here you have both a serious (actually, not that much) and a funny talk from Seth Goding.

First: the funny one (things that are just broken)

Seth Godin at Gel 2006 from Gel Conference on Vimeo.


Second one: how to stand out and do remarkable things.

Sunday, August 15, 2010

Working with Android. Chapter 2: Intent Class

In android, it is possible to open a webpage (or another application) from your application, which can be accomplished using the class Intent. Intent is a very useful class, which will allow you to perform a lot of different operations such as dial a phone,  install new packages, view your contacts list, pick data from other applications and so on. An intent is an abstract description of an operation to be performed. Used with startActivity launches an application, used with startService makes it possible to communicate with a background service.

 In this post, three examples of Intent class are given for different operations.


1. Opening a Webpage with ACTION_VIEW:
The ACTION_VIEW intent displays data to the user.  For example, when used on a contacts entry it will view the entry; when used on a mailto: URI it will bring up a compose window filled with the information supplied by the URI; when used with a tel: URI will invoke the dialer (more information on URI here http://developer.android.com/reference/android/net/Uri.html)

       String url = "http://www.google.com"; //define url to load
       Intent i = new Intent(Intent.ACTION_VIEW); //create an Intent.ACTION_VIEW
       Uri u = Uri.parse(url); //creates the Uri object
       i.setData(u);  //
Set the data this intent is operating on.
       try {
                 startActivity(i); //
Launch a new activity
       } catch (ActivityNotFoundException e){ //in case something did not work
                 Toast toast = Toast.makeText(context, "Browser not found.", Toast.LENGTH_SHORT);
       }
As usual, you will have to add internet permission to your manifest.xml:
     

2. Calling another Application from your main application with startActivityForResult:
The function startActivityForResult will launch an activity for which you would like a result when it finished. When this activity exits, your onActivityResult() method will be called with the given requestCode.

      int ACTIVITY_INVOKE = 0;
      Intent i = new Intent(); //creates a new intent
      i.setClassName("com.android.app2","com.android.app2.Application2"); //specify app2
      startActivityForResult(i, ACTIVITY_INVOKE);

setClassName(String packageName, String className) allows you to specify the application package name and class name of the application you want to call (which has to be already installed in your phone).  The Package name corresponds to the directory list in /src/ and your class name is . (without the .java extension!).
 startActivityForResult(Intent intent, int RequestCode) will call the application specified with i.setClassName and call the method onActivityResult() with the given requestCode when it finished.
Finally, it is possible to override the onActivityResult method to fit your needs:

      @Override
      public void onActivityResult(int requestCode, int resultCode, Intent data) //when the activity is finished
      {
            if(resultCode==0) { //ok
                  Toast toast = Toast.makeText(this, "All ok", Toast.LENGTH_SHORT);
                  toast.show();
            } else { //something went wrong
                  Toast toast = Toast.makeText(this, "Firma no aceptada", Toast.LENGTH_SHORT);
                  toast.show();
            }
      }

3. Dialing a phone with ACTION_DIAL
Using startActivity and  setAction, it is possible to dial a phone (ACTION_DIAL) or to make a call (ACTION_CALL):

      Intent i = new Intent();
      i.setAction(Intent.ACTION_DIAL); //set action to be performed
      i.setData(Uri.parse("tel:+34000000000")); //specify the phone number
     startActivity(i); //starts activity


Saturday, July 17, 2010

homeopathy: how to dilute critical thinking until there's no thinking at all

Homeopathy is a pseudoscience which operates on the principle that by diluting a remedy in water, you can make it more effective. Therefore, if smaller concentrations of the "remedy" are achieved, then it just gets more "effective", fact that is called the Law of Infinitesimals.

There is a very common remedy in homeopathy called Oscillococcinum, which my mother has always wanted me to try but never succeeded. This remedy is prepared by diluting freeze duck heart and liver in a concentration 1 part in 100200 (which is a 1 followed by 400 zeros). It may be known that the laws of chemistry state that there is a limit to how far one can dilute a solution (about 1 part in 10012 ) which is far greater than oscillococcinum, but this is not considered a problem in homeopathy because of this belief:

"By vigorously shaking the solution, the water will retain a kind of memory or essence of the active ingredient. Thus, even if none of the active ingredient remains in the water, the water will remember it was there and give the same effect".

¡What the hell?!

I would like to show you two visions of homeopathy that I recently found and which I totally agree with.


And finally, another James Randi's talk, that I am sure you will enjoy.


have fun!