com.mob.mobapi.API

Here are the examples of the java api com.mob.mobapi.API taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

99 Examples 7

19 Source : WxArticleAPIActivity.java
with Apache License 2.0
from stytooldex

public void onError(API api, int action, Throwable details) {
    details.printStackTrace();
    Toast.makeText(this, R.string.error_raise, Toast.LENGTH_SHORT).show();
}

19 Source : QueryTypeActivity.java
with Apache License 2.0
from stytooldex

public void onSuccess(API api, int action, Map<String, Object> result) {
    switch(action) {
        case Weather.ACTION_TYPE:
            {
                Object type = result.get("result");
                if (type != null) {
                    textView.setText(type.toString());
                }
            }
            break;
    }
}

19 Source : QueryByIpActivity.java
with Apache License 2.0
from stytooldex

public void onSuccess(API api, int action, Map<String, Object> result) {
    switch(action) {
        case Weather.ACTION_IP:
            onWeatherDetailsGot(result);
            break;
    }
}

19 Source : QueryByCityNameActivity.java
with Apache License 2.0
from stytooldex

public void onSuccess(API api, int action, Map<String, Object> result) {
    switch(action) {
        case Weather.ACTION_CITYS:
            onDistrictListGot(result);
            break;
        case Weather.ACTION_QUERY:
            onWeatherDetailsGot(result);
            break;
    }
}

19 Source : UserCenterAPIActivity.java
with Apache License 2.0
from stytooldex

public void onError(API api, int action, Throwable details) {
    details.printStackTrace();
    Toast.makeText(this, R.string.error_raise, Toast.LENGTH_SHORT).show();
    switch(action) {
        case UserCenter.ACTION_REGISTER:
        case UserCenter.ACTION_LOGIN:
            {
                tvUserInfo.setText(getString(R.string.usercenter_api_user_not_login));
            }
            break;
        case UserCenter.ACTION_CHANGE_PreplacedWORD:
            {
            }
            break;
    }
    setBtnEnable(true);
}

19 Source : UcacheGetActivity.java
with Apache License 2.0
from stytooldex

public void onError(API api, int action, Throwable details) {
    details.printStackTrace();
    Toast.makeText(this, R.string.error_raise, Toast.LENGTH_SHORT).show();
    btnSearch.setEnabled(true);
}

19 Source : UcacheCountActivity.java
with Apache License 2.0
from stytooldex

public void onSuccess(API api, int action, Map<String, Object> result) {
    tvCount.setText(String.valueOf(result.get("result")));
    btnSearch.setEnabled(true);
}

19 Source : TrainTicketsAPIActivity.java
with Apache License 2.0
from stytooldex

public void onError(API api, int action, Throwable details) {
    details.printStackTrace();
    Toast.makeText(this, R.string.error_raise, Toast.LENGTH_SHORT).show();
    isQuerying = false;
}

19 Source : TiKuAPIActivity.java
with Apache License 2.0
from stytooldex

public void onError(API api, int action, Throwable details) {
    details.printStackTrace();
    Toast.makeText(this, R.string.error_raise, Toast.LENGTH_SHORT).show();
    btnreplacediKuCategory.setEnabled(true);
}

19 Source : AddressToPostcodeActivity.java
with Apache License 2.0
from stytooldex

public void onSuccess(API api, int action, Map<String, Object> result) {
    switch(action) {
        case Postcode.ACTION_PCD:
            onDistrictListGot(result);
            break;
        case Postcode.ACTION_SEARCH:
            onAddressListGot(result);
            break;
    }
}

19 Source : LotteryAPIActivity.java
with Apache License 2.0
from stytooldex

public void onError(API api, int action, Throwable details) {
    details.printStackTrace();
    Toast.makeText(this, R.string.error_raise, Toast.LENGTH_SHORT).show();
    if (action == Lottery.ACTION_QUERY) {
        isQuerying = false;
    }
}

19 Source : LotteryAPIActivity.java
with Apache License 2.0
from stytooldex

