- 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-appModule) and - Android SDK (
maepaysohsdkModule) 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
maepaysohsdkfolder inmaepaysoh-androidproject folder. - Open
File > Project Structureto openProject Structuredialog. - Select your own project module (e.g app) under
Modulesselection. - Select
Dependenciestab. - Add new
Module depedencyby clicking+button. - Select
maepaysohsdkand 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/ZawgyiAPIHelpers 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 ofPartyObjects.getPartiesAsync📄 📋 pre-included AsyncTask call to provide Callback Function.getPartiesFromCache📄 loadsList<Party>from cache in case of Offline.searchPartiesFromCache📄 returnsList<Party>list ofPartyObjects in cache, matches with searchstring.
Candidate API Helper is created as follow;
CandidateAPIHelper candidateApiHelper = apiWrapper.getCandidateAPIHelper();Following methods are available for CandidateAPIHelper;
getCandidatesretrieve candidate list from API.getCandidatesAsyncfunction with AsyncTask, which accepts callback function.getCandidatesFromCacheretrieve candidate list from cached data.searchCandidateFromCachesearch candidate list from cached data.getCandidateByIdretrieve candidate by given ID from API.getCandidateByIdAsyncfunction with AsyncTask, which accepts callback function.getCandidateByIdFromCacheretrieve 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.
getFaqsretrieve FAQ data from API.getFaqsAsyncincluded AsyncTask, which accepts callback function.getFaqsFromCacheretrieve FAQ data from cache.searchFaqsearch in FAQ data from API.searchFaqsAsyncincluded AsyncTask, which accepts callback function.searchFaqFromCachesearch in FAQ data from cache.getFaqByIdretrieve FAQ entry for given ID from API.getFaqByIdAsyncincluded AsyncTask, which accepts callback function.
Geo API Helper is created as follow;
GeoAPIHelper geoApiHelper = apiWrapper.getGeoAPIHelper();Following methods are available for Geo API Helper
getLocationListretrieve geo location list.getLocationListAsyncadded AsyncTask which accepts callback function.getLocationByObjectIdretrieve geo location by givenpcode.getLocationByRegionretrieve geo location for given Region names.getLocationByRegionByAsyncadded AsyncTask which accepts callback function.