Android Examination App - Java for Android App Development

I'm going to fetch the questions and answers from my web server using JSON, this data are dynamic, sometimes a question has two or three answers, question type can be any combination of the following: multiple choice, true or false, identification, fill in the blanks etc.
The answer on how to do a dynamic layout on android is to let java takeover on adding layout and components instead of XML. (is this correct?)
How can I make my app to have one activity/view per question? Is this memory intensive? For example the data from the web server contains a hundred questions.
I want the user to have access to previous questions. For example I'm currently on question number 21 and I want to go back to question number 11 for some reasons, is this possible? How can I do this? (All questions are randomized)

clonedaccnt said:
I'm going to fetch the questions and answers from my web server using JSON, this data are dynamic, sometimes a question has two or three answers, question type can be any combination of the following: multiple choice, true or false, identification, fill in the blanks etc.
The answer on how to do a dynamic layout on android is to let java takeover on adding layout and components instead of XML. (is this correct?)
How can I make my app to have one activity/view per question? Is this memory intensive? For example the data from the web server contains a hundred questions.
I want the user to have access to previous questions. For example I'm currently on question number 21 and I want to go back to question number 11 for some reasons, is this possible? How can I do this? (All questions are randomized)
Click to expand...
Click to collapse
For your view, you'd make one Layout containing multiple TextViews whose texts you set only in your java code, that way it can have different questions.
Then there is a ListView for scrolling between the questions or for instance a ViewPager.
Remember to start with small components like the question screen and worry about getting the questions from the server and stuff later

Is there anybody else wants to share their insights on this?

clonedaccnt said:
Is there anybody else wants to share their insights on this?
Click to expand...
Click to collapse
Even though it may not seem like it, this is a very simple app...and it comes down to "simple" understanding of "listview,adapters,intents,asyncTasks,JSON/GSON" and then quite a simple design flow.... if you start to learn this most of what you need you will know and what you don't you will be able to ask direct questions about (cause you will have knowledge to do so)

Related

Advice on what to research and study to make app that connects to web services

Hello! overflowers? I'm a beginner android developer and I have developed several apps that use the "basics" of android and java (for college requirements)
Now, I need to develop a new project that consists of making a web app which stores the records of all students from my college and the students will be able to check their records and other information from the college from their android phones.
I have done a lot of stuff with Android but I haven't done anything incluiding web queries, pulling info from a website to display into the device, etc etc.
So I want some advice here and/or tutorials that focus on this.
also, I have some important questions: 1. Can I pull information from the actual website from my college? If so, do I need to recieve some sort of permissions?
2. In case of not being able to pull information from the actual website from my college (for any reason whatsoever, like them not giving me permissions to do this), I could create a website that imitates its behavior, I would appreciate some tutorial or guide which could help me to achieve this.
Your help is very appreciated.
Btw, excuse if I'm breaking a rule here but something is not making sense to me.. the forum title says Q&A but when I mark this as a question it says this is not Q&A. I am aware this might be moved somewhere else but I dont know where.
Granolaa said:
Hello! overflowers? I'm a beginner android developer and I have developed several apps that use the "basics" of android and java (for college requirements)
Now, I need to develop a new project that consists of making a web app which stores the records of all students from my college and the students will be able to check their records and other information from the college from their android phones.
I have done a lot of stuff with Android but I haven't done anything incluiding web queries, pulling info from a website to display into the device, etc etc.
So I want some advice here and/or tutorials that focus on this.
also, I have some important questions: 1. Can I pull information from the actual website from my college? If so, do I need to recieve some sort of permissions?
2. In case of not being able to pull information from the actual website from my college (for any reason whatsoever, like them not giving me permissions to do this), I could create a website that imitates its behavior, I would appreciate some tutorial or guide which could help me to achieve this.
Your help is very appreciated.
Btw, excuse if I'm breaking a rule here but something is not making sense to me.. the forum title says Q&A but when I mark this as a question it says this is not Q&A. I am aware this might be moved somewhere else but I dont know where.
Click to expand...
Click to collapse
I would look into hosting an sqlite3 database on a server, and access it to retrieve the data from within your app.
But the problem is, by default you cannot access an online database on Android, so you'll need to add some kind of RESTful interface, the easiest way probably being a php script which will retrieve the data from the database and return it into a JSON object for example, that you can then pull from within your app.
You'll need to expose some kind of syntax from your php script so that your app can request the data for a specific user (ie row X / column Y).
There's probably a better approach, but this is what comes to my mind.

Need help in making multiple choice question apps

Guys, I need help in making apps for multiple choice questions (mcq). Basically I want the apps to show the questions and we can answers by touching the correct answer. I have around 100 questions.
This gonna be my first app and I need someone to guide me or pinpoint me to the correct threads? I already have the android sdk btw. And whats the different between java and c++? Which one should I use in this kind of app?
Sent from my GT-N7100
Use Java. C++ is much more complicated and there wouldn't be any advantages if you used it in this case.
You need an Activity with one Textview for the question and one Button for each answer.
Then in Java get them using
Code:
findViewById(R.id.myid)
There you can dynamically set their texts:
Code:
myTextView.setText("This is the question");
myButton.setText("Answer 1");
But if you really want to make this app, learn Java first and then have a look at the Android things.

How do I add custom functions to app engine endpoints?

