Hi,

I am able to access the CCR records using client login but I could not
do the same from android. I guess I am missing some saxparser
libraries.
Here is the code that I am using. I am using the same code that was
used in the example code provided by google for client login.
Can someone let me know where I am going wrong or what I am missing.

                        GoogleService myService = new GoogleService(
                        "health","My Application");
                        myService.setUserCredentials("username", "password");

                        // Get a list of all entries
                        URL metafeedUrl = new 
URL("https://www.google.com/health/feeds/
profile/list");
                        System.out.println("Getting Health profile 
entries...\n");
                        Feed resultFeed = myService.getFeed(metafeedUrl, 
Feed.class);
                        List<Entry> entries = resultFeed.getEntries();
                        for(int i=0; i<entries.size(); i++) {
                                Entry entry = entries.get(i);
                                System.out.println("\t" + 
entry.getTitle().getPlainText());
                                profilesString += 
entry.getTitle().getPlainText()+ "\n";
                        }
And here are my referenced libraries.
gdata-core-1.0.jar
gdata-client-meta-1.0.jar
gdata-client-1.0.jar
gdata-health-meta-2.0.jar
gdata-health-2.0.jar
gdata-media-1.0.jar
jsr305.jar
google-collect-1.0-rc1.jar

And this is the error log that I get.
I/dalvikvm(10388): Could not find method
javax.xml.parsers.SAXParserFactory.getSchema, referenced from method
com.google.gdata.util.common.xml.parsing.SecureGenericXMLFactory
$SecureSAXParserFactory.getSchema
W/dalvikvm(10388): VFY: unable to resolve virtual method 12342: Ljavax/
xml/parsers/SAXParserFactory;.getSchema ()Ljavax/xml/validation/
Schema;
D/dalvikvm(10388): VFY: replacing opcode 0x6e at 0x0002
D/dalvikvm(10388): Making a copy of Lcom/google/gdata/util/common/xml/
parsing/SecureGenericXMLFactory$SecureSAXParserFactory;.getSchema code
(32 bytes)
W/dalvikvm(10388): VFY: unable to find class referenced in signature
(Ljavax/xml/validation/Schema;)
I/dalvikvm(10388): Could not find method
javax.xml.parsers.SAXParserFactory.setSchema, referenced from method
com.google.gdata.util.common.xml.parsing.SecureGenericXMLFactory
$SecureSAXParserFactory.setSchema
W/dalvikvm(10388): VFY: unable to resolve virtual method 12350: Ljavax/
xml/parsers/SAXParserFactory;.setSchema (Ljavax/xml/validation/
Schema;)V
D/dalvikvm(10388): VFY: replacing opcode 0x6e at 0x0002
D/dalvikvm(10388): Making a copy of Lcom/google/gdata/util/common/xml/
parsing/SecureGenericXMLFactory$SecureSAXParserFactory;.setSchema code
(28 bytes)
W/XmlParser(10388): javax.xml.parsers.ParserConfigurationException:
org.xml.sax.SAXNotRecognizedException: 
http://xml.org/sax/features/external-parameter-entities
W/XmlParser(10388): javax.xml.parsers.ParserConfigurationException:
org.xml.sax.SAXNotRecognizedException: 
http://xml.org/sax/features/external-parameter-entities
W/XmlParser(10388):     at
org.apache.harmony.xml.parsers.SAXParserFactoryImpl.newSAXParser(SAXParserFactoryImpl.java:
84)
W/XmlParser(10388):     at
com.google.gdata.util.XmlParser.parse(XmlParser.java:682)
W/XmlParser(10388):     at
com.google.gdata.util.XmlParser.parse(XmlParser.java:576)
W/XmlParser(10388):     at
com.google.gdata.data.BaseFeed.parseAtom(BaseFeed.java:867)
W/XmlParser(10388):     at
com.google.gdata.wireformats.input.AtomDataParser.parse(AtomDataParser.java:
68)
W/XmlParser(10388):     at
com.google.gdata.wireformats.input.AtomDataParser.parse(AtomDataParser.java:
39)
W/XmlParser(10388):     at
com.google.gdata.wireformats.input.CharacterParser.parse(CharacterParser.java:
100)
W/XmlParser(10388):     at
com.google.gdata.wireformats.input.XmlInputParser.parse(XmlInputParser.java:
52)
W/XmlParser(10388):     at
com.google.gdata.wireformats.input.AtomDualParser.parse(AtomDualParser.java:
66)
W/XmlParser(10388):     at
com.google.gdata.wireformats.input.AtomDualParser.parse(AtomDualParser.java:
34)
W/XmlParser(10388):     at
com.google.gdata.client.Service.parseResponseData(Service.java:2165)
W/XmlParser(10388):     at
com.google.gdata.client.Service.parseResponseData(Service.java:2098)
W/XmlParser(10388):     at
com.google.gdata.client.Service.getFeed(Service.java:1136)
W/XmlParser(10388):     at
com.google.gdata.client.Service.getFeed(Service.java:998)
W/XmlParser(10388):     at
com.google.gdata.client.GoogleService.getFeed(GoogleService.java:631)
W/XmlParser(10388):     at
com.google.gdata.client.Service.getFeed(Service.java:1017)
W/XmlParser(10388):     at
gh.com.achie.test.Health.getProfilesForUI(Health.java:60)
W/XmlParser(10388):     at gh.com.achie.test.Main.onClick(Main.java:33)
W/XmlParser(10388):     at android.view.View.performClick(View.java:2364)
W/XmlParser(10388):     at android.view.View.onTouchEvent(View.java:4179)
W/XmlParser(10388):     at
android.widget.TextView.onTouchEvent(TextView.java:6541)
W/XmlParser(10388):     at android.view.View.dispatchTouchEvent(View.java:
3709)
W/XmlParser(10388):     at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
W/XmlParser(10388):     at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
W/XmlParser(10388):     at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
W/XmlParser(10388):     at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
W/XmlParser(10388):     at com.android.internal.policy.impl.PhoneWindow
$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)
W/XmlParser(10388):     at
com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:
1107)
W/XmlParser(10388):     at
android.app.Activity.dispatchTouchEvent(Activity.java:2061)
W/XmlParser(10388):     at com.android.internal.policy.impl.PhoneWindow
$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)
W/XmlParser(10388):     at
android.view.ViewRoot.handleMessage(ViewRoot.java:1691)
W/XmlParser(10388):     at
android.os.Handler.dispatchMessage(Handler.java:99)
W/XmlParser(10388):     at android.os.Looper.loop(Looper.java:123)
W/XmlParser(10388):     at
android.app.ActivityThread.main(ActivityThread.java:4363)
W/XmlParser(10388):     at java.lang.reflect.Method.invokeNative(Native
Method)
W/XmlParser(10388):     at java.lang.reflect.Method.invoke(Method.java:
521)
W/XmlParser(10388):     at com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:860)
W/XmlParser(10388):     at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
W/XmlParser(10388):     at dalvik.system.NativeStart.main(Native Method)
W/System.err(10388): com.google.gdata.util.ParseException:
org.xml.sax.SAXNotRecognizedException: 
http://xml.org/sax/features/external-parameter-entities
W/System.err(10388):    at
com.google.gdata.util.XmlParser.parse(XmlParser.java:708)
W/System.err(10388):    at
com.google.gdata.util.XmlParser.parse(XmlParser.java:576)
W/System.err(10388):    at
com.google.gdata.data.BaseFeed.parseAtom(BaseFeed.java:867)
W/System.err(10388):    at
com.google.gdata.wireformats.input.AtomDataParser.parse(AtomDataParser.java:
68)
W/System.err(10388):    at
com.google.gdata.wireformats.input.AtomDataParser.parse(AtomDataParser.java:
39)
W/System.err(10388):    at
com.google.gdata.wireformats.input.CharacterParser.parse(CharacterParser.java:
100)
W/System.err(10388):    at
com.google.gdata.wireformats.input.XmlInputParser.parse(XmlInputParser.java:
52)
W/System.err(10388):    at
com.google.gdata.wireformats.input.AtomDualParser.parse(AtomDualParser.java:
66)
W/System.err(10388):    at
com.google.gdata.wireformats.input.AtomDualParser.parse(AtomDualParser.java:
34)
W/System.err(10388):    at
com.google.gdata.client.Service.parseResponseData(Service.java:2165)
W/System.err(10388):    at
com.google.gdata.client.Service.parseResponseData(Service.java:2098)
W/System.err(10388):    at
com.google.gdata.client.Service.getFeed(Service.java:1136)
W/System.err(10388):    at
com.google.gdata.client.Service.getFeed(Service.java:998)
W/System.err(10388):    at
com.google.gdata.client.GoogleService.getFeed(GoogleService.java:631)
W/System.err(10388):    at
com.google.gdata.client.Service.getFeed(Service.java:1017)
W/System.err(10388):    at
gh.com.achie.test.Health.getProfilesForUI(Health.java:60)
W/System.err(10388):    at gh.com.achie.test.Main.onClick(Main.java:33)
W/System.err(10388):    at android.view.View.performClick(View.java:
2364)
W/System.err(10388):    at android.view.View.onTouchEvent(View.java:
4179)
W/System.err(10388):    at
android.widget.TextView.onTouchEvent(TextView.java:6541)
W/System.err(10388):    at
android.view.View.dispatchTouchEvent(View.java:3709)
W/System.err(10388):    at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
W/System.err(10388):    at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
W/System.err(10388):    at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
W/System.err(10388):    at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
W/System.err(10388):    at com.android.internal.policy.impl.PhoneWindow
$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)
W/System.err(10388):    at
com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:
1107)
W/System.err(10388):    at
android.app.Activity.dispatchTouchEvent(Activity.java:2061)
W/System.err(10388):    at com.android.internal.policy.impl.PhoneWindow
$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)
W/System.err(10388):    at
android.view.ViewRoot.handleMessage(ViewRoot.java:1691)
W/System.err(10388):    at
android.os.Handler.dispatchMessage(Handler.java:99)
W/System.err(10388):    at android.os.Looper.loop(Looper.java:123)
W/System.err(10388):    at
android.app.ActivityThread.main(ActivityThread.java:4363)
W/System.err(10388):    at java.lang.reflect.Method.invokeNative(Native
Method)
W/System.err(10388):    at java.lang.reflect.Method.invoke(Method.java:
521)
W/System.err(10388):    at com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:860)
W/System.err(10388):    at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
W/System.err(10388):    at dalvik.system.NativeStart.main(Native Method)
W/System.err(10388): Caused by:
javax.xml.parsers.ParserConfigurationException:
org.xml.sax.SAXNotRecognizedException: 
http://xml.org/sax/features/external-parameter-entities
W/System.err(10388):    at
org.apache.harmony.xml.parsers.SAXParserFactoryImpl.newSAXParser(SAXParserFactoryImpl.java:
84)
W/System.err(10388):    at
com.google.gdata.util.XmlParser.parse(XmlParser.java:682)
W/System.err(10388):    ... 37 more