public void onSuccess(API api, int action, Map<String, Object> result) {
    switch(action) {
        case Lottery.ACTION_LIST:
            {
                updateLotteryTypeList(result);
            }
            break;
        case Lottery.ACTION_QUERY:
            {
                updateLotteryResult(result);
                etPeriod.setText("");
                isQuerying = false;
            }
            break;
    }
}

19 Source : IKTokenAPIActivity.java
with Apache License 2.0
from stytooldex

public void onError(API api, int action, Throwable details) {
    details.printStackTrace();
    Toast.makeText(this, R.string.error_raise, Toast.LENGTH_SHORT).show();
    if (action == IKToken.ACTION_replacedYZE) {
        isQuerying = false;
    }
}

19 Source : HealthAPIActivity.java
with Apache License 2.0
from stytooldex

public void onError(API api, int action, Throwable details) {
    isLoading = false;
    details.printStackTrace();
    Toast.makeText(this, R.string.error_raise, Toast.LENGTH_SHORT).show();
}

19 Source : GlobalStockListAPIActivity.java
with Apache License 2.0
from stytooldex

@Override
public void onError(API api, int action, Throwable details) {
    details.printStackTrace();
    Toast.makeText(this, R.string.error_raise, Toast.LENGTH_SHORT).show();
}

19 Source : GlobalStockListAPIActivity.java
with Apache License 2.0
from stytooldex

@Override
public void onSuccess(API api, int action, Map<String, Object> result) {
    new LoadTask().execute((LinkedHashMap<String, Object>) result.get("result"));
}

19 Source : GlobalStockDetailActivity.java
with Apache License 2.0
from stytooldex

public void onSuccess(API api, int action, Map<String, Object> result) {
    new LoadTask().execute((LinkedHashMap<String, Object>) result.get("result"));
}

19 Source : WxArticleAPIActivity.java
with MIT License
from stytooldex

public void onSuccess(API api, int action, Map<String, Object> result) {
    ArrayList<HashMap<String, Object>> res = forceCast(result.get("result"));
    if (null != res && res.size() > 0) {
        categoryList.clear();
        categoryList.addAll(res);
        categoryAdapter.notifyDataSetChanged();
    }
}

19 Source : WxArticleAPIActivity.java
with MIT License
from stytooldex

public void onError(API api, int action, Throwable details) {
    details.printStackTrace();
}

19 Source : QueryRMBQuotationByBank.java
with MIT License
from stytooldex

public void onSuccess(API api, int action, Map<String, Object> result) {
    ArrayList<Map<String, Object>> res = forceCast(result.get("result"));
    if (res == null) {
        res = new ArrayList<Map<String, Object>>();
    }
    dataList.clear();
    dataList.addAll(res);
    adapter.notifyDataSetChanged();
    setBtnEnable(true);
}

19 Source : LotteryAPIActivity.java
with MIT License
from stytooldex

public void onSuccess(API api, int action, Map<String, Object> result) {
    switch(action) {
        case Lottery.ACTION_LIST:
            updateLotteryTypeList(result);
            break;
        case Lottery.ACTION_QUERY:
            updateLotteryResult(result);
            etPeriod.setText("");
            isQuerying = false;
            break;
    }
}

19 Source : HistoryAPIActivity.java
with MIT License
from stytooldex

public void onSuccess(API api, int action, Map<String, Object> result) {
    ArrayList<HashMap<String, Object>> results = forceCast(result.get("result"));
    HistorySimpleAdapter adapter = new HistorySimpleAdapter(this, results);
    lvHistory.setAdapter(adapter);
}

19 Source : GoldAPIActivity.java
with MIT License
from stytooldex

public void onSuccess(API api, int action, Map<String, Object> result) {
    ArrayList<Map<String, Object>> res = forceCast(result.get("result"));
    if (res != null && res.size() > 0) {
        switch(action) {
            case Gold.ACTION_FUTURE:
                showFutureResult(res);
                break;
            case Gold.ACTION_SPOT:
                showSpotResult(res);
                break;
        }
    }
    setBtnEnable(true);
}

