March 28, 2010

Analytics4Android update - now at version 0.15

Analytics4Android is now up to version 0.15 and we are half way to the next mile stone. It can now retrieve the Analytics Account profile feed. Next task is to parse that feed.

UI development is on hold for now. I want to implement a tabbed UI and it is currently giving me a headache. Apparently it is a bug in eclipse and/or the Android SDK/ADT.

Tomorrow will be the start of the profile feed. All the data feeds are formatted as XML Atom feeds.

Analytics4Android is an Android Application/Widget that will display (excerpts from) Google Analytics data. It is currently under active development and is in alpha state. First beta release will be version 0.50.

Queries against Google Ananlytics Data Export API with ClientLogin

Just wanted to share this little bit of info with those of you have yet to find it!

When making queries against the Google Analytics (GA) (and most likely all Google) Data Export APIs when you have authenticated using ClientLogin the authentication type sent as a header in HTTP GET.

I missed that somehow and kept getting "401 Token Invalid - Invalid AuthSub Token" when trying to retrieve the GA account profiles. My error was ofcourse sending
"Authorization: AuthSub token="
which is related to the AuthSub authentication method.

When querying for data you need to send:
"Authorization: AuthSub token="
instead.

March 27, 2010

Anaytics4Android moving forward ...

After a lot of problems getting eclipse to run with the Android Development Tools (see this post: ) I have been doing a bit of refactoring of my Analytics4Android code today. The refactoring was to streamline the way I handle Google logins and accounts to that I can re-use that code in other projects.

Thus there has been no 'feature enhancements' but the minor version number has been incremented.

Currently I am working on two fronts;

  1. Redesigning the UI to a Tabbed View.
  2. Refactoring to allow re-use of code in future, google-account-related projects.
re 1)
I have hit a snag somewhere that others have reported. I am not sure if this is a problem with the ADT or eclipse or both. The Tabbed View throws an exception in eclipse when designing/instantiating the layout.xml file. Furthermore my app throws an exception when run in both the emulator and in my HTC Hero (Android 1.5). If these are related or it is a coincidence I am not sure. Further investigations and test projects are in the making

re 2)
When I started this project I was (and still am) learning both Android development, the Google Data APIs and re-learning Java. So my ideas have not always been efficient with code re-use in mind. Some parts need to be further refined to allow code re-use better and I am constantly reviewing my code with this in mind. This leads to further re-factoring and thus less forward motion feature-wise. I hope that you will have some patience with me,

Tomorrow I will circumvent the UI issues and start concentrating on getting the Analytics Profiles upon successful authentication. I am going to (temporarily) hard code the use of my own Google and Analytics account to be able to move forward.

During the start of next week I will have a look at a few exploratory projects on how to get the Tab View part right.

During Easter the project is on hold. I am away on some Family engagements and will most likely not be bringing my laptop.

March 25, 2010

My first bug filing - Nautilus hanging on opening Trash - bug # 544859 :-)

I filed my very first bug on Lanchpad on Tuesday (23rd of March 2010). My Nautilus hangs (bug #544859) (apparently in an infinite loop) when I open Trash. It uses a lot of CPU and greys the window after about 5 secs. Only way out is to force quit the window. I haven't reproduced this fault in any other "places" than Trash.

I have filed a backtrace and it appears to be a memory allocation problem so I need to provide a valgrind log as well. I have scheduled this for tonight (sorry for lagging, Pedro & community).

This is what testing Alpha & Beta software is all about. Using (and sometimes abusing) the system and report findings back. That is how we get a new stable production version of Ubuntu/Debian/OpenSUSE/insert-your-favourite-distribution-here. It is exciting to be a part of this :-)

The developer who grabbed the bug report, Pedro, has been swift in his replies (a lot swifter than my re-replies) and I Thank You, Pedro, for your time and patience :-)

Solving my problem with Eclipse !!! [SOLVED]

Last Update 25/3 21:56 - problem solved

In my efforts to solve my problems with Eclipse and Android working on my Ubuntu Linux 10.04 lucid lynx Beta 1(and earlier Alphs 3) I decided to remove Eclipse completely using synaptic and marking eclipse and its components for "Complete Removal".

I deleted the workspaces I had lying around and I went on a hunt for any eclipse-related (config) files with # sudo find / -name *eclips*