I want to add a custom method to my server-side code because I want the server to do some of the work. As I understand it is not possible to do in the Entities code something like
Code:
setCustomTimestamp(long customTimestamp) {
this.customTimestamp = new Date().getTime();
}
It gets simply ignored by Android Studio, that in response to that code, generates this
Code:
setCustomTimestamp(long customTimestamp) {
this.customTimestamp = customTimestamp;
}
So there must be some kind of convention to follow but at this point I don't know which one.
I need to do this because, for example, time is not the same between different devices, so I want the server to figure out the date and modify the timestamp variables.
So the question is, where should I put code that I want executed by the server, that is bound to a single Entity (like setting the updatedAt timestamps). I need to do this, because the date on different devices could not be the same. Maybe they like doing maths and figure out the current day every time.
Google shows only examples about really simple Entities, and on the web I found no examples of doing this inside of the Google App Engine framework.
It's a really simple question but I was surprised not finding anything on google about that. Also, I'm starting now to look into this app engine world, so please forgive me if the question is not well posed. Just give me what you want to know and I'll post it here. Thank you.
No one has any idea?
If its your website and/or you have access to it, make your posts have a specified template. Call the same method for all of them from your app.
Or you can check the source from your browser, and make a custom parser for it like I did for this a few days ago.

[Q] Regarding layout and storing of data

Hi there, I'm in the middle of building an app with the same navigation structure as this app which involves a list of items which when clicked displays details pertaining to that item in another layout.
So I wanted to ask a few questions:
1) Which is better?
a) To use fragments, one for the listView and another one to display the details.
b) To use 2 separate activities for each layout and to pass data using intents to handle selection.
2) What is a better way to store data in this case? JSON or SQLite? Can you please briefly explain why?
Thanks for your time.
K12 said:
Hi there, I'm in the middle of building an app with the same navigation structure as this app which involves a list of items which when clicked displays details pertaining to that item in another layout.
So I wanted to ask a few questions:
1) Which is better?
a) To use fragments, one for the listView and another one to display the details.
b) To use 2 separate activities for each layout and to pass data using intents to handle selection.
2) What is a better way to store data in this case? JSON or SQLite? Can you please briefly explain why?
Thanks for your time.
Click to expand...
Click to collapse
1) A: Fragments as its easier to create large screen (tablet/phablet) layouts for fragments as you can have them side-by-side
2) SQLite - fast, easy to store and get data from, easy to code for, compact.
Jonny said:
1) A: Fragments as its easier to create large screen (tablet/phablet) layouts for fragments as you can have them side-by-side
2) SQLite - fast, easy to store and get data from, easy to code for, compact.
Click to expand...
Click to collapse
Regarding 2),
If I want to make the app accessible to people of different languages, which would be a better approach?
a) To create separate databases for different languages.
b) To create one database with the relevant tables for different languages.
K12 said:
Regarding 2),
If I want to make the app accessible to people of different languages, which would be a better approach?
a) To create separate databases for different languages.
b) To create one database with the relevant tables for different languages.
Click to expand...
Click to collapse
I would go for having one database and relevant tables for the different languages.

Can't Decide A Layout For My Android Examination

I am going to develop an android examination but I can't decide what kind of layout to use, the app will contain different type of questions(randomized), identification, multiple choice, matching, and true-false. Different examination types are commonly organized by category on a paper-based examination. The exam must also have a timer which is available on every view of the app. I want to give the user the functionality to get back on the questions that he/she skipped. How I am going to send the data back to the web server after.
Thank you and God bless!
Guys, I really need some help here.
Relative Layout is a good one always
clonedaccnt said:
I am going to develop an android examination but I can't decide what kind of layout to use, the app will contain different type of questions(randomized), identification, multiple choice, matching, and true-false. Different examination types are commonly organized by category on a paper-based examination. The exam must also have a timer which is available on every view of the app. I want to give the user the functionality to get back on the questions that he/she skipped. How I am going to send the data back to the web server after.
Thank you and God bless!
Click to expand...
Click to collapse
I would go with a RelativeLayout and then for the multiple choice a LinearLayout and maybe a FrameLayout for the going back and forth between questions and what not. Honestly , I would wait to send the info to the web server till the exam is done. So I would set up a timer lets say 30 seconds per question and if they don't answer it in time it automatically moves on and lets say at the end you were able to answer other questions faster and the total time isn't equal too 10 mins then the spare time they have can be used on questions they weren't able to answer in time and once that is done i would submit it to the server this way they don't use battery like crazy.
Relative Layout.
clonedaccnt said:
I am going to develop an android examination but I can't decide what kind of layout to use, the app will contain different type of questions(randomized), identification, multiple choice, matching, and true-false. Different examination types are commonly organized by category on a paper-based examination. The exam must also have a timer which is available on every view of the app. I want to give the user the functionality to get back on the questions that he/she skipped. How I am going to send the data back to the web server after.
Thank you and God bless!
Click to expand...
Click to collapse
A list of questions is perfectly suited for a linear layout (vertical). Inside the linear layout you could use a second linear layout (horizonal) to separate different parts of your question that should go next to each other.
This typically gives you the cleanest view.
Parts that do not fit a linear layout can be put in a relative layout. In most applications you will end up with several nested lay-outs.
Finally, are you designing for phone or tablet? For the latter, you may consider using frames, where you have the questions in one frame and other information (buttons, options, settings, login) in another. This creates a much nicer and cleaner overall application (otherwise your screen is filled with the questions only, which is a waste of good screen space).
Check the layout section on the google developer website (via training). I think this is useful for you.

Categories

Resources