Horoscope-API

Additional

Language
Java
Version
N/A
Created
Aug 25, 2018
Updated
Oct 8, 2018
Owner
TheBotBox
Contributors
TheBotBox
me40x1
2
Activity
Badge
Generate
Download
Source code
APK file

Commercial

Horoscope-API.

Simple Java API to get the horoscope according to the sunsign.

Contents

FeaturesImplementationAPI UsageTo-dosGet It On Play StoreCreditsLicense






Features

  • Get Horoscope based on sunsign
  • Get Horoscope for today, weekly, monthly & yearly

Implementation

Library is available on JCenter, simply add the following line in your app build.gradle

implementation'the.bot.box:horoscope-api:{latest-version}'

where {latest-version} corresponds to latest published version

API Usage

To request for any horoscope, simply call,

Horoscope hGemini = new Horoscope.Zodiac(mContext)
                        .requestSunSign(SUNSIGN.GEMINI) 

and also, don't forget to request for duration of horoscope simultaneously i.e TODAY, WEEKLY, MONTHLY, YEARLY request for it like below,

Horoscope hGemini = new Horoscope.Zodiac(mContext)
                        .requestSunSign(SUNSIGN.GEMINI).
                          .requestDuration((DURATION.TODAY)

therefore, the final request will may seem like the one below,

Horoscope hGemini = new Horoscope.Zodiac(MainActivity.this)
                        .requestSunSign(SUNSIGN.GEMINI)
                           .requestDuration(DURATION.TODAY)
                            .showLoader(true)                            
                              .isDebuggable(true)
                               .fetchHoroscope();

Mandatory Functions Access all the zodiacs like this SUNSIGN.ARIESSUNSIGN.TAURUSSUNSIGN.GEMINISUNSIGN.CANCER ... SUNSIGN.PISCESrequestSunSign(SUNSIGN)


requestDuration(DURATION) Access duration like this DURATION.TODAYDURATION.TOMORROWDURATION.WEEKDURATION.YEAR

Not calling above two function will throw IllegalStateException()

Optional FunctionsisDebuggable(boolean) - pass true to enable library logs & exception printStackTrace() or else they are disabledshowLoader(boolean) - pass true in param to displays a loader when fetching horoscope from server, by default its disable.


calling both the above function is totally optional and default value for both is false

Handling Response

Horoscope hGemini = new Horoscope.Zodiac(MainActivity.this)
                        .requestSunSign(SUNSIGN.GEMINI)
                           .requestDuration(DURATION.TODAY)
                            .showLoader(true)                            
                              .isDebuggable(true)
                               .fetchHoroscope();
 HorologyController cGemini = new HorologyController(new Response() {
                        @Override
                        public void onResponseObtained(Zodiac zodiac) {
                           String horoscope = zodiac.getHoroscope();
                           String sunsign = zodiac.getSunSign();
                           String date = getDate();
                        }

                        @Override
                        public void onErrorObtained(String errormsg) {
                                                   }
                    });
                    cGemini.requestConstellations(hGemini);

where, String horoscpe is the response from the server correspoding to the sunsign requested;String date is the same duration for which request has been made.String sunsign is the same sunsign for which request has been made;


In case of no internet connection, callback will come in onErrorObtained() with errormsg "No internet connection"

To-Dos Facts About a Sunsign Practical Side of a Sunsign Astrological Perspective of a Sunsign Get It On Play Store

Credits

This java library is working on top of Horoscope-API by Tapasweni Pathak

License

Copyright (c) 2018 TheBotBox Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.