integrate data in the apk

69 views
Skip to first unread message

leg

unread,
Sep 17, 2010, 9:26:44 AM9/17/10
to mixare-development
hi
i tried to call mixare with a web json source and it's ok.

now i want to call it with the same json file integrated in the
source.
i put it in the res/raw/ directory, and:

i.setDataAndType(Uri.parse("android.resource://com.my.app/" +
R.raw.my_json_file), "application/mixare-json");

there's something wrong here because app crash immediatly.

any help?

thanks

leg

unread,
Sep 17, 2010, 9:32:23 AM9/17/10
to mixare-development
may be useful from debug:

09-17 13:09:18.371: ERROR/AndroidRuntime(936):
java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.my.app/com.my.app.lanciaMixare}:
android.content.ActivityNotFoundException: No Activity found to handle
Intent { act=android.intent.action.VIEW dat=android.resource://
com.my.app/2130968576 typ=application/mixare-json }

leg

unread,
Sep 18, 2010, 5:06:25 AM9/18/10
to mixare-development
i tried :

Uri.parse("http://www.mysite.com/my_json_file") = OK
Uri.parse("android.resource://com.my.app/" + R.raw.my_json_file) =
crash
Uri.parse("android.resource://com.my.app/raw/my_json_file") = crash
Uri.parse("content://com.my.app/" + R.raw.my_json_file) = open mixare
but says: impossible to download, check your connection etc etc.

Daniele Gobbetti - Peer internet solutions

unread,
Sep 20, 2010, 7:42:58 AM9/20/10
to mixare-de...@googlegroups.com
Dear leg,

by looking at
http://developer.android.com/guide/topics/providers/content-providers.html
(towards the bottom of the page). It seems to me that the content://
prefix is reserved for content providers, which mixare currently is not.
If you put the data on the sd card it works because the OS provides a
content provider for that.

Regards,
DAniele

--

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

leg

unread,
Sep 21, 2010, 9:02:34 AM9/21/10
to mixare-development
On 20 Set, 13:42, Daniele Gobbetti - Peer internet solutions
<d.gobbe...@peer.biz> wrote:

> If you put the data on the sd card it works because the OS provides a
> content provider for that.
>

at the moment i'm not able to make it works from the sdcard
i'm using the example:

Uri.parse("content://com.android.htmlfileprovider/sdcard/MYFILE")

MYFILE is on the sd card, obviously.

leg

unread,
Sep 21, 2010, 9:10:43 AM9/21/10
to mixare-development
update: android browser is able to open that sdcard URL.
maybe something wrong with mixare?

still telling "i dati non posso essere scaricati! controllare che la
connessione a internet sia attiva"

thanks

Daniele Gobbetti - Peer internet solutions

unread,
Sep 22, 2010, 12:14:01 PM9/22/10
to mixare-de...@googlegroups.com

Added to the issue tracker:
http://code.google.com/p/mixare/issues/detail?id=52

thanks for reporting this bug.

DAniele

--

> thanks

Reply all
Reply to author
Forward
0 new messages