Code

AskIt | Android Universal Questions/Answers App Template

AskIt | Android Universal Questions/Answers App Template









iOS, Android and Web versions can share the same database on back4app






25 May 2018
• Accordingly to the new EU GDPR terms, I've updated the 'tou.html' file and Documentation.
IMPORTANT: This means that if a User asks for his/her Account deletion, you must do it within 24 hours, as the GDPR's "Right to be forgotten" Article states (LINK: https://gdpr-info.eu/art-17-gdpr/)
17 May 2018
• Edited the 'question_cell.xml' file by replacing the Attachment Button with an ImageView and positioning it in the layout
• Edited the 'queryQuestions()' method Home.java and Search.java files by replacing the 'attachmentButt' with an 'attachment' ImageView instance, in order to show a preview of the questions attachments in the Home and Search screens
8 May 2018
• Changed Parse version in build.gradle into 1.16.0, due to some issue on the latest Parse SDK and FCM:
    implementation 'com.parse:parse-android:1.16.0'

• Edited 'getUserDetailsFromFB()' method in Login.java, this line of code:
    } else { currUser.put(Configs.USER_EMAIL,  facebookID + "@facebook.com"); }
24 April 2018
• Replaced AdMob banners code with Interstitial code in Home.java, Search.java and Answers.java | Adjusted the bottom edge of the views in their relative xml files
• Added a public static method called 'showInterstitial()' in Configs.java
• Changed AdMob variable in strings.xml:
    <string name="ADMOB_INTERSTITIAL_UNIT_ID">ca-app-pub-3940256099942544/1033173712</string>

• Changed Likes system by adding a new column of type 'Array' called 'likedBy' in the 'Answers' and 'Questions' classes in the Parse Dashboard
• Edited the 'queryQuestions()' method in Home.java and Search.java 
• Added a like button in 'answer_cell.xml' | Edited the Answers.java file accordingly by adding a 'likeButt()' method inside the 'queryAnswers()' method
• Added a like_butt.png and a liked_butt.png image in the drawable folder
• Edited the 'answerButt()' method in 'Answers.java' by adding this lines:
    List<String>empty = new ArrayList<>();
   aObj.put(Configs.ANSWERS_LIKED_BY, empty);
   aObj.put(Configs.ANSWERS_LIKES, 0);

• Edited the 'askButt()' method in 'Home.java' by adding this line:
   List<String>empty = new ArrayList<>();
   qObj.put(Configs.QUESTIONS_LIKED_BY, empty);

• Added the following lines in Configs.java:
   public static String QUESTIONS_LIKED_BY = "likedBy" 
   public static String ANSWERS_LIKED_BY = "likedBy" 
   public static String ANSWERS_LIKES = "likes" 

** IMPORTANT: IF THIS IS AN UPDATE FOR YOU, then you should do the following:
- Updated the code of your app by comparing your old java and XML files with the updated ones
- Enter your Pasre Dashboard and create a column of type 'Array', name it exactly 'likedBy' in the 'Questions' class
- Do the same for the 'Answers' class
- Check the 'Likes' class, the userPointer column has the objectId's of the users who liked questions, so you have to copy them and add them to the cells of the 'likedBy' column in your 'Questions' class as strings, they should look like this:
   ["yu76Gtrr4","hbg4ERs1"] 
You can recognize the row of a liked question by check its objectId in the 'questionPointer' of your Likes class
- For the 'Answers' class, you only need to fill all the empty cells of the 'likedBy' column with:
   []
PLEASE NOTE that the Likes class won't be used anymore, but you can still keep it in case some users won't update the app from the App Store.  
17 April 2018
• Added Firebase dependencies in build.gradle(Module:app)
• Removed the 'com.google.android.gms:play-services:+' and updated all dependencies to the required ones only 
• Added the 'google-services' classpath in the dependencies{} list in build.gradle(Project:)
        classpath 'com.google.gms:google-services:3.2.1'

• Added this Permission into Manifest.xml:
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />

• Updated the Documentation (connect your App to Firebase for GCM and Ads)
15 April 2018
• Updated to Android Studio 3.1.1
• Removed all dependencies of play-services | left only this one in build.gradle:
     implementation 'com.google.android.gms:play-services:+'
10 April 2018
• Updated to Android Studio 3.1
• Updated 'compileSdkVersion' and  'targetSdkVersion' to 27 in build.gradle
• Replaced 'compile' with 'implementation' in build.gradle (Module: app)
• Updated classpath 'com.android.tools.build:gradle:3.1.1' in build.gradle (Project:)
Feb 15th 2018 
• Removed the 'menu' folder and its content from the 'res' folder
• Edited the following files in order to remove ActionBars and show a better layout:
   Home.java and home.xml
   Answers.java and answers.xml
   Search.java and search.xml
   Account.java and account.xml
   EditProfile.java and edit_profile.xml


AskIt is a Universal App Template where you can post any question and have users answering, you can do the same on other user’s questions. Users can also like questions from the Home screen or search for something on the Search screen.

Since its backend is by Parse Server, you don’t have to buy any domain/hosting, there are NO PHP files to upload to a web server so you’ll save some money for server side.

AskIt is a native Android Studio project, Universal, Push Notifications for likes and answers, easy to customize, backend with Parse SDK hosted on http://back4app.com




About Parse Server and back4app

Read this article for more info about back4app and Parse SDK: https://hubpages.com/technology/Parse-SDK-will-not-shutdown-in-thanks-to-back4app

Can I host Parse Server on my own server?

Yes, although I don’t provide support for the setup process, you can read the official Guide here: http://parseplatform.org

What about free support for this template?

I can offer free support for bugs encountered in the original code. Instead, if you’ve edited the code and messed something up with it, I may apply some fee to fix it either via TeamViewer or by checking your app project files directly on my computer.

How do I rename the app’s package name?

Read this tutorial to learn how to rename a package name: https://hubpages.com/technology/Android-How-to-rename-an-app-package

Should I use the latest version of Android Studio to edit this template?

Yes, I always update my apps to the latest version of the IDE and you also should make sure you’ve updated the Android Tools to their latest version of the Android SDK manager.

The demo APK crashes on startup

Make sure that the minimum Android version of your device is the one listed in the FEATURES section below. If the problem persists, please contact me by my profile’s contact form and send me the Logcat message of you get when the app crashes along with the steps you made to reproduce the crash. Please note that not all real devices print an error Logcat message, in this case just run the APK into the Android Studio’s emulator and you’ll surely get the red messages about your issue.

How do I remove AdMob Interstitial ads?

Simply use the Find In Path tool in Android Studio and search for:
   Configs.showInterstitial
then comment out the lines that the Find tool has found





  • Android Studio 3.x – Universal – Android 5.0+
  • AdMob Interstitial ads
  • Facebook login
  • Post/answer/like questions
  • Attach an image to your Questions
  • Push Notifications for likes and answers through OneSignal
  • Report abusive contents (questions or answers)
  • Search for questions by keywords
  • PDF User Guide and PSD included
  • Easy to customize | Well commented code


  • Apple Mac or Windows PC with their latest OS version installed
  • The latest version of Android Studio and some knowledge about its UI interface
  • Photoshop or any other image editor software
  • A Google Developer account to submit apps to the Play Store
  • An AdMob account to generate your own banner UNIT ID
  • A free account on back4app.com









by
by
by
by
by
by