19 Source : BoxOfficeAPIActivity.java
with MIT License
from stytooldex

public void onSuccess(API api, int action, Map<String, Object> result) {
    ArrayList<Map<String, Object>> res = forceCast(result.get("result"));
    if (res != null && res.size() > 0) {
        switch(action) {
            case BoxOffice.ACTION_DAY:
                showDayResult(res);
                break;
            case BoxOffice.ACTION_WEEK:
                showWeekResult(res);
                break;
            case BoxOffice.ACTION_WEEKEND:
                showWeekendResult(res);
                break;
        }
    }
    setBtnEnable(true);
}

18 Source : WxArticleAPIActivity.java
with Apache License 2.0
from stytooldex

public void onSuccess(API api, int action, Map<String, Object> result) {
    ArrayList<HashMap<String, Object>> res = ResHelper.forceCast(result.get("result"));
    if (null != res && res.size() > 0) {
        categoryList.clear();
        categoryList.addAll(res);
        categoryAdapter.notifyDataSetChanged();
    }
}

18 Source : UcacheDelActivity.java
with Apache License 2.0
from stytooldex

public void onSuccess(API api, int action, Map<String, Object> result) {
    tvResult.setText(R.string.del_success);
    btnDel.setEnabled(true);
}

18 Source : GetAllAdapter.java
with Apache License 2.0
from stytooldex

public void onError(API api, int action, Throwable details) {
    requestComplete();
    details.printStackTrace();
    Toast.makeText(MobSDK.getContext(), R.string.error_raise, Toast.LENGTH_SHORT).show();
}

18 Source : TrainTicketsAPIActivity.java
with Apache License 2.0
from stytooldex

public void onSuccess(API api, int action, Map<String, Object> result) {
    ArrayList<Map<String, Object>> res = ResHelper.forceCast(result.get("result"));
    if (res != null && res.size() > 0) {
        switch(action) {
            case TrainTickets.ACTION_QUERY_BY_NO:
                showTrainNoResult(res);
                break;
            case TrainTickets.ACTION_QUERY_BY_STATION:
                showStationResult(res);
                break;
        }
    }
    isQuerying = false;
}

18 Source : StationAPIActivity.java
with Apache License 2.0
from stytooldex

public void onSuccess(API api, int action, Map<String, Object> result) {
    @SuppressWarnings("unchecked")
    HashMap<String, Object> address = (HashMap<String, Object>) result.get("result");
    tvId.setText(com.mob.tools.utils.ResHelper.toString(address.get("id")));
    tvAddr.setText(com.mob.tools.utils.ResHelper.toString(address.get("addr")));
    tvCell.setText(com.mob.tools.utils.ResHelper.toString(address.get("cell")));
    tvGoogleLat.setText(com.mob.tools.utils.ResHelper.toString(address.get("googleLat")));
    tvGoogleLng.setText(com.mob.tools.utils.ResHelper.toString(address.get("googleLng")));
    tvLac.setText(com.mob.tools.utils.ResHelper.toString(address.get("lac")));
    tvLat.setText(com.mob.tools.utils.ResHelper.toString(address.get("lat")));
    tvLng.setText(com.mob.tools.utils.ResHelper.toString(address.get("lng")));
    tvMcc.setText(com.mob.tools.utils.ResHelper.toString(address.get("mcc")));
    tvMnc.setText(com.mob.tools.utils.ResHelper.toString(address.get("mnc")));
    tvPrecision.setText(com.mob.tools.utils.ResHelper.toString(address.get("precision")));
    if (tvPrecision.getText().length() > 0) {
        String text = tvPrecision.getText().toString();
        String unit = getString(R.string.units_meters);
        tvPrecision.setText(text + unit);
    }
}

18 Source : SliverAPIActivity.java
with Apache License 2.0
from stytooldex

