Android News App Documentation

35 min


3
3 points
The Complete Swift iOS Developer, Create Real Apps in Swift, iOS Developemnt In Swift Course, Swift iOS Online Course, Free Course Swift iOSAndroid News App, Android News App Documentation, Android News App Android Studio Documentation,,

Android News App Documentation

 


Welcome

Thank you for purchasing our app. If you have any questions that are beyond the scope of this help file, please feel free to email via my user page contact form here: [email protected]

If you need help support related to app configuration or documentation, please write your support request via email with the format :

  • Email subject: Codecanyon username – Item purchase code

  • Email body: Describe your problem as clearly as possible.

You can see our other item here: https://codecanyon.net/user/solodroid/portfolio


Getting Started

Download and Install Java This section very important for you if this is the first time develop android, if you already develop an android project you can SKIP this page.

Download and Install Java

You can download the latest JDK from this URL: http://www.oracle.com/technetwork/java/javase/downloads/index.html

Download JDK

Download and Install Android Studio

You can download the latest Android Studio from this URL: https://developer.android.com/studio/


Import Project

Extract .zip you download from Codecanyon, you will see some file and folder. We named the project folder with “ AndroidNewsApp“, the project location inside the android_studio folder.

When your Android Studio ready you can open it and you will see a display like this :

  1. select “Import project (Gradle, Eclipse ADT, etc.)“.

  2. Browse location Project and press “OK” button.

3. Wait for few minutes until all process import has finished.


Generate google-services.json

Before you do step change the package name, you must do this step for firebase project configuration

Please note : this step is mandatory to generate google-services.json file

Visit Firebase Console

Please register or log in first and then select create new project. In the dialog window enter the name of the project that will be created and the contents of the state and then click the create project to continue.

After successfully creating a project on Firebase then the page will be redirected to the dashboard project that has been made.

Then on the dashboard Firebase select Add Firebase to your Android app. In the next dialog window enter the name of the Android application package and SHA1 of fingerprints Certificate (optional).

Next will download the configuration file json google-services.json automatically, which will be added in the directory app in the Android project.


Package Name

Step 1

  1. Open Gradle Scripts → build.gradle (Module: app)

  2. Change the application ID with your own id name

  3. Standard naming procedure : com.yourdomainname.yourappname

  4. Click Sync Now.

  5. Change the id as unique as possible, because application id is very important used if you want to publish the application to google play.

Important: your applicationId or package name must same as your package name that you’ve created on the firebase console when you generate google-services.json

Step 2

  1. Click once on your package and then click the setting icon on Android Studio.

  2. Close / Unselect Compact Empty Middle Packages

  3. Right-click your package and rename it.


OneSignal Configuration

Required For Setup

Gradle Setup

  • Open your app/build.gradle (Module: app) file, add the following to the very top.

  • Update onesignal_app_id value in manifestPlaceholders with your OneSignal app id

Keys & IDs Setup

  • Login to your OneSignal Account and select your app

  • Select SETTINGS > Keys & IDs to get your OneSignal APP ID and REST API KEY

  • Login to your Admin Panel, replace FCM Server Key, OneSignal APP ID and OneSignal REST API KEY with yours.


Server Connection

When your admin panel already configured properly, you can connect it to your android app, select java/<your_package_name>/config/AppConfig.java, and put your admin panel URL and API key in the ADMIN_PANEL_URL & API_KEY string tag for server connection and security purpose.
//put your admin panel url here
public static final String ADMIN_PANEL_URL = “http://10.0.2.2/android_news_app”;
//your api key which obtained from admin panel
public static final String API_KEY = “XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX”;

Ad Network

Version 4.2.0 or Above

Starting Android News App 4.2.0, Ad Network is managed from admin panel and we provide 3 option for Ad Network providers (AdMob, Facebook Audience Network, and StartApp).

  • You can switch to use Ad Network according to your needs

  • You deactivate a particular ad by giving the value 0 on the ad id form

  • You can completely deactivate the ad by set OFF in the Ad Config form

IMPORTANT: Especially for AdMob, Your AdMob App ID must be added programmatically inside Android Studio Project in the AndroidManifest.xml


Ad Network (Deprecated) ⊘

Deprecated or version below 4.2.0

Deprecated :

Starting Android News App 4.2.0, Ad Network is managed from admin panel and we provide 3 option for Ad Network providers (AdMob, Facebook Audience Network and StartApp), the configuration moved to HERE.

Configure AdMob Ads Unit ID

  1. Login to your AdMob account, create an app and generate your ad unit id

  2. Change the ID in res/value/string.xml

<!–AdMob–>
<string name=”admob_publisher_id>pub-3940256099942544</string>
<string name=”admob_app_id>ca-app-pub-3940256099942544~3347511713</string>
<string name=”admob_banner_unit_id>ca-app-pub-3940256099942544/6300978111</string>
<string name=”admob_interstitial_unit_id>ca-app-pub-3940256099942544/1033173712</string>
<string name=”admob_native_unit_id>ca-app-pub-3940256099942544/2247696110</string>

Enable /Disable Ads

  1. to enable or disable ads, you can see on the java/<your_package_name>/config/AdsConfig.java file

  2. set “true” value to enable ads or set “false” value to disable ads.


AdMob GDPR

What is GDPR?​

To comply with GDPR regulation you must configure some data :

AdMob publisher ID Here how you can found your Admob publisher id: https://support.google.com/admob/answer/2784578?hl=en​ Then change publisher Id in res/value/string.xml

<string name=”admob_publisher_id>pub-3940256099942544</string>

Privacy Policy Url To meet GDPR regulation you also must provide your own privacy and policy url, you can use generator like this : https://app-privacy-policy-generator.firebaseapp.com/ or you can use other tools, after generate you can upload into your hosting or anywhere so user can view it.

