problems with using my own data

179 views
Skip to first unread message

Liu Yinqiu

unread,
Aug 3, 2010, 10:15:34 PM8/3/10
to mixare-development
Hello,
I'm very interested in mixare and I'm working on it. Following the
DisplayYourOwnData I create a JSON file in my sdcard and add the
intent to the launcher app.Like this
Intent i = new Intent();
i.setAction(Intent.ACTION_VIEW);
i.setDataAndType(Uri.parse("content://com.android.htmlfileprovider/
sdcard/uestc.php"), "application/mixare-json");
startActivity(i);

But it still tells me that "ERROR:java.lang.NullPointerException". My
JSON file uestc.php is below:
{
"status": "OK",
"num_results": 4,
"results": [
{
"id": "01",
"lat": "30.74889",
"lng": "103.92472",
"elevation": "541",
"title": "主楼",
"has_detail_page": "1",
"webpage": ""
},
{
"id": "02",
"lat": "30.75278",
"lng": "103.92611",
"elevation": "540",
"title": "图书馆",
"has_detail_page": "0",
"webpage": ""
},
{
"id": "03",
"lat": "30.75389",
"lng": "103.93056",
"elevation": "540",
"title": "教学楼",
"has_detail_page": "0",
"webpage": ""
},
{
"id": "04",
"lat": "30.75111",
"lng": "103.9175",
"elevation": "340",
"title": "体育场",
"has_detail_page": "0",
"webpage": ""
}
]
}

This has troubled me for a long time. Have I missed any key steps?
Anyone can help me?

Thanks in advance!

Hannes Boran

unread,
Aug 4, 2010, 10:01:03 AM8/4/10
to mixare-development
Hi,
There was a bug in mixare, introduced with the last patch.
I did some reorganization of the json data processing to get it more
failsafe on crappy input data. Look at http://github.com/hanbo/mixare
it should work now.

Perhaps Daniele can integrade my changes into the main trunk.

One bug still exists: Twitter is currently not working because the
"geo" field of the json response is always null.
eg http://search.twitter.com/search.json?geocode=40.757929,-73.985506,25km
Who knows why? Miriam?

-Hannes

Miriam Fostini

unread,
Aug 4, 2010, 10:40:34 AM8/4/10
to mixare-de...@googlegroups.com
Hi Hannes!

Thanks for the reorganization!=)
I think the "geo" field in your JSON file is empty because no tweet was made
form a mobile phone and so no geo data is provided for them (tweets made on
a pc do not provide latitude and longitude).
We decided to add to mixare only the tweets which provide geo data (which
come frome mobile phones).
In the place I am, Twitter is not user very much, but almost every time the
application shows one or two Tweets, so I think that it should work. Of
course sometimes it could happen that nothing is shown. I'll look at this
the next days..

Greetings,
Miriam
--------------------------------------------------
From: "Hannes Boran" <hannes...@gmail.com>
Sent: Wednesday, August 04, 2010 4:01 PM
To: "mixare-development" <mixare-de...@googlegroups.com>
Subject: [mixare-development] Re: problems with using my own data

>> "title": "��¥",


>> "has_detail_page": "1",
>> "webpage": ""
>> },
>> {
>> "id": "02",
>> "lat": "30.75278",
>> "lng": "103.92611",
>> "elevation": "540",

>> "title": "ͼ���",


>> "has_detail_page": "0",
>> "webpage": ""
>> },
>> {
>> "id": "03",
>> "lat": "30.75389",
>> "lng": "103.93056",
>> "elevation": "540",

>> "title": "��ѧ¥",


>> "has_detail_page": "0",
>> "webpage": ""
>> },
>> {
>> "id": "04",
>> "lat": "30.75111",
>> "lng": "103.9175",
>> "elevation": "340",

>> "title": "����",


>> "has_detail_page": "0",
>> "webpage": ""
>> }
>> ]
>>
>> }
>>
>> This has troubled me for a long time. Have I missed any key steps?
>> Anyone can help me��
>>