public void onSuccess(API api, int action, Map<String, Object> result) {
    ArrayList<Map<String, Object>> res = ResHelper.forceCast(result.get("result"));
    if (res != null && res.size() > 0) {
        switch(action) {
            case Sliver.ACTION_FUTURE:
                showFutureResult(res);
                break;
            case Sliver.ACTION_SPOT:
                showSpotResult(res);
                break;
        }
    }
    setBtnEnable(true);
}

18 Source : SliverAPIActivity.java
with Apache License 2.0
from stytooldex

public void onError(API api, int action, Throwable details) {
    details.printStackTrace();
    Toast.makeText(this, R.string.error_raise, Toast.LENGTH_SHORT).show();
    setBtnEnable(true);
}

18 Source : PostcodeToAddressActivity.java
with Apache License 2.0
from stytooldex

@SuppressWarnings("unchecked")
public void onSuccess(API api, int action, Map<String, Object> result) {
    result = (Map<String, Object>) result.get("result");
    String province = com.mob.tools.utils.ResHelper.toString(result.get("province"));
    String city = com.mob.tools.utils.ResHelper.toString(result.get("city"));
    String district = com.mob.tools.utils.ResHelper.toString(result.get("district"));
    ArrayList<String> list = (ArrayList<String>) result.get("address");
    StringBuilder address = new StringBuilder();
    for (String add : list) {
        address.append('\n').append(add);
    }
    address.deleteCharAt(0);
    tvProvince.setText(province);
    tvCity.setText(city);
    tvDistrict.setText(district);
    tvAddress.setText(address);
}

18 Source : MainActivity.java
with Apache License 2.0
from stytooldex

private void showIntegratedAPIs() {
    API[] apis = MobAPI.listAPI();
    AlertDialog.Builder builder = new AlertDialog.Builder(this);
    StringBuilder sb = new StringBuilder();
    for (API api : apis) {
        sb.append("\n\t").append(api.getName());
    }
    String msg = getString(R.string.integrated_apis_x, sb.toString());
    builder.setMessage(msg);
    builder.setPositiveButton(R.string.close, null);
    builder.show();
}

18 Source : IKTokenAPIActivity.java
with Apache License 2.0
from stytooldex

public void onSuccess(API api, int action, Map<String, Object> result) {
    switch(action) {
        case IKToken.ACTION_CATEGORY:
            {
                ArrayList<HashMap<String, String>> tmpList = ResHelper.forceCast(result.get("result"));
                if (tmpList == null || tmpList.size() < 1) {
                    return;
                }
                categoryList.clear();
                categoryList.addAll(tmpList);
                categoryAdapter.notifyDataSetChanged();
            }
            break;
        case IKToken.ACTION_replacedYZE:
            {
                tvResult.setText(result.get("result").toString());
                isQuerying = false;
            }
            break;
    }
}

18 Source : HistoryAPIActivity.java
with Apache License 2.0
from stytooldex

public void onSuccess(API api, int action, Map<String, Object> result) {
    ArrayList<HashMap<String, Object>> results = ResHelper.forceCast(result.get("result"));
    HistorySimpleAdapter adapter = new HistorySimpleAdapter(this, results);
    lvHistory.setAdapter(adapter);
}

18 Source : GoldAPIActivity.java
with Apache License 2.0
from stytooldex

public void onSuccess(API api, int action, Map<String, Object> result) {
    ArrayList<Map<String, Object>> res = ResHelper.forceCast(result.get("result"));
    if (res != null && res.size() > 0) {
        switch(action) {
            case Gold.ACTION_FUTURE:
                showFutureResult(res);
                break;
            case Gold.ACTION_SPOT:
                showSpotResult(res);
                break;
        }
    }
    setBtnEnable(true);
}

18 Source : FlightAPIActivity.java
with Apache License 2.0
from stytooldex

public void onSuccess(API api, int action, Map<String, Object> result) {
    ArrayList<Map<String, Object>> res = ResHelper.forceCast(result.get("result"));
    if (res != null && res.size() > 0) {
        switch(action) {
            case Flight.ACTION_QUERY_BY_NO:
                {
                    currentIsQueryByNo = true;
                    showResult(res);
                }
                break;
            case Flight.ACTION_QUERY_BY_LINE:
                {
                    currentIsQueryByNo = false;
                    showResult(res);
                }
                break;
        }
    }
    isQuerying = false;
}

