- What is this Repository?
- Minimum requirements.
- MaePaySoh API.
- MaePaySoh SDK Overview.
⤵️ - How to use this Repository?
- Contributions
This is part of the Opensource Libraries for MaePaySoh မဲပေးစို့ project.
This repository is an Android Project which comprises of 2 major parts;
- Sample Android Application (
sample-app
Module) and - Android SDK (
maepaysohsdk
Module) for MaePaySoh API
The sample-app
module utilizes maepaysohsdk
as a dependency.
Followings are required to build this project folder;
- Android SDK API 14
- Build Tool Version 23
- Gradle Version 2.4
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.
- Clone this repository
maepaysoh-android
. - Create your own new Android Project in Android Studio.
- Open
File > New > Import Module
. - Select
maepaysohsdk
folder inmaepaysoh-android
project folder. - Open
File > Project Structure
to openProject Structure
dialog. - Select your own project module (e.g app) under
Modules
selection. - Select
Dependencies
tab. - Add new
Module depedency
by clicking+
button. - Select
maepaysohsdk
and clickOK
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;
MaePaySohApiWrapper apiWrapper = new MaePaySohApiWrapper(this);
apiWrapper.setApiKey(API_KEY); // Put your own API Key
apiWrapper.setFont(MaePaySohApiWrapper.FONT.unicode); // Set Unicode/Zawgyi
APIHelper
s are generated from MaePaySohApiWrapper
object.
Party API Helper is created as follow;
PartyAPIHelper partyApiHelper = apiWrapper.getPartyApiHelper();
Followings methods are available for PartyAPIHelper
getParties()
📄 returnsList<Party>
list ofParty
Objects.getPartiesAsync
📄 📋 pre-included AsyncTask call to provide Callback Function.getPartiesFromCache
📄 loadsList<Party>
from cache in case of Offline.searchPartiesFromCache
📄 returnsList<Party>
list ofParty
Objects in cache, matches with searchstring
.
Candidate API Helper is created as follow;
CandidateAPIHelper 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;
FAQAPIHelper 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;
GeoAPIHelper 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 givenpcode
.getLocationByRegion
retrieve geo location for given Region names.getLocationByRegionByAsync
added AsyncTask which accepts callback function.