>> Thanks in advance��
>
> --
> You received this message because you are subscribed to the Google
> Groups "mixare-development" group.
> To post to this group, send email to mixare-de...@googlegroups.com
> To unsubscribe from this group, send email to
> mixare-developm...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/mixare-development?hl=en
> The project's home page is at http://www.mixare.org/en
>

Miriam Fostini

unread,
Aug 4, 2010, 10:41:07 AM8/4/10
to mixare-de...@googlegroups.com
Hi Hannes!

Thanks for the reorganization!=)
I think the "geo" field in your JSON file is empty because no tweet was made
form a mobile phone and so no geo data is provided for them (tweets made on
a pc do not provide latitude and longitude).
We decided to add to mixare only the tweets which provide geo data (which
come frome mobile phones).
In the place I am, Twitter is not user very much, but almost every time the
application shows one or two Tweets, so I think that it should work. Of
course sometimes it could happen that nothing is shown. I'll look at this
the next days..

Greetings,
Miriam
--------------------------------------------------
From: "Hannes Boran" <hannes...@gmail.com>
Sent: Wednesday, August 04, 2010 4:01 PM
To: "mixare-development" <mixare-de...@googlegroups.com>
Subject: [mixare-development] Re: problems with using my own data

> Hi,

>> "title": "��¥",


>> "has_detail_page": "1",
>> "webpage": ""
>> },
>> {
>> "id": "02",
>> "lat": "30.75278",
>> "lng": "103.92611",
>> "elevation": "540",

>> "title": "ͼ���",


>> "has_detail_page": "0",
>> "webpage": ""
>> },
>> {
>> "id": "03",
>> "lat": "30.75389",
>> "lng": "103.93056",
>> "elevation": "540",

>> "title": "��ѧ¥",


>> "has_detail_page": "0",
>> "webpage": ""
>> },
>> {
>> "id": "04",
>> "lat": "30.75111",
>> "lng": "103.9175",
>> "elevation": "340",

>> "title": "����",


>> "has_detail_page": "0",
>> "webpage": ""
>> }
>> ]
>>
>> }
>>
>> This has troubled me for a long time. Have I missed any key steps?
>> Anyone can help me��
>>

Daniele Gobbetti - Peer internet solutions

unread,
Aug 4, 2010, 11:05:15 AM8/4/10
to mixare-de...@googlegroups.com
Il 04/08/2010 16:01, Hannes Boran ha scritto:
> Hi,
> There was a bug in mixare, introduced with the last patch.
> I did some reorganization of the json data processing to get it more
> failsafe on crappy input data. Look at http://github.com/hanbo/mixare
> it should work now.
>
> Perhaps Daniele can integrade my changes into the main trunk.

I merged the change, thanks for the refactoring.

I think I messed up a bit with the branch/rebase/delete-branch/etc.
please bear with me if anyone has seen some weird messages on github.
Eventually I've got it right :)

Please Liu, could you try with the updated code and see if it fixes your
issue?
P.S. I opened an issue for this:
http://code.google.com/p/mixare/issues/detail?id=32

> One bug still exists: Twitter is currently not working because the
> "geo" field of the json response is always null.
> eg http://search.twitter.com/search.json?geocode=40.757929,-73.985506,25km
> Who knows why? Miriam?

It depends on the fact that Twitter does report results
+ if the _user_ registered in a place nearby (i.e. within radius)
OR
+ if the tweet is actually geolocated.

In the former case you get a result with empty "geo" field, in the
latter it's properly populated. The best way to test it is to make a
geolocated tweet from your android phone :)

> -Hannes

Best,
Daniele

--