18 Source : QueryRMBQuotationByBank.java
with Apache License 2.0
from stytooldex

public void onSuccess(API api, int action, Map<String, Object> result) {
    ArrayList<Map<String, Object>> res = ResHelper.forceCast(result.get("result"));
    if (res == null) {
        res = new ArrayList<Map<String, Object>>();
    }
    dataList.clear();
    dataList.addAll(res);
    adapter.notifyDataSetChanged();
    setBtnEnable(true);
}

18 Source : DomesticMetalAPIActivity.java
with Apache License 2.0
from stytooldex

public void onSuccess(API api, int action, Map<String, Object> result) {
    ArrayList<Map<String, Object>> res = ResHelper.forceCast(result.get("result"));
    if (res != null && res.size() > 0) {
        showSpotResult(res);
    }
    setBtnEnable(true);
}

18 Source : CustomAPISemiAutomaticActivity.java
with Apache License 2.0
from stytooldex

public void onSuccess(API api, int action, Map<String, Object> result) {
    Hashon hason = new Hashon();
    String json = hason.fromHashMap((HashMap<String, Object>) result);
    tvJson.setText(hason.format(json));
}

18 Source : CarSeriesNameActivity.java
with Apache License 2.0
from stytooldex

public void onSuccess(API api, int action, Map<String, Object> result) {
    try {
        List<Map<String, Object>> res = (List<Map<String, Object>>) result.get("result");
        List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
        if (res != null && !res.isEmpty()) {
            list.addAll(res);
        }
        getListView().setAdapter(new MyAdapter(this, list));
        TextView headView = new TextView(getBaseContext());
        headView.setTextSize(14);
        headView.setTextColor(0xFF999999);
        headView.setGravity(Gravity.CENTER);
        headView.setPadding(0, 10, 0, 10);
        headView.setText(R.string.car_api_hint_desc);
        getListView().addHeaderView(headView);
    } catch (Throwable t) {
        throw new RuntimeException(t);
    }
}

18 Source : BoxOfficeAPIActivity.java
with Apache License 2.0
from stytooldex

public void onSuccess(API api, int action, Map<String, Object> result) {
    ArrayList<Map<String, Object>> res = ResHelper.forceCast(result.get("result"));
    if (res != null && res.size() > 0) {
        switch(action) {
            case BoxOffice.ACTION_DAY:
                showDayResult(res);
                break;
            case BoxOffice.ACTION_WEEK:
                showWeekResult(res);
                break;
            case BoxOffice.ACTION_WEEKEND:
                showWeekendResult(res);
                break;
        }
    }
    setBtnEnable(true);
}

18 Source : UcachePutActivity.java
with MIT License
from stytooldex

public void onSuccess(API api, int action, Map<String, Object> result) {
    Toast.makeText(this, R.string.sucess, Toast.LENGTH_SHORT).show();
}

18 Source : PostcodeToAddressActivity.java
with MIT License
from stytooldex

@SuppressWarnings("unchecked")
public void onSuccess(API api, int action, Map<String, Object> result) {
    result = (Map<String, Object>) result.get("result");
    String province = com.mob.tools.utils.R.toString(result.get("province"));
    String city = com.mob.tools.utils.R.toString(result.get("city"));
    String district = com.mob.tools.utils.R.toString(result.get("district"));
    ArrayList<String> list = (ArrayList<String>) result.get("address");
    StringBuilder address = new StringBuilder();
    for (String add : list) {
        address.append('\n').append(add);
    }
    address.deleteCharAt(0);
    tvProvince.setText(province);
    tvCity.setText(city);
    tvDistrict.setText(district);
    tvAddress.setText(address);
}

18 Source : MarriageAPIActivity.java
with MIT License
from stytooldex

