Office Hours — Today, September 5

Yesterday, September 4

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!
how can I help you today?
Andrea
Hello
I'm working on an app for my department
basically my app has to show the deadlines, the notes and the grades and some other functionalities
I was thinking of having a Main Activity with a Navigation Drawer
and for example in the navigaiton drawer I could have an item called "Notes"
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
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
7:35 PM
Mark M.
your notes would seem to qualify
I apologize for not covering the navigation drawer in the book yet
I should get to it in the next update
Andrea
don't worry
I'm still reading the fragment part
it's finally clarifying a lot of doubts
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
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
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
I have another question
sorry if I am asking three thousands quesitons
Mark M.
go right ahead -- it's a quite chat room this evening
er, quiet
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
use a flag to indicate what the appropriate action is when an item is tapped
however, to me, this feels like you have a navigation issue
there should only be one list
Andrea
right
Mark M.
clicking on an item in the list brings up details
those details may be several fragments (e.g., in a ViewPager)
Andrea
yes that is definitely a better navigation
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
7:45 PM
Mark M.
yes
Andrea
thanks
last question I promise
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
that means I don't really know what layout I should give to the grade page
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?
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
sorry I mean "name of the test"
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
and yes, you would add the rows programmatically
Andrea
ok perfect
now that I'm thinking again
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?
7:50 PM
Andrea
how many rows would be too many for a table layout?
Mark M.
technically, sure
well, you would wrap the TableLayout in a ScrollView
I'd keep the number of rows under 100 or so, just so your layout isn't too heavy memory-wize
er, memory-wise
Andrea
ok
Last year the items are around 70s
70*
thanks a lot
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
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
see you next time :)
Mark M.
see you later!
Andrea
has left the room
8:30 PM
Mark M.
turned off guest access

Yesterday, September 4

 

Office Hours

People in this transcript

  • Andrea
  • Mark Murphy