Office Hours — Today, December 28

Thursday, December 22

Dec 28
9:55 AM
Mark M.
has entered the room
Mark M.
turned on guest access
10:05 AM
Maria
has entered the room
Maria
Hello
Mark M.
howdy, Maria!
how can I help you today?
Maria
I want my server to send resized images to the phone and I'm wondering how/where I can find what is the right resolution and screen size for any particular phone.
Mark M.
that's impossible to answer in the abstract
10:10 AM
Mark M.
insofar as I do not know what your business rules are for "right resolution and screen size"
Maria
suppose the phone is 5x7 and the resolution is 240 dpi
then the image I send should be that size or less
Mark M.
5 what by 7 what?
Maria
inches
Mark M.
you won't know that a phone is 5x7
Maria
?
Mark M.
DisplayMetrics will tell you sizes in pixels
Maria
ok
and what will tell me the resolution?
Mark M.
and Configuration (or DisplayMetrics? I forget) will tell you density
Maria
ok
that was my question
Mark M.
DisplayMetrics will tell you sizes in pixels (a.k.a., resolution)
10:15 AM
Mark M.
is there anything else with which I can help you?
Maria
I'm not sure.
I'm reading about DisplayMetrics.
Mind if I hang out in case anyone else shows up?
Mark M.
sure, no problem
Maria
Ok.
Mark M.
odds are things will be fairly quiet, given the holidays
Maria
sure
10:30 AM
Raza R.
has entered the room
Mark M.
howdy, Raza!
Maria
Hi Raza
Mark M.
how can I help you today?
Raza R.
Hello everyone
i want to know that which one is best SQLite or JSON?
10:35 AM
Mark M.
I cannot answer that without knowing what criteria you are using to judge "best"
and how you intend to use them
Raza R.
i want to fetch list of client house from the app and every month the data will change
Mark M.
where is this list?
Raza R.
on web server
Mark M.
well, publish it in JSON on the Web server and download it
if you need to do things like searches, and the data structure looks like tables, consider importing the JSON into a SQLite table (or set of tablets)
if you do not need to do things like searches, just leave the JSON alone and use it directly
Raza R.
is it possible to insert JSON data into SQLite??
Mark M.
SQLite knows nothing about JSON
you could just put the JSON into a TEXT column
but I do not know why you would bother
you could read in the JSON, parse the data, and insert/update rows with more discrete columns
however, you only need to do that if you will actually be using those columns for something (e.g., queries)
otherwise, just leave the JSON alone and use it directly
10:40 AM
Derrick C.
has entered the room
Mark M.
howdy, Derrick!
Derrick C.
Hi
Thanks for you help just now
Mark M.
you are most welcome
do you have an Android development question?
Derrick C.
currently no
Mark M.
OK
Derrick C.
i have not start yet
Mark M.
these chats are mostly to answer questions
you are welcome to hang out in the chat room if you like
Derrick C.
is this book useful for beginners?
Mark M.
if anyone has a question, just ask
Derrick C.
i have not done programming before
Mark M.
the books assume that you know Java
and have a reasonable amount of programming experience
Derrick C.
ic
Maria
I have a question but I don't know if you can help me or not.
Mark M.
you will need other resources to learn Java
Maria: go ahead
Derrick C.
i know a bit of java
may i know which country are u from?
Mark M.
Derrick: I live in the United States
10:45 AM
Derrick C.
icic...
Maria
I bought a samsung galaxy tab and sometimes when I connect it via the USB an app runs that asks if I want to mount the card but not always. Do you know what is going on there? Would plugging int the cable trigger and intent and you would need to have the application running to catch it?
trigger an intent
my typing is bad
Raza R.
IS is possible to compress the size of the app without breaking the app??
Mark M.
Maria: there are various ACTION_MEDIA Intents that are broadcast
Maria
Lately I've just been ignoring the mount sequence and using adb to push or pull files
Ok thanks
Mark M.
Maria: however, AFAIK, none are invoked simply because the USB cable is plugged in -- what you are seeing is an OS thing AFAIK
Raza: Using ProGuard will reduce the size of the app somewhat
Raza: done right, it will not break the app
Raza R.
any tutorial on icon design??
Mark M.
Raza: I have no tutorials on icon design, as I do not do icon design -- I have no particular graphics skills
the documentation covers icon design guidelines: http://developer.android.com/guide/practic…
however, they are written for people who know Photoshop
Raza R.
haha All programmers have same problem, they don't know how to design :)
10:50 AM
Mark M.
there is also the Android Asset Studio: http://android-ui-utils.googlecode.com/hg/…
that site will take simple clip art and help convert it into icons meeting the design guidelines
Raza R.
thanks
Did you cover JSON parsing in the books??
Mark M.
actually, no, now that I think about it
or at least, not much
there are two parsers
the org.json classes existed from the beginning of Android
Android 3.0 added JSONReader
the difference is roughly similar to DOM versus SAX
JSONReader is much faster, but it is up to you to hold onto whatever data you want
and, of course, it only works on API Level 11 and higher
10:55 AM
Raza R.
that's bad m targeting API level 10
Mark M.
personally, I haven't found the org.json stuff to be terribly slow
of course, it depends on how big the file is
again, it is similar to DOM versus SAX -- while DOM is much slower, that does not mean that you cannot use the DOM anywhere
Raza R.
you should cover some article on your books like JSON, Google API java client etc
Mark M.
I should add more JSON coverage
I will probably eventually cover the Google API client, now that they have an Android-specific library
Raza R.
yup
Mark M.
I have a very long to-do list for the books
Raza R.
any idea how JSON parser perform on EDGE connection??
Mark M.
parsers have nothing to do with network speed
Raza R.
ok
11:00 AM
Raza R.
what's the criteria to short SQLite result based on location?? like nearest place come first
Mark M.
we are running out of time -- any last questions?
that is not easy
Maria
Thanks for you help and time Mark
Mark M.
if the locations are all nearby, you would effectively have to encode the Pythagorean theorem (square root of the sum of the squares of the longitude and latitude differences)
Derrick C.
has left the room
Mark M.
if the locations are significantly far apart, you have to start taking curvature of the Earth into account, using great circle calculations
Raza R.
my app reflect places from all over the country
Mark M.
there are algorithms for this online
how big is your country? :-)
Raza R.
India
Mark M.
that's pretty big
Raza R.
yup
Mark M.
for best accuracy, great circle calculations would be better
Raza R.
any link for that algo??
Mark M.
nothing handy, sorry
actually
there is a distanceBetween() method on Location that handles it
I had forgotten about that
Raza R.
last question how i save this chat conversation??
Mark M.
that wraps things up for today's chat
Raza: the transcript will be posted to the cw-android Google Group
Maria
Bye all
Mark M.
the next chat is tomorrow, 7:30pm US Eastern Time
Maria
has left the room
Mark M.
have a pleasant day!
Raza R.
Bye
Raza R.
has left the room
Mark M.
turned off guest access

Thursday, December 22

 

Office Hours

People in this transcript

  • Derrick Chua
  • Maria
  • Mark Murphy
  • Raza Rahil Hussain