Thank you,
Achie.

On Jun 11, 9:31 am, Megha Bapat <[email protected]> wrote:
> Thanx for the reply but i just want to know how to access Google Health
> profile of the authenticated user from android. What I want
> to do is to let the users access their Google Health Profile and
> modify it if they want to.So i am done with the authenticated part but i am
> stuck for the access and modification part . Please if possible guide me
> through this...
>
> Regards ,
> Megha
>
> On Thu, Jun 10, 2010 at 4:18 AM, Achie <[email protected]> wrote:
> > Can you guys tell what the dependencies are for integrating google
> > health on android.
>
> > Megha, I am not using Client Login as Google specifically asks us to
> > not do it. But you should be able to do it on android 1.5 also since
> > they do not use any android specific code and both of them support
> > Java 1.5.
>
> > Thank you
>
> > On Jun 8, 1:10 am, Idoya Olalde <[email protected]> wrote:
> > > Hi,
>
> > > Each user can have more than one profile. Yo have to obtain the list of
> > > profiles and select the one you want:
>
> > > Feed profileListFeed = healthService.getFeed(new
> > > URL("https://www.google.com/health/feeds/profile/list";, Feed.class);
> > > List<Entry> entries = profileListFeed.getEntries();
> > > for (Entry profileListEntry : entries) {
> > >   System.out.println("Profile name: " +
> > > profileListEntry.getTitle().getPlainText());
> > >   System.out.println("Profile id: " +
> > profileListEntry.getPlainTextContent());
>
> > > }
>
> > > // Select the user's first profile
> > > String firstProfileID = entries.get(0).getPlainTextContent();
>
> > > //and then you can make the request to the url
> > > "https://www.google.com/health/feeds/profile/ui/"; + firstProfileID;
>
> > > Here you have more information:
> >http://code.google.com/intl/es-ES/apis/health/docs/2.0/developers_gui...
>
> > > Good luck!
>
> > > 2010/6/8 Megha Bapat <[email protected]>
>
> > > > hello,
> > > >       I am building an application for google health using android as
> > my
> > > > final year project.
> > > > So far i have been able to authenticate the account using Clientlogin.
> > I
> > > > need to retrieve the google health profile related to this token.
> > > > How can i do this? please guide me.... is gdata library supported by
> > > > android 1.5 or should i switch to android 1.6 for making use of this
> > > > library.
> > > > Please help its urgent as my submission date is very near.
> > > >                                      Thanking you.....in adv..
>
> > > > --
> > > > You received this message because you are subscribed to the Google
> > Groups
> > > > "Google Health Developers" group.
> > > > To post to this group, send email to
> > > > [email protected].
> > > > To unsubscribe from this group, send email to
> > > > [email protected]<googlehealthdevelopers%[email protected]>
> > <googlehealthdevelopers%[email protected]<googlehealthdevelopers%[email protected]>
>
> > > > .
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/googlehealthdevelopers?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google Health Developers" group.
> > To post to this group, send email to
> > [email protected].
> > To unsubscribe from this group, send email to
> > [email protected]<googlehealthdevelopers%[email protected]>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/googlehealthdevelopers?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Health Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/googlehealthdevelopers?hl=en.

Reply via email to