Jetzt kostenlos registrieren. Mitglieder surfen ohne Werbung auf Android-Hilfe.de!
Zurück   Android-Hilfe.de > Android Developer > Android App Entwicklung

Rss

Das Thema "Rss" befindet sich unter Android App Entwicklung auf Android-Hilfe.de.


Antwort

 

Themen-Optionen Ansicht
Alt 22.11.2011, 13:12   #1 (permalink)
Neuer Benutzer

Registriert seit: 16.11.2011
Beiträge: 15
Abgegebene Danke: 1
Erhielt 0 Danke für 0 Beiträge
Standard Rss

Hallo ,
Ich würde gerne ein RSS App machen nur leider finde keine gute Tutoria.
Freue mich auf jede Hilfe.
Bis jetzt siet mein Projekt so aus:
Angehängte Dateien
Dateityp: zip RSS-ZIP-Archiv.zip (68,1 KB, 2x aufgerufen)
Kapvoys344 ist offline   Mit Zitat antworten
Alt 22.11.2011, 13:20   #2 (permalink)
Android Guru

Registriert seit: 09.05.2009
Beiträge: 2.389
Abgegebene Danke: 36
Erhielt 307 Danke für 289 Beiträge
Standard AW: Rss

Zitat:
Zitat von Kapvoys344 Beitrag anzeigen
nur leider finde keine gute Tutoria.
:

glaub ich dir nicht zu rss gibts genug im netz
__________________
App Entwicklung
Latest apps: Media Streamer BETA | DailyCash | MoneyManager ( PRO | HD )
swordi ist offline   Mit Zitat antworten
Alt 22.11.2011, 15:52   #3 (permalink)
Neuer Benutzer

Registriert seit: 16.11.2011
Beiträge: 15
Abgegebene Danke: 1
Erhielt 0 Danke für 0 Beiträge
Standard AW: Rss

ALso hab einige Tutoria gelesen und trozdem nix gebacken gekriegt.
Zur zeit sehen meine COde so aus:

main.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
  
  <TextView
  android:id="@+id/label"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:text="Enter RSS URL:"
  />
  
  <EditText
  android:id="@+id/rssURL"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:background="@android:drawable/editbox_background"
  android:text="http://www.rss-nachrichten.de/service/rss-feeds.xml"
  />
  

  <Button
      android:id="@+id/fetchRss"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout_marginRight="10dip"
      android:text="Fetch Rss" />

  <ListView
  android:id="@+id/rssListView"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content" />
</LinearLayout>
RSS_item_displayer.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
 xmlns:android="http://schemas.android.com/apk/res/android"
 android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
 >
 
 <TextView
  android:id="@+id/titleTextView"
   android:text="Title:"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:padding="10dp"
  android:textSize="13sp"
  android:autoLink="all"
  />
 
 <TextView
  android:id="@+id/contentTextView"
  android:text="Content:"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:textSize="13sp"
  android:autoLink="all"
  />
  
</LinearLayout>

RSSActivity.java
Code:
package rembo.network.urss;

import android.app.Activity;
import android.os.Bundle;
import android.widget.*;
import java.util.*;
import android.view.View;
import android.content.*;
public class RSSactivity extends Activity {
  
  public static RssItem selectedRssItem = null;
  String feedUrl = "";
  ListView rssListView = null;
  ArrayList<RssItem> rssItems = new ArrayList<RssItem>();
  ArrayAdapter<RssItem> aa = null;

  
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    // get textview from our layout.xml
    final TextView rssURLTV = (TextView) findViewById(R.id.rssURL);

    // get button from layout.xml
    Button fetchRss = (Button) findViewById(R.id.fetchRss);

    // define the action that will be executed when the button is clicked.
    fetchRss.setOnClickListener(new View.OnClickListener() {

      //@Override
      public void onClick(View v) {
        feedUrl = rssURLTV.getText().toString();
        //TextView TVtitle=(TextView)findViewById(R.id.label);
        //CharSequence cs="fetching";
        //TVtitle.setText(cs);
        aa.notifyDataSetChanged();
        refressRssList();
        //cs="Feed:";
        //TVtitle.setText(cs);
      }
    });

