Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
7 replies Latest Post - ‏2011-02-27T21:46:25Z by Tcheky.Stiles
GPeretti
GPeretti
2 Posts
ACCEPTED ANSWER

Pinned topic Implementing "Build a mobile RSS reader" tutorial

‏2010-02-19T18:29:48Z |
I'm trying to implement the tutorial, but I'm getting Java errors that I'm hoping to receive guidance on. If this is the wrong place to ask, please point me in the right direction.

I've followed the steps of the tutorial (using Eclipse) and am getting several errors. I'm a noob at Java (trying to learn is an uphill battle I intend to win).

The main ones are in the RSSReader.java

Specifically getting "The method add(int) in the type Menu is not applicable for the arguments (int, int, String)" error and "Menu.Item cannot be resolved to a type".

Thanks for any help.
Updated on 2011-02-27T21:46:25Z at 2011-02-27T21:46:25Z by Tcheky.Stiles
  • SystemAdmin
    SystemAdmin
    17 Posts
    ACCEPTED ANSWER

    Re: Implementing "Build a mobile RSS reader" tutorial

    ‏2010-03-08T18:55:09Z  in response to GPeretti
    Did you ever figure this out?

    I'm having the same problem. Guessing I'm doing something stupid or missing something easy since I'm new to Android and Java.
    • GPeretti
      GPeretti
      2 Posts
      ACCEPTED ANSWER

      Re: Implementing "Build a mobile RSS reader" tutorial

      ‏2010-03-08T20:25:51Z  in response to SystemAdmin
      No, I haven't yet. I guess this board is dead or my question was too inane to be answered by those more knowledgeable.
  • MistaJase
    MistaJase
    1 Post
    ACCEPTED ANSWER

    Re: Implementing "Build a mobile RSS reader" tutorial

    ‏2010-04-01T18:43:56Z  in response to GPeretti
    I got it working!

    took a bit of messing around but I managed to do it!

    Check the attached file
    • Capt.Awesome
      Capt.Awesome
      1 Post
      ACCEPTED ANSWER

      Re: Implementing "Build a mobile RSS reader" tutorial

      ‏2010-05-05T11:11:10Z  in response to MistaJase
      public void onItemClick(AdapterView parent, View v, int position, long id) {
      Log.i(tag, "item clicked! ");

      Intent itemintent = new Intent("com.locallite.app.ShowDescription");

      Bundle b = new Bundle();
      b.putString("title", feed.getItem(position).getTitle());
      b.putString("description", feed.getItem(position).getDescription());
      b.putString("link", feed.getItem(position).getLink());
      b.putString("pubdate", feed.getItem(position).getPubDate());

      itemintent.putExtra("android.intent.extra.INTENT", b);
      startActivity(itemintent);

      }

      startActivity(itemintent) is seem to be crashing the application. Let me know if you found out a solution for it.

      Thanks for the menus they are working fine now.
    • YoursTruely
      YoursTruely
      1 Post
      ACCEPTED ANSWER

      Re: Implementing "Build a mobile RSS reader" tutorial

      ‏2010-05-24T05:12:37Z  in response to MistaJase
      I'm confused as to how this

      Log.i(tag,"Refreshing RSS Feed");
      refreshes my feed...

      Android seems to not know how that is supposed to refresh my feed either..
      • cybergen
        cybergen
        1 Post
        ACCEPTED ANSWER

        Re: Implementing "Build a mobile RSS reader" tutorial

        ‏2010-08-04T22:24:03Z  in response to YoursTruely
        That updated code works well, but it seems that in the newer Android revisions, you need to explicitly declare your intent to access the internet. Otherwise, the code will always fail to openStream() on the URL provided. You can get internet permission by adding the following to your manifest file:

        <uses-permission android:name="android.permission.INTERNET" />
  • Tcheky.Stiles
    Tcheky.Stiles
    1 Post
    ACCEPTED ANSWER

    Re: Implementing "Build a mobile RSS reader" tutorial

    ‏2011-02-27T21:46:25Z  in response to GPeretti
    TGamer wrote:
    Did you ever figure this out?

    I'm having the same problem. Guessing I'm doing something stupid or missing something easy since I'm new to Android and Java.

    It's quite useful, Thanks for your explanation!