Mark M. | has entered the room |
Mark M. | turned on guest access |
Sep 5 | 7:30 PM |
Andrea | has entered the room |
Mark M. |
hello, Andrea!
|
Mark M. |
how can I help you today?
|
Andrea |
Hello
|
Andrea |
I'm working on an app for my department
|
Andrea |
basically my app has to show the deadlines, the notes and the grades and some other functionalities
|
Andrea |
I was thinking of having a Main Activity with a Navigation Drawer
|
Andrea |
and for example in the navigaiton drawer I could have an item called "Notes"
|
Andrea |
that opens a ListFragment inside the main activity
with all the subject and clicking on a subject would show the notes (in
another fragment contained in another activity) of the subject
|
Andrea |
is this a good way?
|
Mark M. |
um, off the cuff, it seems fine
|
Andrea |
It's my first app and sometimes I get a bit confused
|
Mark M. |
a navigation drawer is designed to lead people to major content areas within your app
|
Sep 5 | 7:35 PM |
Mark M. |
your notes would seem to qualify
|
Mark M. |
I apologize for not covering the navigation drawer in the book yet
|
Mark M. |
I should get to it in the next update
|
Andrea |
don't worry
|
Andrea |
I'm still reading the fragment part
|
Andrea |
it's finally clarifying a lot of doubts
|
Andrea |
the books is really helping me a lot
|
Mark M. |
glad to hear it!
|
Andrea |
another question, I am supposed to get the data
from an api (not now, in the future). I will get the data in JSON form.
Should I save it inside the app and everytime the app refreshes checks
if there are new things? Is it possible?
|
Mark M. |
is it possible? presumably
|
Mark M. |
certainly, you can save JSON files, or copy the data into a database
|
Andrea |
perfect
|
Mark M. |
as to whether that is the appropriate way to write the app, that I cannot say
|
Mark M. |
it would depend a lot on the nature of the API and the data
|
Andrea |
and at the moment I still don't really know
|
Andrea |
I have another question
|
Andrea |
sorry if I am asking three thousands quesitons
|
Mark M. |
go right ahead -- it's a quite chat room this evening
|
Mark M. |
er, quiet
|
Sep 5 | 7:40 PM |
Andrea |
let's say I have a ListFragment (fragment 1)
containing the list of subject where each subject opens another fragment
with the notes of that subject. Then I want another ListFragment
(fragment 2) with the list of subjects but where each subject points to
the grades in that subject. Do I have to keep two different fragment or
fragment 1 and fragment 2 can be the same class?
|
Mark M. |
presumably they could be the same class
|
Mark M. |
use a flag to indicate what the appropriate action is when an item is tapped
|
Mark M. |
however, to me, this feels like you have a navigation issue
|
Mark M. |
there should only be one list
|
Andrea |
right
|
Mark M. |
clicking on an item in the list brings up details
|
Mark M. |
those details may be several fragments (e.g., in a ViewPager)
|
Andrea |
yes that is definitely a better navigation
|
Andrea |
so rather than having in the navigation drawer
both grades and notes I could have something like "subjects" and inside
each subject I could see the notes and the grades
|
Sep 5 | 7:45 PM |
Mark M. |
yes
|
Andrea |
thanks
|
Andrea |
last question I promise
|
Andrea |
for the grades for example, on the website we
don't have a complete list, they are added only after we take the tests.
For example at the start of the year the page grade is completely
empty, but after we take the first test it will appear a row with the
name of the subject and the grade
|
Andrea |
that means I don't really know what layout I should give to the grade page
|
Andrea |
do I have to do it programmatically? checking if there is a grade and if there is creating the widgets I need?
|
Mark M. |
is the row with the name of the subject and the grade clickable?
|
Mark M. |
if the user taps on this row, is something supposed to happen? or is it purely presenting the data?
|
Andrea |
I am just presenting the data
|
Andrea |
sorry I mean "name of the test"
|
Andrea |
not "name of the subject"
|
Mark M. |
then it sounds like a TableLayout or GridLayout would be the right layout choices, so you can have nice columns
|
Mark M. |
and yes, you would add the rows programmatically
|
Andrea |
ok perfect
|
Andrea |
now that I'm thinking again
|
Andrea |
rather than doing how I first thought (a list of
subject and from each item the grades in that subject), I could put a
grade item in the nav drawer and a page with all the grades?
|
Sep 5 | 7:50 PM |
Andrea |
how many rows would be too many for a table layout?
|
Mark M. |
technically, sure
|
Mark M. |
well, you would wrap the TableLayout in a ScrollView
|
Mark M. |
I'd keep the number of rows under 100 or so, just so your layout isn't too heavy memory-wize
|
Mark M. |
er, memory-wise
|
Andrea |
ok
|
Andrea |
Last year the items are around 70s
|
Andrea |
70*
|
Andrea |
thanks a lot
|
Andrea |
that clarified quite a lot
|
Mark M. |
you are very welcome
|
Andrea |
can I come to the future office hours as well?
|
Mark M. |
you most certainly may
|
Mark M. |
the calendar is on your Warescription page (except now while the chat is active)
|
Andrea |
thank! I'll keep reading the book and the app will be in a better position
|
Mark M. |
I usually hold two a week, though it varies based on my travel schedule
|
Andrea |
I added on the google calendar
|
Andrea |
see you next time :)
|
Mark M. |
see you later!
|
Andrea | has left the room |
Sep 5 | 8:30 PM |
Mark M. | turned off guest access |