Documentation version 1.5
This documentation will help you familiarise yourself with 'The Ultimate City Guide App Template' Android App and the web based Admin page. It is suggested that you first upload the admin page to your server and make sure it is working before continuing to the Android App. The Android App will work fine using the demo server, however it is required to setup firebase for it to work well without errors. The setup of Firebase is explained in the Admin Page Video Tutorial.
Username: admin@gmail.com Password: pass
Make sure your have Android Studio 3.2.1 installed and in the Android SDK Manager make sure you have the following installed:
Try to place the project file as close to root (C:/) as possible as windows has a path character limit of 240chars. So, if you get the error:"Failed to crunch file...", reduce the path length.
Step 1 - Open up Android Studio and click 'open an existing Android Studio project'.
Step 2 - Drag and drop the 'CityGuide' folder in the dialog to go quickly to the folder.
Step 3 - Make sure 'CityGuide' is highlighted and click 'ok'.
Step 4 - Go to your Firebase Console and download the 'google-services.json' file and replace the placeholder in app/google-services.json. This step is included in the Admin Page video - If you skip this step you will encounter an error during compile time.
Step 5 - Press the Play button to test the app on the emulator or connect your phone via usb to your computer to try it on your phone.
This step must be done else you will have problems uploading to Google play and the Rate feature will not work.
Step 1 - Make sure the 'Compact Empty Middle Packages' option is deselected as shown below.
Step 2 - Rename the package id by right clicking on 'neurondigital' and selecting 'refactor' and 'rename' as shown below.
Step 3 - Click Rename package.
Step 4 - In the popup menu type in your company name. Then press 'refactor' and in the next popup window press 'Do Refactor'. Do the same for 'cityguide'. The package name should be in this format: com.yourcompany.AppName
Step 5 - Open app/build.gradle and put in the same package id as before instead of the 'com.neurondigital.cityguide'. This is shown below.
Step 1 - Put in your Server url in Configurations.java
Step 2 - Replace the share deep link url in res/strings.xml. When the user opens a url that matches the url you specified here, it would be opened up in the CityGuide app. If the app is not installed, the url would be opened on the browser, so make sure to choose a domain owned by you and has the server on it. eg: http://cityguide.neurondigital.com/1
The images can be found under app/res/drawable. To replace the images just copy/paste the image in the drawable folder to replace the other.
The icons can be found in app/res/mipmap. Notice that there are different sizes. To replace the icons just right-click->new->Image Asset and select your image.
For All Admob Ads you need to create an Admob Account, create a new Admob App and replace the sample admob_app_id in strings.xml with your Admob App Id. Then follow the points below to add the specific ad unit ids.
Create an interstitial Ad on AdMob and paste the AD unit Id in the strings.xml file. The Ad displays when the user clicks a property in the home screen. Make sure to add this to start making money from your App. The display rate can be changed from strings.xml from the ad_shows_every_X_clicks parameter.
Like the interstitial Ad, create a Banner Ad on AdMob and paste the AD unit Id in the strings.xml file. The Ad displays in the bottom of the screen. Ideally to not annoy the user, it's either the banner or the interstitial ad, so you may wish to leave one of the Ad IDs in strings.xml empty.
Like the interstitial Ad, create a Native Ad on AdMob and paste the AD unit Id in the strings.xml file. The Ad displays after the item description. If you don't wish to show Native Ads, you can leave this Ad unit ID empty in strings.xml.
Google Analytics in Android Apps is now depricated (removed in version 1.3). The new method is now using Firebase, which is also supported by this template.
Go to the Google Maps API Key console, and use it to generate a Map API key. Make Sure you activate the key for both Android & Javascript. Put this in strings.xml in the 'GoogleMapKey' field. Reminder: To use the Maps SDK for Android, you must get an API key and you must enable billing. Google Maps should not charge you any money for their service. See the Google Pricing for more info: https://cloud.google.com/maps-platform/pricing/sheet
The App uses Facebook Authentication for User Login. So you need to create a facebook app.
Step 1 - Go to Facebook for developers. and Create a new App ID.
Step 2 - Get the generated Facebook App id and fb login protocol scheme and put them in strings.xml.
Step 3 - In the Facebook Page, click the '+ Add Product' button to add the Facebook login Feature. Then Go to Settings and click the '+ Add Platforms' to add the Android Platform. This will ask you for a Key Hash. To obtain it, run the app while your phone/emulator is connected to Android studio and in the Android Monitor/logcat search for 'hash'. Remember that you need to do this twice. One for the debug app in Android Studio to test while Running in Android Studio. Secondly, you need to do this after generating your .apk file, since the exported .apk file will have a different hash key.
To use this feature you need to purchase an 'Extended License' of the template from CodeCanyon. This feature is not covered in the 'Regular License.'
Step 1 - The template allows for the user to purchase a premium upgrade to remove ads using google Play In-app Payments. Before doing so, create your app in Google Play Dashboard and locate the 'Public Key' as it can seen below:
Step 2 - Then add a new in-app product and give it a Product id.
Step 3 - Finally, put your Public Key and product id in configuration.java:
All translatable text is contained within the strings.xml file.
Go to Build| Generate Signed APK... and export the .APK file.
Make sure to keep up with the template updates and bug fixes on our facebook page.
All calls are made with reference to the base url. Eg: http://cityguide.neurondigital.com/
Get user details.
Returns: { "success": true, "id": 5, "email": "tom@gmail.com", "username": "tom", "fbuserid": "" }
Get user details by email.
GET Parameters:Returns: { "success": true, "id": 5, "email": "tom@gmail.com", "username": "tom", "fbuserid": "" } If not found: { "success":false, "error":"Email not found" }
Verify that user exists and that credentials are correct.
GET Parameters:Returns: { "email":"admin@gmail.com", "success":true } If not found: { "success":false, "error":"Wrong Password" }
Register a new account
GET Parameters:Returns: { "email":"admin@gmail.com", "success":true } If not found: { "success":false, "error":"Email not valid" }
Get multiple places offset by @pos. @limit is the maximum number of places to load.
GET Parameters:Returns: [ { "id": "2", "name": "National Museum", "image": "[\"149987939936.jpg\",\"149987939937.jpg\"]", "shared": "27", "viewed": "331", "favorited": "22", "accepted": "1", "lastupdate": "2017-08-15 13:36:23", "text": "description here", "submission_date": "2017-07-12 19:07:21", "author_id": "0", "gpslat": "51.5186", "gpslng": "-0.12291", "featured": "1", "price": "0", "address": "Great Russell St, Bloomsbury, London WC1B 3DG, UK", "deal_link": "", "price_suffix": "", "telephone": "+123456789", "email": "", "pin": "3", "totalratings": "19", "avgrating": "4.6316", "pinimage": "[\"1499878911pins-05.png\"]" } ]
Get a single place by id
Returns: { "id": 2, "name": "National Museum", "image": "[\"149987939936.jpg\",\"149987939937.jpg\"]", "shared": 27, "viewed": 331, "favorited": 22, "accepted": 1, "lastupdate": "2017-08-15 13:36:23", "text": "description here", "submission_date": "2017-07-12 19:07:21", "author_id": 0, "gpslat": "51.5186", "gpslng": "-0.12291", "featured": 1, "price": 0, "address": "Great Russell St, Bloomsbury, London WC1B 3DG, UK", "deal_link": "", "price_suffix": "", "telephone": "+123456789", "email": "", "pin": 3, "category": "[1,4]", "author": "", "avgrating": "4.6316", "totalratings": "19", "pinimage": "[\"1499878911pins-05.png\"]" }
Increment viewed/shared/favorited for statistics, by id
Returns: 1
Get multiple news articles offset by @pos. @limit is the maximum number of articles to load.
Returns: [ { "id": 3, "name": "My 10 Best Travel Tips After 5 Years Traveling The World", "image": "[\"149988059318.jpg\"]", "shared": 0, "viewed": 140, "favorited": 0, "accepted": 1, "lastupdate": "2017-08-15 13:35:51", "text": "article text", "submission_date": "2017-07-12 19:29:23", "author_id": 4, "has_video": 1, "is_headline": 1, "allow_comments": 0, "author": "John", "scheduled": 0 } ]
Get a single news article by id
Returns: { "id": 1, "name": "Amazing Local Deals!", "image": "[\"149988048816.jpg\",\"149988048817.jpg\"]", "shared": 0, "viewed": 163, "favorited": 0, "accepted": 1, "lastupdate": "2017-08-15 13:35:51", "text": "article text", "submission_date": "2017-07-10 19:27:43", "author_id": 4, "has_video": 0, "is_headline": 1, "allow_comments": 1, "author": "John" }
Get multiple reviews offset by @pos. @limit is the maximum number of reviews to load.
GET Parameters:Returns: [ { "id": 65, "userid": 21, "placeid": 9, "text": "Review", "datecreated": "2017-08-14 12:40:15", "username": "Tom" } ]
Get a single review done by user for a place
GET Parameters:Returns: { "id": 62, "userid": 1, "placeid": 1, "text": "", "datecreated": "2017-08-13 12:03:36", "hasreview": true, "username": "Tom", "success": true } If place not reviewed by user yet: { "hasreview":false, "success":true }
Get multiple ratings offset by @pos. @limit is the maximum number of ratings to load.
GET Parameters:Returns: [ { "id": 78, "userid": 94, "placeid": 2, "rating": 5, "datecreated": "2017-08-14 12:58:31", "username": "Tom" } ]
Get a single rating done by user for a place
GET Parameters:Returns: { "id": 74, "userid": 1, "placeid": 1, "rating": 2, "datecreated": "2017-08-14 03:20:17", "hasrating": true, "username": "Tom", "success": true } If place not reviewed by user yet: { "hasrating":false, "success":true }
Get all categories
Returns: [ { "id": 1, "name": "Museums", "description": "", "image": "[\"149987854232.jpg\"]", "icon": "fa-ticket" }, { "id": 2, "name": "Restaurants", "description": "", "image": "[\"149987859231.jpg\"]", "icon": "fa-cutlery" } ]
Get a single category by id
Returns: { "id": 1, "name": "Museums", "description": "", "image": "[\"149987854232.jpg\"]", "icon": "fa-ticket" }
Get the preference value by it's @name. eg: /api/preference/info
Returns: Preference value
If you need any support,
----------------------------------------------------------------------------------------- Version 1 - July 18th, 2017 ----------------------------------------------------------------------------------------- - Initial Upload ----------------------------------------------------------------------------------------- Version 1.1 - August 15th, 2017 ----------------------------------------------------------------------------------------- - BUG - Fixed Admin dashboard. It was showing only the top Places submitted over the last 7 days. - BUG - Fixed GPS off error. The app now asks user to turn on GPS. - BUG - Fixed bug that was causing an error when 'View Deal' is clicked and browser could not be found. - BUG - Fixed bug that was causing an error when user open the map view and goes back to list view fast. - BUG - Solved a NullPointerException that was occuring when not all place's images had been cached and the place was opened without internet. - The Address, Phone, Email text was made clickable, not just the icon. ----------------------------------------------------------------------------------------- Version 1.2 - January 22nd, 2018 ----------------------------------------------------------------------------------------- - BUG - Mozilla was causing image upload issue. - BUG - 'No Items' was not being shown. - BUG - search fragment was reloading - Updated to Android Studio 3 ----------------------------------------------------------------------------------------- Version 1.3 - September 22nd, 2018 ----------------------------------------------------------------------------------------- - Update to API 27 - Open links in description in a new window - Bug Fix - Logout removed when user skips login - Bug Fix - Ratings & reviews where not editable from admin page - Bug Fix - 'Load more reviews' when no reviews removed - Privacy policy and Terms - Bug Fix - Push notification now supported on Android 8 when app is in foreground - Bug Fix - Scrolling in Splash screen for small screens ----------------------------------------------------------------------------------------- Version 1.4 - November 5th, 2018 ----------------------------------------------------------------------------------------- - Update to API 28 & migration to AndroidX - Billing Permission in AndroidManifest.xml commented - uncomment for extended license. - Bug Fix - Ratings & Reviews were displaying the user as null. Fixed in: Ratingscontroller.php and ReviewsController.php line 70. - Changed the order of jcenter() and google() - this was causing an issue with the latest Android Studio version. - Added Admob App id support ----------------------------------------------------------------------------------------- VERSION 1.5 – 9TH AUG 2019 ----------------------------------------------------------------------------------------- - Bug Fix – Fixed ‘Non-Numeric value encountered’ issue in reviews, ratings & news pages - Bug Fix – Places save even if no category is selected - Multidex enabled - Updated all app dependancies & updated facebook library to 5.0.0 - removed firebase instance service (deprecated by firebase) - Updated proguard - enabled usesCleartextTraffic by default to avoid issues on first run. It is recommended that you use https and disable this. - Updated fat free framework to version 3.6 - PHP 7.3.8 now supported!