public void onSuccess(API api, int action, Map<String, Object> result) {
    HashMap<String, Object> res = forceCast(result.get("result"));
    tvMarriageType.setText(com.mob.tools.utils.R.toString(res.get("marriageType")));
    tvMenLunar.setText(com.mob.tools.utils.R.toString(res.get("menLunar")));
    tvMenLunarTime.setText(com.mob.tools.utils.R.toString(res.get("menLunarTime")));
    tvMenMarriage.setText(com.mob.tools.utils.R.toString(res.get("menMarriage")));
    tvMenZodiac.setText(com.mob.tools.utils.R.toString(res.get("menZodiac")));
    tvWomanLunar.setText(com.mob.tools.utils.R.toString(res.get("womanLunar")));
    tvWonmanLuarTime.setText(com.mob.tools.utils.R.toString(res.get("wonmanLuarTime")));
    tvWonmanMarriage.setText(com.mob.tools.utils.R.toString(res.get("wonmanMarriage")));
    tvWonmanZodiac.setText(com.mob.tools.utils.R.toString(res.get("wonmanZodiac")));
}

18 Source : LaoHuangLiAPIActivity.java
with MIT License
from stytooldex

public void onSuccess(API api, int action, Map<String, Object> result) {
    HashMap<String, Object> res = forceCast(result.get("result"));
    tvLhlAvoid.setText(com.mob.tools.utils.R.toString(res.get("avoid")));
    tvLhlJiShen.setText(com.mob.tools.utils.R.toString(res.get("jishen")));
    tvLhlSuit.setText(com.mob.tools.utils.R.toString(res.get("suit")));
    tvLhlXiongShen.setText(com.mob.tools.utils.R.toString(res.get("xiongshen")));
    tvLhlDate.setText(com.mob.tools.utils.R.toString(res.get("date")));
    tvLhlLunar.setText(com.mob.tools.utils.R.toString(res.get("lunar")));
}

18 Source : IDCardAPIActivity.java
with MIT License
from stytooldex

public void onSuccess(API api, int action, Map<String, Object> result) {
    HashMap<String, Object> address = forceCast(result.get("result"));
    tvArea.setText(com.mob.tools.utils.R.toString(address.get("area")));
    tvBirthday.setText(com.mob.tools.utils.R.toString(address.get("birthday")));
    tvSex.setText(com.mob.tools.utils.R.toString(address.get("sex")));
}

18 Source : HoroscopeAPIActivity.java
with MIT License
from stytooldex

public void onSuccess(API api, int action, Map<String, Object> result) {
    HashMap<String, Object> res = forceCast(result.get("result"));
    tvHoroscope.setText(com.mob.tools.utils.R.toString(res.get("horoscope")));
    tvLunar.setText(com.mob.tools.utils.R.toString(res.get("lunar")));
    tvLunarDate.setText(com.mob.tools.utils.R.toString(res.get("lunarDate")));
    tvZodiac.setText(com.mob.tools.utils.R.toString(res.get("zodiac")));
}

18 Source : HealthAPIActivity.java
with MIT License
from stytooldex

public void onSuccess(API api, int action, Map<String, Object> result) {
    HashMap<String, Object> res = forceCast(result.get("result"));
    total = Integer.parseInt(com.mob.tools.utils.R.toString(res.get("total")));
    ArrayList<HashMap<String, Object>> list = forceCast(res.get("list"));
    if (null != list) {
        healthList.addAll(list);
        adapter.notifyDataSetChanged();
    }
    ++pageIndex;
}

18 Source : DreamAPIActivity.java
with MIT License
from stytooldex

public void onSuccess(API api, int action, Map<String, Object> result) {
    HashMap<String, Object> res = forceCast(result.get("result"));
    total = Integer.parseInt(com.mob.tools.utils.R.toString(res.get("total")));
    ArrayList<HashMap<String, Object>> list = forceCast(res.get("list"));
    if (null != list) {
        dreamList.addAll(list);
        adapter.notifyDataSetChanged();
    }
    ++pageIndex;
}

See More Examples