    // get the listview from layout.xml
    rssListView = (ListView) findViewById(R.id.rssListView);
    // here we specify what to execute when individual list items clicked
    rssListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {

      //@Override
      public void onItemClick(AdapterView<?> av, View view, int index,
          long arg3) {
        selectedRssItem = rssItems.get(index);

        // we call the other activity that shows a single rss item in
        // one page
        Intent intent = new Intent(
            "rembo.network.urss.displayRssItem");
        startActivity(intent);
      }
    });

        //adapters are used to populate list. they take a collection,
        //a view (in our example R.layout.list_item
    aa = new ArrayAdapter<RssItem>(this, R.layout.list_item, rssItems);
        //here we bind array adapter to the list
    rssListView.setAdapter(aa);
    feedUrl = rssURLTV.getText().toString();
    refressRssList();
  }

  private void refressRssList() {

    ArrayList<RssItem> newItems = RssItem.getRssItems(feedUrl);

    rssItems.clear();
    rssItems.addAll(newItems);

    //TextView TVtitle=(TextView)findViewById(R.id.label);
    //CharSequence cs="0";
    //if(newItems.size()>0) cs="is 1";
    //if(newItems.size()>5) cs="is 5";
    ///TVtitle.setText(cs);
    
    aa.notifyDataSetChanged();
  }

}
RssItemDesplayer.java
Code:
import android.app.Activity;
import android.os.Bundle;
import android.widget.*;
import java.text.*;

public class RssItemDisplayer extends Activity {
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.rss_item_displayer);

    RssItem selectedRssItem = RSSactivity.selectedRssItem;
    //Bundle extras = getIntent().getExtras();
    TextView titleTv = (TextView)findViewById(R.id.titleTextView);
    TextView contentTv = (TextView)findViewById(R.id.contentTextView);

    String title = "";
    SimpleDateFormat sdf = new SimpleDateFormat("MM/dd - hh:mm:ss");
    title = "\n" + selectedRssItem.getTitle() + "  ( "
        + sdf.format(selectedRssItem.getPubDate()) + " )\n\n";

    String content = "";
    content += selectedRssItem.getDescription() + "\n"
        + selectedRssItem.getLink();

    titleTv.setText(title);
    contentTv.setText(content);
  }
}
uRSS Manifest
Code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="rembo.network.urss"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk android:minSdkVersion="10" />

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >
        <activity
            android:label="@string/app_name"
            android:name=".URSSActivity" >
            <intent-filter >
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
  <uses-permission android:name="android.permission.INTERNET" />
</manifest>
Hoffe einer kann helfen.
Kapvoys344 ist offline   Mit Zitat antworten
Alt 22.11.2011, 15:53   #4 (permalink)
Android Guru

Registriert seit: 09.05.2009
Beiträge: 2.389
Abgegebene Danke: 36
Erhielt 307 Danke für 289 Beiträge
Standard AW: Rss

naja du kannst nicht erwarten, dass sich jemand deinen kompletten code durchliest.

was genau geht denn nicht? markier doch die entsprechenden stellen. dann ist es auch wahrscheinlicher, dass du hilfe bekommst
__________________
App Entwicklung
Latest apps: Media Streamer BETA | DailyCash | MoneyManager ( PRO | HD )
swordi ist offline   Mit Zitat antworten
Antwort

Stichworte
-

Themen-Optionen
Ansicht


Ähnliche Themen

Thema Autor Forum Antworten Letzter Beitrag
RSS Reader Touhy Informationsdienste 9 01.12.2011 18:02
rss Veit78 Huawei S7 Forum 2 17.01.2011 09:33
Rss habela31 Motorola Milestone Forum 3 21.05.2010 09:09
Freshface RSS Reader - heise geht nicht? Alternatives RSS-Widget? Compufreak Android Themes 2 19.08.2009 15:39
Rss! ROMOPAT Anregungen 10 04.02.2009 11:55




Du liest gerade: "Rss" unter "Android App Entwicklung" auf Android-Hilfe.de.


Powered by vBulletin®
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO
© Android-Hilfe.de 2012 - All rights reserved.