Access to Google Analytics

Put your problem here if it does not fit any of the other categories.

Access to Google Analytics

Postby bshaftoe » Wed Apr 07, 2010 7:00 pm

Hello, guys!

First time poster. I've got a small problem making a small test application with which I want to access a google analytics account and show some of the data being collected there. When following this doc from google:

http://code.google.com/intl/es-ES/apis/ ... aJava.html

There is the following Java code:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. AccountFeed accountFeed = analyticsService.getFeed(queryUrl, AccountFeed.class);
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


There, the program halts and returns an Exception ParserConfigurationException, with a message in the LogCat saying something like "unable to resolve method 16080: Ljavax/xml/parsers/SAXParserFactory; .getSchema ()Ljavax/xml/validation/Schema".

I guess that the javax included in Android doesn't have the same methods than the one in a usual java environment. What can I do?
bshaftoe
Freshman
Freshman
 
Posts: 3
Joined: Wed Apr 07, 2010 6:06 pm
Location: Oviedo, Spain... for now

Top

Postby ivans » Thu Apr 08, 2010 8:20 am

I have the same problem with this line:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. DocumentListFeed feed = client.getFeed(feedUri, DocumentListFeed.class);
Parsed in 0.030 seconds, using GeSHi 1.0.8.4


Did you find a solution?

Thanks!
ivans
Freshman
Freshman
 
Posts: 4
Joined: Thu Apr 08, 2010 8:16 am

Postby bshaftoe » Thu Apr 08, 2010 8:42 am

Nope. All I've been done (until now) is realize than that getSchema() method is not present in the SAX class in Android. I guess I'll have to parse the XML manually. :cry:
bshaftoe
Freshman
Freshman
 
Posts: 3
Joined: Wed Apr 07, 2010 6:06 pm
Location: Oviedo, Spain... for now

Postby ivans » Thu Apr 08, 2010 9:12 am

I have just had some little progress by trying an older version: it didn't work with gdata-src.java-1.41.1.zip version but it works with gdata-src.java-1.39.1.zip.

At least that one query I tried now works! I hope this helps you too and that there aren't any other roadblocks when I try something a bit more complex than a simple query.
ivans
Freshman
Freshman
 
Posts: 4
Joined: Thu Apr 08, 2010 8:16 am

Postby bshaftoe » Thu Apr 08, 2010 11:36 am

ivans wrote:I have just had some little progress by trying an older version: it didn't work with gdata-src.java-1.41.1.zip version but it works with gdata-src.java-1.39.1.zip.

At least that one query I tried now works! I hope this helps you too and that there aren't any other roadblocks when I try something a bit more complex than a simple query.


Mmm... interesting. I will try it. It's a nuisance, having to test the versions to see which one works, but it's better than doing it manually. :)

Thanks!
bshaftoe
Freshman
Freshman
 
Posts: 3
Joined: Wed Apr 07, 2010 6:06 pm
Location: Oviedo, Spain... for now

Postby ivans » Thu Apr 08, 2010 2:08 pm

After some more playing around i got to problems similar to the ones described here: http://code.google.com/p/gdata-java-cli ... ail?id=221

Have you considered using the google docs api that was part of android but then removed? It is undocumented but apps like My Tracks and some others are using it to communicate with google documents.
ivans
Freshman
Freshman
 
Posts: 4
Joined: Thu Apr 08, 2010 8:16 am

Top

Postby ivans » Thu Apr 08, 2010 2:20 pm

To fix my last exception i moved to gdata.java-1.13.0 (the earliest version available for download). Hope there will be no more exceptions with this version.

EDIT: To correct myself, the version with the oldest gdata java api works on the 1.6 emulator but not on my device, on a real device I am now getting: WARN/XmlParser(6402): org.apache.harmony.xml.ExpatParser$ParseException: At line 2, column 4: not well-formed (invalid token). This happens when trying to create a new google document, the creation works (the document gets created) but there is probably some exception parsing the response.
ivans
Freshman
Freshman
 
Posts: 4
Joined: Thu Apr 08, 2010 8:16 am

Anyone got this working yet?

Postby andy_spoo » Sun May 02, 2010 1:31 pm

Hi.

Has anyone got this to completely work yet?

Which libraries to use?

And anyone got some example code that actually works??

Cheers.
If you pay peanuts then expect moneys.
andy_spoo
Freshman
Freshman
 
Posts: 5
Joined: Wed Aug 12, 2009 6:25 pm

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Google Feedfetcher and 17 guests