Office Hours — Today, August 25

Tuesday, August 23

Aug 25
8:55 AM
Mark M.
has entered the room
Mark M.
turned on guest access
9:10 AM
ndrocchietto_ivano
has entered the room
Mark M.
hello, Ivano!
how can I help you today?
ndrocchietto_ivano
Hey Mark Good morning! Today....
would like to know about Retrofit2+RXJAVA is a small question, but on the book is not managed does it fine with you?
is about where to put the Subscriber to retrieve the object with the JSON reply
I eliminated onResponse
Mark M.
I cannot really help on RxJava questions
ndrocchietto_ivano
and does not work even if I put a Log is not retrieved
OK
Mark M.
I have played with it a bit, but nowhere near enough to be in position to help others
ndrocchietto_ivano
I am really focused on that at the moment
9:15 AM
Mark M.
in 2017, I may be in better position to help
ndrocchietto_ivano
I understand is a huge topic with houndreads of operators, but I want to take advantage and specialize on that
OK I am going to study roboelectric/mockito/Junit session and will come back to you with some testing question that is also a topic that I want to master
Mark M.
um, OK
I may not be able to help there much either, as I stick mostly to instrumentation testing
ndrocchietto_ivano
in the meantime as architectural way to proceed
OK
I want to update my todolist application with a backend, i decided to use PHP... and...
I have some doubt regarding the architecture. basically it is not clear to me where I should update the app to maintain sync the content using sqlite internally and a content provider. where is best practice to put a POST request, and when a GET?
9:20 AM
Mark M.
I highly doubt that there is a single "best practice" here
ndrocchietto_ivano
I have a fragment that update the db internally running queries to the content provider inside the fragment
basically I guess the steps should be.. 1) create a PHP service where to put an SQL DB. 2) update the DB on back end if user did not do in the past 3) add a POST <WHERE???> every time there is a modification in the DB 4) adding a GET everytime the app is opened instead to pass to the DB.
Mark M.
all of that, particularly steps 3 and 4, are very dependent upon how you want your app to work
ndrocchietto_ivano
I am afraid 3 could not work because user does not have connection to internet, so that cannot post, in this case what I should do? put in onStop cycle a request to the DB? and if still there is any internet connection?
9:25 AM
Mark M.
"in this case what I should do?" -- keep track of what changes still need to be delivered, and arrange to do them sometime in the future (e.g., JobScheduler)
ndrocchietto_ivano
mmh
Mark M.
for example, perhaps you have a lastUpdated timestamp or something on relevant database rows
and you also track somewhere your last successful sync timestamp
then, at the next sync point, you need to deliver everything that is newer than the last successful sync timestamp
where "the next sync point" might be attempted in real time (if the user is actively in your app) or periodically (e.g., JobScheduler)
ndrocchietto_ivano
I start to shed some light
Mark M.
presumably, you plan on this same data being updated by the user by other means (e.g., Web app), otherwise there is no reason for the backend in the first place
in that case, you also have to push changes from the backend to the device
that could be GCM/FCM, MQTT, or just periodic polling
9:30 AM
ndrocchietto_ivano
I see
Mark M.
with periodic polling as a fallback even if you optimize using some sort of push messaging solution (e.g., GCM/FCM, MQTT)
as those are not absolutely guaranteed to work
but, if instead, your backend is really just for a data backup, without live editing, then perhaps you do not update the backend live ever, settling for a nightly backup job
ndrocchietto_ivano
you gave me enough terms to run an extensive research: GCM, FCM, MQTT, sync timestamp, sync point. It was really hard for me to find some terms on my favorite search engine.
Mark M.
this is why I wrote that I highly doubt that there is a single "best practice"
of those, you will have the roughest time finding stuff on "sync timestamp" and "sync point"
those are fairly generic terms for which I expect there are many alternatives
GCM=Google Cloud Messaging, recently rebranded as FCM=Firebase Cloud Messaging
I forget exactly what MQTT stands for, but that's easily searchable
ndrocchietto_ivano
firebase sucks for my purposes
because I have complex queries
Mark M.
despite the branding, AFAIK, FCM is at best loosely coupled to the Firebase hosted database solution
ndrocchietto_ivano
and firebases offer only a limited way to query, because is a NOSQL technology
Mark M.
"Firebase" is becoming Google's overall brand for "hosted developer-focused services"
with the original Firebase database solution being just one of those
ndrocchietto_ivano
I see, google want to maintain this product because will become the google analytics of the apps
OK
9:35 AM
ndrocchietto_ivano
I will try to look for tutorials PHP android
should be a good starting point I guess
I need to make things easy because I tend to make complex everything, and this is not good as my aim is to work in teams
have a nice day and see you soon!
and of course thanks
Mark M.
you are very welcome
10:00 AM
Mark M.
that is a wrap for today's chat
the transcript will be uploaded to https://commonsware.com/office-hours/ shortly
the next chat is Saturday, 7:30pm US Eastern
have a pleasant day!
ndrocchietto_ivano
has left the room
Mark M.
turned off guest access

Tuesday, August 23

 

Office Hours

People in this transcript

  • Mark Murphy
  • ndrocchietto_ivano