The Ultimate News App Template

Documentation version 2.3


Getting Started #back to top

This documentation will help you familiarise yourself with the 'Ultimate News App' 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 proceeding 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.

Setting up the admin Page #back to top


Before You Start

  • 1. Make sure your server supports PHP 5.6 and MySQL.

Uploading To Server

  • Step 1 - Put your database details (Host, database name, user name, and password) in config.ini. The fields are marked with red below. Also, replace the 'serverurl' with your server url and the 'sharetwittertag' with your twitter tag (used for sharing).

  • Step 2 - Upload the contents of the 'Server Side Code' to your server. Make sure you don't forget the .htaccess.

  • Step 3 - Create a new MySQL database and import 'NewsApp_database_v1.sql'.

  • Step 4 - Access the /index.php file that you just uploaded to your server, using your browser. The default login credentials are:
    										Username: admin
    										Password: pass
    				        			

Setting Firebase Push Notifications

  • Step 1 - Go to your Firebase Console, go to settings->cloud messaging and get your server key (API_ACCESS_KEY). Put this in config.ini. The field is marked with green above.

  • Step 2 - Admin Page Done!

Setting up the Android App#back to top


Before You Start

  1. Make sure your have Android Studio 4.0.1 installed and in the Android SDK Manager make sure you have the following installed:

    • Build tools v29.0.3
    • Androidx SDK Tools
    • Google USB Driver
    • Android API 29 SDK

  2. 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.


Importing and running

  • Step 1 - Open up Android Studio and click 'open an existing Android Studio project'.


  • Step 2 - Drag and drop the 'News App' folder in the dialog to go quickly to the folder.

  • Step 3 - Make sure 'News App' 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.


Changing Package name

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 - If a similar popup comes up, 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 'newsapp'. 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.newsapp'. This is shown below.


App Customisation

  • 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 News 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://newsapp.neurondigital.com/3


Replace icon and Images

  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.

  2. 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.


Admob Ads (Optional)

  • 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.

  • Get your publisher id from Admob and put it in the strings.xml file. This is used for the GDPR consent.

Add AdMob interstitial Ads (optional)

  • Create an interstitial Ad on AdMob and paste the AD unit Id in the strings.xml file. The Ad displays when the user clicks an article 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.


Add AdMob Banner Ads (optional)

  • 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 prevent annoying 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.


Google Analytics (Removed in v2.1 - Use Firebase Analytics instead)

  • Please note that the app already has firebase analytics. However, if you still want the legacy Google analytics, create a new google Analytics property and you'll be provided with a tracking id which should have this format: "UA-xxxxxxxx-xx". Put this tracking id in strings.xml in the 'google_analytics_id' field.



In-App Purchase

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:


Translation

  • All translatable text is contained within the strings.xml file.


Export your App as a .APK for Google Play

  • Go to Build| Generate Signed APK... and export the .APK file.


Mini-Web-App & Admin Page HTML Pages

  1. Go to Server Side code /Views/ folder.
  2. This folder contains the privacy policy, terms, mini web-app html (singleitem.htm)...
  3. For other Admin page ui changes such as the forms please take a look at Server Side Code/js/script.js.

You Are Done!

  • Make sure to keep up with the template updates and bug fixes on our facebook page.

Support Desk #back to top

If you need any support,

  1. First check the FAQ questions of the item on codecanyon
  2. If you don't find anything there check the item comments section.
  3. If you still don't find your answer it would be best to ask your question in the comments section for others to see.
  4. For private support, please send me a message via my Codecanyon page.

Support for my items includes:
  • * Responding to questions or problems regarding the item and its features
  • * Fixing bugs and reported issues
  • * Providing updates to ensure compatibility with new software versions
Item support does not include:
  • * Customization and installation services
  • * Support for third party software and plug-ins
Before seeking support, please...
  • * Make sure your question is a valid Theme Issue and not a customization request.
  • * Make sure you have read through the documentation and any related video guides before asking support on how to accomplish a task.
  • * Make sure to double check the template FAQs.
  • * If you have customized the template and now have an issue, back-track to make sure you didn't make a mistake. If you have made changes and can't find the issue, please provide us with your changelog.

Version History (Changelog) #back to top


						-----------------------------------------------------------------------------------------
						Version 1 - Jun 7nd, 2017
						-----------------------------------------------------------------------------------------

						- Initial Upload
                        
                        -----------------------------------------------------------------------------------------
						Version 2 - May 28th, 2018
						-----------------------------------------------------------------------------------------

						- Target updated to Api 27
                        - Updated Libraries
                        - Bug Fix : SQL database was updated to fix an issue when importing in recent versions of mysql
                        - Bug Fix : Facebook comments url fixed
                        
                        -----------------------------------------------------------------------------------------
						Version 2.1 - 21st Sept, 2018
						-----------------------------------------------------------------------------------------
                        - Privacy Policy & Terms both in Native App & in Web App
                        - Added Admob App id support
                        - Removed Google Analytics (To remove access to advertising id and comply with google Policy) – Use Firebase Analytics instead.
                        - Notifications Sent when an article is saved now open the article when clicked
                        
                        -----------------------------------------------------------------------------------------
						Version 2.2 - 5th Nov 2018
						-----------------------------------------------------------------------------------------
                        - Changed order of jCenter() and google() in build.gradle - This was causing an issue with latest Android Studio.
                        - Updated to Api 28 and Migrated to AndroidX
                        - Fixed icon issue in AndroidManifest.xml
                        - Removed extra unnecessary libraries for a faster build.
                        
                        -----------------------------------------------------------------------------------------
						Version 2.3 - 5th Nov 2020
						-----------------------------------------------------------------------------------------
                        - Updated to support Android Studio 4.0.1.
                        - Updated to Android API 29
                        - All Libraries updated
                        - Multidex enabled to allow for larger app source code.
                        - Added GDPR Ad consent
                        - Added GDPR Personalised Ads enable/disable in settings
                        - Fixed a bug on the server that was causing the firebase notifications not to be sent (https://neurondigital.freshdesk.com/support/solutions/articles/43000530959-push-notifications-not-working)