Then please change privacy_policy_url in res/value/string.xml

<string name=”privacy_policy_url>https://www.solodroid.net/privacy…….</string>

Funding Choices

As default, the app using Legacy GDPR, if you want to enable AdMob GDPR with your Funding Choices account, in the Config.java file, set false value in the USE_LEGACY_GDPR boolean tag :

public static final boolean USE_LEGACY_GDPR_EU_CONSENT = false;

New AdMob GDPR managed and linked with Funding Choices account, go to Privacy & messaging in the AdMob UI and select Go to Funding Choices. The Funding Choices account is then created automatically in the background. Steps to activate Funding Choices to display the GDRP form correctly.

Login to your AdMob account and select Privacy & Message > click button GO TO FUNDING CHOICES

You will be directed to the funding choices page, then a list of your applications will be displayed.

Select one of your applications for which you want to activate the GDPR.

Select Consent details

Fill form in the Consent details and then click Save

  • Consent Framework : IAB Europe Transparency and Consent Framework

  • Privacy policy URL : insert your app privacy policy url on there

  • Vendors associated with your app : You need to add each ad technology provider that receives your users’ personal data and provide information about the use of that data. Select a commonly used list of ad technology providers

After you have click Save, you will redirected back to your application page and then Create your first message.

Fill form in the EU Consent Message and then click Continue

  • Message name : your message name, e.g : NewGDPR

  • Message Language : your message language, e.g : English

  • Select the consent choices your users see : Consent / Manage options

Customize your consent UI display or leave it by default and click Save

Click publish to activate your AdMob GDPR consent form


UI Configuration

some features in the application can be enabled or disabled as you wish by giving the value “true” to enable or giving a value “false” to disable, you can see on the java/<your_package_name>/config/UiConfig.java file

//layout configuration
public static final boolean ENABLE_FIXED_BOTTOM_NAVIGATION = true;
public static final boolean ENABLE_POST_COUNT_IN_CATEGORY = false;
public static final boolean FORCE_PLAYER_TO_LANDSCAPE = false;
public static final boolean ENABLE_DATE_DISPLAY = true;
public static final boolean DATE_DISPLAY_AS_TIME_AGO = false;
public static final boolean ENABLE_EXIT_DIALOG = false;
//disable comment
//if comment disabled, login and register feature will be disabled too
public static final boolean DISABLE_COMMENT = false;
//news description configuration
public static final boolean ENABLE_TEXT_SELECTION = true;
public static final boolean OPEN_LINK_INSIDE_APP = true;
//push notification
//if it disabled, all previous received notification will not updated and still displayed in the status bar
public static final boolean UPDATE_PREVIOUS_NOTIFICATION = false;
//if you use RTL Language e.g : Arabic Language or other, set true
public static final boolean ENABLE_RTL_MODE = false;
//EU Consent
public static final boolean USE_LEGACY_GDPR_EU_CONSENT = false;
//load more for next news list
public static final int LOAD_MORE = 20;
//splash screen duration in millisecond
public static final int SPLASH_TIME = 2000;

Get YouTube API Key

  • Go to Google Developers Console and log in with your Google account.

  • Create the new project (name does not matter for the plugin).

  • Go to your project (by clicking on its name in the list).

  • In the sidebar on the left, expand APIs & Services → Library. In the list of APIs go to YouTube Data API (v3) and make sure that it’s enabled (Enable API).

  • In the same sidebar click Credentials. Then click on Create New Key and choose API key.

Android News App v4.2.0 or above

  • Copy API key and paste it to admin panel Settings menu in the youtube_api_key field

Android News App v4.1.0 or below

  • Copy API key and paste it to Strings.xml in the youtube_api_key string tag


Change App Logo

  1. Open Android Studio → File → New → Image Asset

  2. You can choose 2 types of your icon type, that is Launcher Icon (Adaptive and Legacy) or (Legacy Only)

  3. Recommended to use Launcher Icon (Adaptive and Legacy)

  4. Browse and choose your image file icon (.png) format with square dimension and start customize your icon

  5. Make sure the resource name is “ic_launcher” → Next → Finish


Change App Color

  1. to change the app color, you can see on the res/values/colors.xml

  2. Enter your color code inside each of strings tag :

<!–app main color–>
<color name=”colorPrimary>#2196F3</color>
<color name=”colorPrimaryDark>#1E88E5</color>
<color name=”colorAccent>#4aafff</color>

Text Assets

The text asset consists of the application name of another text component inside the app, to change it :

  1. You can see on the res/values/strings.xml

  2. Change value name in each strings tag according your needs.


Image Assets

The image asset consists of the splash image and another image component inside the app, to change it :

  1. Open res/values/drawable and replace with your image or icon, all image are placed on the drawable-hdpi folder

  2. you also can change every image in app like via Explorer, open Explore and go to your project directory, select AndroidNewsApp/app/src/main/res/drawable-hdpi

  3. Replace every image which you need to custom the application and highly recommended you using same resolution for each image



Like it? Share with your friends!

3
3 points
Choose A Format
Personality quiz
Series of questions that intends to reveal something about the personality
Trivia quiz
Series of questions with right and wrong answers that intends to check knowledge
Poll
Voting to make decisions or determine opinions
Story
Formatted Text with Embeds and Visuals
List
The Classic Internet Listicles
Countdown
The Classic Internet Countdowns
Open List
Submit your own item and vote up for the best submission
Ranked List
Upvote or downvote to decide the best list item
Meme
Upload your own images to make custom memes
Video
Youtube, Vimeo or Vine Embeds
Audio
Soundcloud or Mixcloud Embeds
Image
Photo or GIF
Gif
GIF format