Name: maepaysoh-android
Owner: Myanmar API
Description: This is the Sample Android Application & SDK Library for MaePaySoh API.
Created: 2015-08-19 08:14:09.0
Updated: 2015-10-22 09:00:53.0
Pushed: 2015-09-24 08:08:57.0
Homepage: null
Size: 1016
Language: Java
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This is part of the Opensource Libraries for MaePaySoh ????????? project.
This repository is an Android Project which comprises of 2 major parts;
sample-app
Module) andmaepaysohsdk
Module) for MaePaySoh APIThe sample-app
module utilizes maepaysohsdk
as a dependency.
Followings are required to build this project folder;
MaePaySoh API is the primary data provider for this Android Application sample-app
.
The SDK maepaysohsdk
module is the client library and complys to MaePaySoh API specification.
API features are tested with this PostMan Collection for the development of SDK.
Followings are primary utility functions of SDK to get data from API.
MaePaySohApiWrapper
, this is helper-class-generator.PartyAPIHelper
, wrapper class for Party API endpoints.CandidateAPIHelper
, wrapper class for Candidate API endpoints.FAQAPIHelper
, wrapper class for FAQ API endpoints.GeoAPIHelper
, wrapper class for Geolocation endponts.The SDK in this repository can be used as dependency for your Android Application, or you can fork and transform the Sample Application to further creative ideas.
To use the SDK as dependency for your own Android Project.
maepaysoh-android
.File > New > Import Module
.maepaysohsdk
folder in maepaysoh-android
project folder.File > Project Structure
to open Project Structure
dialog.Modules
selection.Dependencies
tab.Module depedency
by clicking +
button.maepaysohsdk
and click OK
Own API key is required to connect to Mae Pay Soh API. It is required to put into SDK to connect to API. You can get your own APK Key at MaePaySoh Website.
You can setup the API Wrapper as follow;
aySohApiWrapper apiWrapper = new MaePaySohApiWrapper(this);
rapper.setApiKey(API_KEY); // Put your own API Key
rapper.setFont(MaePaySohApiWrapper.FONT.unicode); // Set Unicode/Zawgyi
APIHelper
s are generated from MaePaySohApiWrapper
object.
Party API Helper is created as follow;
yAPIHelper partyApiHelper = apiWrapper.getPartyApiHelper();
Followings methods are available for PartyAPIHelper
getParties()
:page_facing_up: returns List<Party>
list of Party
Objects.getPartiesAsync
:page_facing_up: :clipboard: pre-included AsyncTask call to provide Callback Function.getPartiesFromCache
:page_facing_up: loads List<Party>
from cache in case of Offline.searchPartiesFromCache
:page_facing_up: returns List<Party>
list of Party
Objects in cache, matches with search string
.Candidate API Helper is created as follow;
idateAPIHelper candidateApiHelper = apiWrapper.getCandidateAPIHelper();
Following methods are available for CandidateAPIHelper;
getCandidates
retrieve candidate list from API.getCandidatesAsync
function with AsyncTask, which accepts callback function.getCandidatesFromCache
retrieve candidate list from cached data.searchCandidateFromCache
search candidate list from cached data.getCandidateById
retrieve candidate by given ID from API.getCandidateByIdAsync
function with AsyncTask, which accepts callback function.getCandidateByIdFromCache
retrieve candidate for given ID from cached data.FAQ API Helper is created as follow;
PIHelper faqApiHelper = apiWrapper.getFAQAPIHelper();
Following methods are available for FAQ API Helper.
getFaqs
retrieve FAQ data from API.getFaqsAsync
included AsyncTask, which accepts callback function.getFaqsFromCache
retrieve FAQ data from cache.searchFaq
search in FAQ data from API.searchFaqsAsync
included AsyncTask, which accepts callback function.searchFaqFromCache
search in FAQ data from cache.getFaqById
retrieve FAQ entry for given ID from API.getFaqByIdAsync
included AsyncTask, which accepts callback function.Geo API Helper is created as follow;
PIHelper geoApiHelper = apiWrapper.getGeoAPIHelper();
Following methods are available for Geo API Helper
getLocationList
retrieve geo location list.getLocationListAsync
added AsyncTask which accepts callback function.getLocationByObjectId
retrieve geo location by given pcode
.getLocationByRegion
retrieve geo location for given Region names.getLocationByRegionByAsync
added AsyncTask which accepts callback function.