Posts

Showing posts from July, 2018

Create a simple quiz app using Json in Sketchware

Image
To create a simple quiz app using Json String in Sketchware, follow the steps given below. 1. Create a json array containing all the questions and options. Each object in the array should contain a question with key ' ques ', four options for the question with keys ' a ', ' b ', ' c ' and ' d ', and the correct answer with key ' ans '. [ { "ques" : "The larynx in adults lies in front of hypopharynx opposite the...", "a" : "second to fifth cervical vertebrae", "b" : "fifth to seventh cervical vertebrae", "c" : "third to sixth cervical vertebrae", "d" : "first two cervical vertebrae", "ans" : "c" }, { "ques" : "Which of the following is the largest cartilage of larynx?", "a" : "thyroid cartilage", "b" : "cricoid cartilage", "c" : ...

Sort Firebase data for Android project

Image
If your firebase data contains same keys at each position, as shown in image below, then you can follow the steps below for sorting the data before displaying it in an app created in Sketchware. 1. In your Sketchware project, add a ListView listview1 . 2. Create a CustomView custom.xml . In this View add TextViews for displaying data at each position in Firebase database. 3. In properties of listview1 select custom.xml as customView. 4. Add a new List Map  maplist . 5. Add a FirebaseDB component with any name, and with data location same as in your Firebase database. ( fdb: results ) 6. Add ListView onBindCustomView event. In this event use blocks for displaying the data from List Map  maplist  in ListView listview1 . 7. Save and run the project. 8. Delete the installed app. 9. Export source code of this project. Unzip it in a folder on sdcard. 10. Open the project in AIDE. 11. In app level build.gradle  file, in dependencies, chang...