Android Open Source - RSSReader J S O N Manager






From Project

Back to project page RSSReader.

License

The source code is released under:

?????? ????? ?????? ?????? ?????????? ????????? 1.?????? ???????? ??????? ??????? ????? ?????? ????? ?????????...

If you think the Android project RSSReader listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package net.uyghurdev.avaroid.rssreader.operator;
/*from   w  ww  .  jav a2s. c o  m*/
import java.util.ArrayList;

import net.uyghurdev.avaroid.rssreader.Item;
import net.uyghurdev.avaroid.rssreader.data.FeedData;

import org.json.JSONArray;
import org.json.JSONException;

import android.content.Context;

public class JSONManager {

  public ArrayList<Feed> getSugFeeds(Context ctx, String jStr) {
    // TODO Auto-generated method stub
    ArrayList<Feed> feeds = new ArrayList<Feed>();
    

    try {
      // this will break the JSON messages into an array
      JSONArray jary = new JSONArray(jStr.replace((char) 65279, ' '));
      // loop through the array
      for (int i = 0; i < jary.length(); i++) {
        FeedData data = new FeedData(ctx);
        if(data.getExistingFeed(jary.getJSONObject(i).getString("url")) == 0){
          Feed feed = new Feed();
          feed.setTitle(jary.getJSONObject(i).getString("title"));
          feed.setUrl(jary.getJSONObject(i).getString("url"));
  
          feeds.add(feed);
        }
      }
      
    } catch (JSONException e) {
      
      return null;
    }
     return feeds;
  }

  public String makeItemJson(Item item) {
    // TODO Auto-generated method stub
    String json = "{\"title\":\"" + item.getTitle() + "\",\"content\":\"" + item.getDescription() + "\",\"url\":\"" + item.getLink() + "\",\"imgurl\":" + item.getImageUrl() + "}";
    return json;
  }

}




Java Source Code List

ca.laplanete.mobile.example.ExampleActivity.java
ca.laplanete.mobile.example.ExamplePagedDragDropGridAdapter.java
ca.laplanete.mobile.example.Item.java
ca.laplanete.mobile.example.Page.java
ca.laplanete.mobile.pageddragdropgrid.DeleteDropZoneView.java
ca.laplanete.mobile.pageddragdropgrid.DragDropGrid.java
ca.laplanete.mobile.pageddragdropgrid.ItemsSource.java
ca.laplanete.mobile.pageddragdropgrid.OnPageChangedListener.java
ca.laplanete.mobile.pageddragdropgrid.PagedContainer.java
ca.laplanete.mobile.pageddragdropgrid.PagedDragDropGridAdapter.java
ca.laplanete.mobile.pageddragdropgrid.PagedDragDropGrid.java
net.uyghurdev.avaroid.rssreader.About.java
net.uyghurdev.avaroid.rssreader.AddFeedActivity.java
net.uyghurdev.avaroid.rssreader.Configs.java
net.uyghurdev.avaroid.rssreader.ContentActivity.java
net.uyghurdev.avaroid.rssreader.CustomAlertDialog.java
net.uyghurdev.avaroid.rssreader.EditFeedActivity.java
net.uyghurdev.avaroid.rssreader.ImageLoader.java
net.uyghurdev.avaroid.rssreader.ItemAdapter.java
net.uyghurdev.avaroid.rssreader.ItemListActivity.java
net.uyghurdev.avaroid.rssreader.Item.java
net.uyghurdev.avaroid.rssreader.LItem.java
net.uyghurdev.avaroid.rssreader.RSSReaderActivity.java
net.uyghurdev.avaroid.rssreader.SettingsActivity.java
net.uyghurdev.avaroid.rssreader.SplashActivity.java
net.uyghurdev.avaroid.rssreader.SuggestedFeedsActivity.java
net.uyghurdev.avaroid.rssreader.data.DataHelper_.java
net.uyghurdev.avaroid.rssreader.data.FeedData.java
net.uyghurdev.avaroid.rssreader.data.OpenHelper.java
net.uyghurdev.avaroid.rssreader.operator.FeedParser.java
net.uyghurdev.avaroid.rssreader.operator.Feed.java
net.uyghurdev.avaroid.rssreader.operator.FeedsAdapter.java
net.uyghurdev.avaroid.rssreader.operator.JSONManager.java
net.uyghurdev.avaroid.rssreader.operator.NetworkOperator.java
net.uyghurdev.avaroid.rssreader.service.AlarmReceiver.java
net.uyghurdev.avaroid.rssreader.service.UpdateService.java
net.uyghurdev.avaroid.rssreader.tools.FileCache.java
net.uyghurdev.avaroid.rssreader.tools.Helper.java
net.uyghurdev.avaroid.rssreader.tools.MemoryCache.java
net.uyghurdev.avaroid.rssreader.tools.UIManager.java
net.uyghurdev.avaroid.rssreader.tools.Utils.java