> On 4 Aug., 04:15, Liu Yinqiu<liu.yin...@gmail.com> wrote:
>> Hello,
>> I'm very interested in mixare and I'm working on it. Following the
>> DisplayYourOwnData I create a JSON file in my sdcard and add the
>> intent to the launcher app.Like this
>> Intent i = new Intent();
>> i.setAction(Intent.ACTION_VIEW);
>> i.setDataAndType(Uri.parse("content://com.android.htmlfileprovider/
>> sdcard/uestc.php"), "application/mixare-json");
>> startActivity(i);
>>
>> But it still tells me that "ERROR:java.lang.NullPointerException". My
>> JSON file uestc.php is below:
>> {
>> "status": "OK",
>> "num_results": 4,
>> "results": [
>> {
>> "id": "01",
>> "lat": "30.74889",
>> "lng": "103.92472",
>> "elevation": "541",

>> "title": "��¥",


>> "has_detail_page": "1",
>> "webpage": ""
>> },
>> {
>> "id": "02",
>> "lat": "30.75278",
>> "lng": "103.92611",
>> "elevation": "540",

>> "title": "ͼ���",


>> "has_detail_page": "0",
>> "webpage": ""
>> },
>> {
>> "id": "03",
>> "lat": "30.75389",
>> "lng": "103.93056",
>> "elevation": "540",

>> "title": "��ѧ¥",


>> "has_detail_page": "0",
>> "webpage": ""
>> },
>> {
>> "id": "04",
>> "lat": "30.75111",
>> "lng": "103.9175",
>> "elevation": "340",

>> "title": "����",


>> "has_detail_page": "0",
>> "webpage": ""
>> }
>> ]
>>
>> }
>>
>> This has troubled me for a long time. Have I missed any key steps?
>> Anyone can help me��
>>

>> Thanks in advance��
>


--

==============================
> Daniele Gobbetti
> Usability & Innovation Management
>
> Peer GmbH/Srl
> www.peer.biz
> Tel. +39 0471 631080
> Fax +39 0471 631724

Liu Yinqiu

unread,
Aug 8, 2010, 9:54:16 AM8/8/10
to mixare-development

>
> Please Liu, could you try with the updated code and see if it fixes your
> issue?
> P.S. I opened an issue for this:http://code.google.com/p/mixare/issues/detail?id=32
>

Thanks to all of you!
I download hanbo-mixare and try again.A connection error occurs.I'm
sure my wifi is OK.
Why? The code needs to be modified?

Hannes Boran

unread,
Aug 9, 2010, 6:10:15 AM8/9/10
to mixare-development
Hello Liu,
i can confirm your problem. It seems the FileContentProvider does not
support the query operation.

Stack trace:

E/DatabaseUtils( 5283): Writing exception to parcel
E/DatabaseUtils( 5283): java.lang.UnsupportedOperationException
E/DatabaseUtils( 5283): at
com.android.htmlviewer.FileContentProvider.query(FileContentProvider.java:
76)
E/DatabaseUtils( 5283): at android.content.ContentProvider
$Transport.bulkQuery(ContentProvider.java:156)
E/DatabaseUtils( 5283): at
android.content.ContentProviderNative.onTransact(ContentProviderNative.java:
134)
E/DatabaseUtils( 5283): at android.os.Binder.execTransact(Binder.java:
288)
E/DatabaseUtils( 5283): at dalvik.system.NativeStart.run(Native
Method)
W/System.err( 5973): java.lang.UnsupportedOperationException
W/System.err( 5973): at
android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:
146)
W/System.err( 5973): at
android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:
114)
W/System.err( 5973): at
android.content.ContentProviderProxy.bulkQueryInternal(ContentProviderNative.java:
372)
W/System.err( 5973): at
android.content.ContentProviderProxy.query(ContentProviderNative.java:
408)
W/System.err( 5973): at
android.content.ContentResolver.query(ContentResolver.java:245)
W/System.err( 5973): at
org.mixare.MixContext.getContentInputStream(MixContext.java:330)
W/System.err( 5973): at
org.mixare.MixContext.getHttpGETInputStream(MixContext.java:156)
W/System.err( 5973): at
org.mixare.DownloadManager.processRequest(DownloadManager.java:122)
W/System.err( 5973): at
org.mixare.DownloadManager.run(DownloadManager.java:78)
W/System.err( 5973): at java.lang.Thread.run(Thread.java:1102)

Someone should look into this.
Reply all
Reply to author
Forward
0 new messages