Apart from files in ~/.mozilla/eclipse/ (permissions.sqlite, places.sqlite, places.sqlite-journal and prefs.js) that I dare not delete and some files in Trash (that I am not able to empty, as Nautilus hangs when opening Trash (bug #544859 for which I need to do a valgrind run - will do that tonight)) I seem to be free of eclipse-related files.

So I will once more try to install eclipse from the Ubuntu repositories with

# sudo apt-get install eclipse

and then pray for the best. See you at the other side ;-)

Update (13:48):

Excerpt from the above # sudo apt-get install eclipse :


0 upgraded, 59 newly installed, 0 to remove and 0 not upgraded.
Need to get 230MB of archives.
After this operation, 361MB of additional disk space will be used.

Good thing that the University 'net connection is behaving today - doing from ~180 KBytes/s and upwards :-)

Update (13:53)
Well. Still having the same problems. Sigh. Eclipse looks for https://dl-ssl.google.com/android/eclipse/ which it does not find. Now what?

Update (21:56)
It seems that there was already bug filed in Launchpad: eclipse unable to 'install new software' (bug #541482). Somehow I just missed it :-s

It is a problem with the network stack, and if you force java to use the IPv4 stack by adding the following to your eclipse (when starting it):


-vmargs -Djava.net.preferIPv4Stack=true

things are back to normal. Great! Problem Solved!

PS.
thus having the line


eclipse -vmargs -Djava.net.preferIPv4Stack=true

in the launcher does the trick!

March 24, 2010

Backup for (Ubuntu) Linux

During all my toils of getting my development machine back up working (laptop using Eclipse to do a little Android development) I have been doing a lot of backups. And have had to struggle with it.

So where are the easy backup solutions for (Ubuntu) Linux lurking about? I need to do a backup to (and restore from) external media CDs or DVDs, preferably RWs. Which software handles that easily including blanking said RW medias, including DVD+RWs. And preferably is able to do multi-volume backups.

At this time I do not have a set backup routine for my pictures, mail, videos, etc. I do use Ubuntu One for some things but am limited to the free version and thus only 2 GB. So it is basically Ad Hoc backup for me.

Anybody have any good backup solutions? Please post in comments! (comments are no longer moderated in new (< 14 day old) posts)

March 23, 2010

Problems getting ready for Ubuntu 10.04 lucid lynx beta 1

For several reasons I have decided to move to Ubuntu 10.04 lucid lynx beta 1 from the alpha 3 I am running at the moment.

I am keeping my /home partition while wiping my / partition. Most of this morning has gone with getting the beta 1, writing it to disk and backing up my /home. I found a spare DVD+RW disc to put the backup on.

But I have been fighting with Ubuntu to format/blank this disc and getting brasero to accept it. I have yet to find a way. I have tried the dvd+rw-format utility but to no avail. If this is due to me running alpha software i am not sure, but that's the state I am in at the moment.

I finally found a fresh, blank DVD-RW disc to hold the backup and I'm writing this at the moment.

So I wasted the morning, hopefully things will turn out for the better. I filed a bug on Nautilus hanging when opening Trash in alpha 3 this morning. Let's see if that is present in beta 1 as well.

Analytics 4 Android development has been on hold for the duration of this. Let's hope I get back on track.

March 22, 2010

Problems with Eclipse and ADT (Android Development Tools)

I am having a few problems since my upgrade to Ubuntu 10.04 (lucid lynx), working in Eclipse. I cannot install the Android Development Tools (ADT). I cannot even get in contact with the Eclipse repositories. I have tried both the Ubuntu package of Eclipse and the .tar ball from eclipse.org. It makes no difference.

I seem to have no other difficulties with my lucid lynx, other than that WINE does not have a lucid lynx ppa (as far as I can see). But I am still wondering if it is something related to lucid lynx that makes me unable to get to the Eclipse and ADT repositories. So I am downloading an ISO image of Ubuntu 9.10 Karmic Koala and will run that in VirtualBox. Unfortunately the network at my university is quite slow today. I might actually get better transfer speeds through my cell phone, but I need to keep my data usage down - I only have 300 MB/month as I am trying to cut costs.

Googling bug reports on this I have found some on Eclipse crashing on (an earlier) lucid lynx alpha due to xulrunner being buggy. This was connected to the auto-completion feature in Eclipse. If this is a related bug, I am not sure.

I will update this post as I get more info. I am still downloading karmic koala.

UPDATE (12:05):
I have downloaded the ADT 0.9.6 .zip file but the install fails due to missing org.eclipse.wst.sse.core - so I still need to get the Eclipse part right.

UPDATE (23/3 22:15 CET)
I reinstalled Ubuntu with lucid lynx beta 1. Still no go. I cannot even get eclipse to access its own update repositories. Veeeery frustrating!

March 19, 2010

Installing Ubuntu 10.04 Lucid Lynx Alpha 3 on the laptop

While the Ubuntu 10.04 Lucid Lynx Beta 1 release is yet to happen I decided to go with the Alpha 3. I could have waited for the Beta 1 which was originally scheduled for release yesterday but apparently is supposed to be released today, but I felt that I would loose yet another day not being able to work on Analytics 4 Android.

So I jumped in at the deep end and installed Alpha 3.

(all photos taken with an HTC Hero mobile phone
apologies for the quality.)

I installed the standard version without any manual selection of options, etc.

The system started booting from the live CD

The graphic install tool (looks much like the 9.10 Karmic Koala version) guided me through installation (pictures missing). As this machine is a dual boot I had to modify the partition scheme manually but apart from that everything else was default setup.

Finally the process was done and the machine was rebooted:
GRUB loads and displays the above menu for 10 seconds. If Ubuntu was installed on a fresh drive without any other Operating Systems, this boot menu would have been hidden.

The "Windows NT/2000/XP (on /dev/sda1)" is the laptop manufacturers recovery partition and the "Microsoft Windows XP Home Edition (on /dev/sda2)" is the Windows OS that came with the machine. For various reasons we need this OS in our family and thus it stayed on the hard drive.


When you log in to your Lucid Lynx Alpha 3, this is how your desktop looks like. For the most part it looks like Karmic Koala, maybe with the exception of the "me" menu next to the power symbol (log on/off menu) in the top right corner:

This menu gives access to the social media, like twitter, FaceBook and other chat accounts as well as Ubuntu One.

I like to modify my desktop so that I get a little more desktop real estate, so I usually remove the bottom panel. To retain the same info on just one panel, I exchange the Main Menu Bar for a Main Menu and add the Window Selector, Trash Can and Workspace Switcher from the lower panel to the upper panel. I also add the System Monitor with all six meters showing (CPU, Memory, Network, Swap, Load Avg and Disk).

The theme and background pictures in this release seem to be the old Karmic ones, but it was only recently that the new themes and backgrounds was released:

As my laptop's built-in wifi is with a Broadcomm chip set that is not supported out-of-the-box (because of copyright policies) I had to install this driver through a "wired" net connection, in this case my HTC Hero Android based mobile phone, which was recognized out-of-the-box. Having done this and rebooted I could do a apt-get update/apt-get upgrade which in my case was 528 packages demanding about 240 MBytes downloaded.

I now need to add the extra packages I need. I will return in a few days with an update. If the Beta 1 is released later today I will re-install that (but keeping my /home) during the weekend and post that story.

March 18, 2010

Switching to Ubuntu 10.04 Lucid Lynx Alpha 3

As I wrote yesterday, my laptop is running an Ubuntu 9.10 that has basically been around since 7.10 or 8.04 and has been incrementally upgraded through 8.10, 9.04 and lately 9.10. And I have installed and removed a number of programs. Which all means that there must be residual files, that are no longer needed.

The laptop is not a new machine as you can imagine. The battery is getting closer to the end of it\s life cycle as it has maybe 20-25% of it's capacity left giving about 20 mins of standard work (no heavy I/O esp optical drive, not full CPU load).


The hard disc drive is a mere 60 GB and my Ubuntu co-habits with a Windows XP installation as well as the pre-load/recovery partition. All-in-all this leaves just under 20 GB for Ubuntu. As I have 1.5 GB of memory onboard I have allocated just over 1.5 GB for the swap partition so that it is possible to suspend to disc. So that leaves about 18 GB for both the / and /home partitions. This is currently split 6/12 GB which I think I will keep for the time being.

I need the following software packages for my everyday use:
  • Internet
    • Firefox
    • Chromium
  • Office/productivity
    • Evolution
    • OpenOffice
  • Programming
    • Eclipse
    • Android SDK
In addition I need the following programs often enough that I am going to put them on my laptop:
  • Graphics
    • GIMP
  • Internet
    • Skype
    • Empathy
    • Ubuntu One
    • XChat
  • Sound & Video
    • Gnome Subtitles
    • NtEd or GNU Denemo
    • OpenShot Video Editor
    • Pitivi Video Editor
  • System Tools
    • Virtual Box
    • Wine
    • Test Drive
Luckily a number of these programmes are already present on the standard Lucid Lynx installation:
  • Internet
    • Empathy
    • Firefox
    • Ubuntu One
  • Office/Productivity
    • OpenOffice
    • Evolution
  •  Sound & Video
    • Pitivi Video Editor
Most of the remaining programmes are available as packages, only the Android SDK is not.

I have been wondering whether I should install Eclipse as a .deb package or from the .tar.gz-ball from the Eclipse web site. I think I will end up installing the Ubuntu .deb package, leaving only the Android SDK to be installed from .tar.gz

I also plan to remove the games.

I am writing this blog on the Live CD of Ubuntu 10.04 Lucid Lynx Alpha 3 and while I have only used it briefly it seems to be working reasonably well.

Before I am going to re/install, I need to make a backup of my important files from my /home.

I will return with a review of Lucid Lynx in a couple of weeks.

March 17, 2010

Problems with Eclipse IDE, Android SDK hindering the development of Analytics 4 Android ...

I am currently experiencing problems that might have roots in problems with my Eclipse IDE and the installed Android SDK (which might actually have r4, not r5, for which Eclipse had downloaded its r5 parts).

So I have wasted valuable time trying to debug the new UI for Analytics 4 Android. So no real advancement on that front. I have downloaded and installed the new SDK r5 and Eclipse is now downloading and installing the new parts for this.

But I am seriously wondering, Should I just back up the important parts of my /home partition and then proceed to install the latest Lucid Lynx Alpha release ... It would have the advantage of getting rid of old files (the current installation has roots in 7.10 and has just been incrementally been upgraded).

So while I am working tonight I will be thinking about whether to wait for the first Beta or just jump straight in now.

Anyhow the Analytics 4 Android projects page is now online at kaddu.dk

Hope You have a good day!

March 04, 2010

Google Analytics Application/Widget for Android

Last Update:  March 17th, 2010 9:42 CET

I have started work on an Application/Widget that can retrieve and display data from Google Analytics, for mobile phones running on the Android platform.

This will be my first application and Widget for Android and as such it is both a learning as well as a production project as the outcome should be a usable Application/Widget.

As work is still in its very early stages and I need to research both Android development and how to use the Google Data API from Java/Android there is not much to show yet. I will put up an article on our web site, when there is more to show.

Update March 12th:
I now get an authorization token when providing my own correct google login. Failure is detected and parsed but not parsed properly and user is not informed. User info is probably going to be delayed - I'd rather try to get some data first ;-)

For progress/project status please look further down.

Update March 17th:
The past few days nothing (seems to have) happened. Partly due to other engagements, work etc. Partly because I started fiddling with the UI and that broke something, which I could not figure out. I have been writing a few lines of code which will be the start of managing Accounts and Profiles.

I have rethought the UI and the way the App/Widget will be set up, including the way it is set up in my IDE (Eclipse). I have also decided to change the name of the App/Widget, which was a working title anyway. Hopefully later today I will have put up a web page on the App/Widget with the new name. I will also change the way I update the info. So far I have just kept editing this post. From today I will make a new post with the changes only and then put the status on the web page. When the web page is ready, I will post the URL here.

Status: Version 0.10 - alpha state

Next mile stone: V. 0.20 - Account Query (request profiles)

To Do (anticipated version):

  • Authenticate user (V. 0.10 - DONE!)
  • Account Query (request profiles) (V. 0.20)
  • Report Query (V. 0.30)
  • Widget setup (V. 0.40)
  • Widget display (V. 0.50)

Progress:

March 12th, 2010
Version 0.10

  • Authentication of Google Analytics Account code
    • HttpRequest code based upon a post by Rich Stern : http://blog.richstern.com/?p=32
    • Google now authenticates my personal account and an authorization token is returned.
    • Still need to parse the HttpResponse properly
      • Determine response from Google (DONE)
      • Inform user of failure/success (showing dialog upon Authorization already)
      • Save authorization token on succes (DONE)
    • ... time to head for the second mile stone! Whoop!

March 12th, 2010
Version 0.05
  • Authentication of Google Analytics Account code
    • HttpRequest code based upon a post by Rich Stern : http://blog.richstern.com/?p=32
    • Google now authenticates my personal account and an authorization token is returned.
    • Still need to parse the HttpResponse properly
      • Determine response from Google (partly done)
      • Inform user of (possible) failure
      • Save authorization token on succes (DONE)
    • ... but I am half way to the first mile stone! Yay!
March 11th, 2010
Version 0.04
  • Authentication of Google Analytics Account code
    • based upen code from a post by Rich Stern : http://blog.richstern.com/?p=32
    • Google now authenticates my personal account and an authorization token is returned.
    • Still need to parse the HttpResponse properly
      • Determine response from Google
      • Inform user of (possible) failure
      • Save authorization token on succes
    • ... but I am almost half way to the first mile stone! Yay!
March 10th, 2010:
Version 0.03
  • code for reading UI contenst Username and Password added
  • Authentication of Google Analytics Account code started
March 4th, 2010:
Version 0.01
  • Project started.
  • UI for adding accounts started
  • No working code yet