Android Open Source - ShareManager Share Utils

From Project

Back to project page ShareManager.


The source code is released under:

Copyright (c) 2013, Nelspike All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Red...

If you think the Android project ShareManager 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 share.manager.utils;
//  ww  w  .j a  v  a  2  s .  c o  m
import java.util.ArrayList;
import java.util.List;

import org.json.JSONArray;
import org.json.JSONObject;

public class ShareUtils {

  public static String createChartLink(int initMonth, int initDay,
      int initYear, int finalMonth, int finalDay, int finalYear, char period,
      String company) {

    return "a=" + initMonth + "&b=" + initDay + "&c=" + initYear + "&d="
        + finalMonth + "&e=" + finalDay + "&f=" + finalYear + "&g=" + period
        + "&s=" + company;

  public static String buildSearchLink(String query) {
    return "" + query
        + "&callback=YAHOO.Finance.SymbolSuggest.ssCallback";

  public static JSONArray remove(final int idx, final JSONArray from) {
    final List<JSONObject> objs = asList(from);

    final JSONArray ja = new JSONArray();
    for (final JSONObject obj : objs) {

    return ja;

  public static List<JSONObject> asList(final JSONArray ja) {
    final int len = ja.length();
    final ArrayList<JSONObject> result = new ArrayList<JSONObject>(len);
    for (int i = 0; i < len; i++) {
      final JSONObject obj = ja.optJSONObject(i);
      if (obj != null) {
    return result;

Java Source Code List