Dec 28 | 9:55 AM |
Mark M. | has entered the room |
Mark M. | turned on guest access |
Dec 28 | 10:05 AM |
Maria | has entered the room |
Maria |
Hello
|
Mark M. |
howdy, Maria!
|
Mark M. |
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
|
Dec 28 | 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
|
Maria |
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
|
Maria |
and what will tell me the resolution?
|
Mark M. |
and Configuration (or DisplayMetrics? I forget) will tell you density
|
Maria |
ok
|
Maria |
that was my question
|
Mark M. |
DisplayMetrics will tell you sizes in pixels (a.k.a., resolution)
|
Dec 28 | 10:15 AM |
Mark M. |
is there anything else with which I can help you?
|
Maria |
I'm not sure.
|
Maria |
I'm reading about DisplayMetrics.
|
Maria |
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
|
Dec 28 | 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
|
Raza R. |
i want to know that which one is best SQLite or JSON?
|
Dec 28 | 10:35 AM |
Mark M. |
I cannot answer that without knowing what criteria you are using to judge "best"
|
Mark M. |
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
|
Mark M. |
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)
|
Mark M. |
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
|
Mark M. |
you could just put the JSON into a TEXT column
|
Mark M. |
but I do not know why you would bother
|
Mark M. |
you could read in the JSON, parse the data, and insert/update rows with more discrete columns
|
Mark M. |
however, you only need to do that if you will actually be using those columns for something (e.g., queries)
|
Mark M. |
otherwise, just leave the JSON alone and use it directly
|
Dec 28 | 10:40 AM |
Derrick C. | has entered the room |
Mark M. |
howdy, Derrick!
|
Derrick C. |
Hi
|
Derrick C. |
Thanks for you help just now
|
Mark M. |
you are most welcome
|
Mark M. |
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
|
Mark M. |
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
|
Mark M. |
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
|
Mark M. |
Maria: go ahead
|
Derrick C. |
i know a bit of java
|
Derrick C. |
may i know which country are u from?
|
Mark M. |
Derrick: I live in the United States
|
Dec 28 | 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?
|
Maria |
trigger an intent
|
Maria |
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
|
Maria |
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
|
Mark M. |
Raza: Using ProGuard will reduce the size of the app somewhat
|
Mark M. |
Raza: done right, it will not break the app
|
Mark M. | |
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
|
Mark M. |
the documentation covers icon design guidelines: http://developer.android.com/guide/practic…
|
Mark M. |
however, they are written for people who know Photoshop
|
Raza R. |
haha All programmers have same problem, they don't know how to design :)
|
Dec 28 | 10:50 AM |
Mark M. |
there is also the Android Asset Studio: http://android-ui-utils.googlecode.com/hg/…
|
Mark M. |
that site will take simple clip art and help convert it into icons meeting the design guidelines
|
Raza R. |
thanks
|
Raza R. |
Did you cover JSON parsing in the books??
|
Mark M. |
actually, no, now that I think about it
|
Mark M. |
or at least, not much
|
Mark M. |
there are two parsers
|
Mark M. |
the org.json classes existed from the beginning of Android
|
Mark M. |
Android 3.0 added JSONReader
|
Mark M. |
the difference is roughly similar to DOM versus SAX
|
Mark M. |
JSONReader is much faster, but it is up to you to hold onto whatever data you want
|
Mark M. |
and, of course, it only works on API Level 11 and higher
|
Dec 28 | 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
|
Mark M. |
of course, it depends on how big the file is
|
Mark M. |
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
|
Mark M. |
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
|
Dec 28 | 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?
|
Mark M. |
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
|
Mark M. |
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
|
Mark M. |
actually
|
Mark M. |
there is a distanceBetween() method on Location that handles it
|
Mark M. |
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
|
Mark M. |
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 |