Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
BlackBerry development question
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
David Janes  
View profile  
 More options Jun 30 2009, 7:57 pm
From: David Janes <davidja...@gmail.com>
Date: Tue, 30 Jun 2009 19:57:42 -0400
Local: Tues, Jun 30 2009 7:57 pm
Subject: BlackBerry development question

Yeah, I know what group this is but a few of you have programmed for the BB
;-)

I'm trying to make a BlackBerry app & I want to include a lot of data with
it that will be on "disk" or whatever the hell it is a BB has. For example,
I need to read a JSON file shipped with the app.

Do you have any idea:

- how it should be properly added to Eclipse?
- how it can be read

I've tried using Connector, but it's not evident after some experimentation
what file://... URL I should be using. I don't even really know what the
correct terminology for talking about this is.

Regards, etc...
David


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Blake  
View profile  
 More options Jul 1 2009, 2:57 pm
From: Blake <bwin...@latte.ca>
Date: Wed, 1 Jul 2009 11:57:05 -0700 (PDT)
Local: Wed, Jul 1 2009 2:57 pm
Subject: Re: BlackBerry development question
On Jun 30, 7:57 pm, David Janes <davidja...@gmail.com> wrote:

> Yeah, I know what group this is but a few of you have programmed for the BB
> ;-)

Hey, some of us are trying to forget that period of our lives.  ;)

> I'm trying to make a BlackBerry app & I want to include a lot of data with
> it that will be on "disk" or whatever the hell it is a BB has. For example,
> I need to read a JSON file shipped with the app.

If you're shipping it with the app, then it should be in the app's jar
file.  (It looks like there's also a file system of some sort, but I
don't think that'll be populated when you install the app, so you
should just stuff it in the jar file.

> Do you have any idea:
> - how it should be properly added to Eclipse?

In theory, you can just drag and drop it into the source folder.

> - how it can be read

Here's what I use.  It's the standard/best practice, so I don't think
it's covered under any NDA/license.
[...]
  JSONObject root;
  public SampleApplication()
  {
    InputStream stream = getClass().getResourceAsStream( "/res/
samplefeed.json" );
    int length = 10240;
    byte[] bArray = new byte[length];
    StringBuffer data = new StringBuffer();
    while ( (length = stream.read( bArray )) != -1 )
    {
      data.append( new String( bArray, "UTF-8" ) );
    }
    root = new JSONObject( data.toString() );
  }
[...]

See also http://www.blackberry.com/developers/docs/4.5.0api/java/lang/Class.ht...

> I've tried using Connector, but it's not evident after some experimentation
> what file://... URL I should be using.

It looks like the Connector stuff is for files you store on an CF
card.

http://www.blackberry.com/developers/docs/4.5.0api/javax/microedition...
suggests that you should be using "file:///CFCard/newfile.txt"  (Note
the empty hostname between the second and third slashes. :P )

> I don't even really know what the correct terminology for talking about this is.

That all seemed understandable to me.

Later,
Blake.


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2010 Google