Office Hours — Today, February 6

Tuesday, February 4

Feb 6
7:20 PM
Mark M.
has entered the room
7:25 PM
Mark M.
turned on guest access
7:30 PM
Bob R.
has entered the room
Mark M.
hello, Bob!
Bob R.
Hi
Mark M.
how can I help you today?
Jeff
has entered the room
Mark M.
hello, Jeff!
Bob: do you have a question?
Jeff
Hi Mark
yes
but I don't want to interrupt. I can wait a few minutes
Mark M.
well, we'll come back to Bob after yours, since he has not yet chimed in
Jeff: go ahead
Bob R.
I made an update to eclypse and now I getting some syntax. GINGERBREAD logic isn't being recognized, I had to convert some case statements to if-else, and now I'm having trouble where the R file isn't being created.
The code originally worked fine.
Mark M.
Bob: what do you mean by "made an update to Eclipse"?
Bob R.
zncroid SDK manager
android
Mark M.
OK, I do not know precisely what you did, so we will leave that alone for now
7:35 PM
Mark M.
if the R file is not being created, there is a problem with either one of your resources, or with your manifest
Bob R.
Gingerbread can not be resolved to a field
ok
thanks
Jeff
my question, which you can answer in any order, is what is a good way to store phone specific settings. For example, I need to rotate a picture 90 degrees with certain phones. Right now, I have code that would fail a CS class. I'm thinking of putting it all in a /res/xml file but then I have parse and find a specific phone. Is there some common solution before I go at this?
Mark M.
do you mean Build.VERSION_CODES.GINGERBREAD?
Jeff
I don't want to reinvent the wheel
Bob R.
yes
Mark M.
Bob: either your build target (Project > Properties > Android in Eclipse) is missing, or is set to something earlier than API Level 9
Bob R.
OK thanks
Mark M.
depending on what you have there, that might also explain the problems that you are experiencing with your R class
so, I would check there
Jeff: by "phone specific settings", do you mean "device model specific settings"?
or do you mean "settings for this app installation on this phone?"
Bob R.
OK thanks
Mark M.
or something else?
Jeff
device model specific settings
Mark M.
OK
I am not aware of a common solution for it
in fact, I need to invent one
I have the same sort of issue in my CWAC-Camera library
lots of model-specific quirks to work around
Jeff
yes, right now I have lots of ifs
I'd like to do it in xml
Bob R.
That was the Gingerbread issue. I had it set to 2.2
Mark M.
what I am planning on trying is name-mangling the MODEL and MANUFACTURER to get a resource name (e.g., R.xml.{{MANUFACTURER}}_{{MODEL}})
and seeing if that exists
7:40 PM
Mark M.
if not, I will try R.xml.{{MANUFACTURER}}
Jeff
ooh - that's nice
Mark M.
and if that's not there, assume there are no model-specific overrides
most manufacturer and model codes that I have seen would work in a resource name
though I'll need to run a few replaceAll()s to be sure
Jeff
then will you have a file for R.xml.{{MANUFACTURER}}?
Mark M.
if there's something that seems universal for a manufacturer's devices, yes
Jeff
so you open the file and parse the specifics?
Mark M.
right now, I think I got rid of my last of those, but it could crop up again
correct
right now, the specifics are subclasses of a DeviceProfile
Jeff
why not put them all in one big xml file with inner tags for specific devices
Mark M.
I'll convert that to XML and parse them into a SimpleDeviceProfile that holds the values
it's easier for others to contribute files if they are independent
and, there could be a lot of them over time
but your approach would work
Jeff
View paste
<Motorola>
<default rotation> 90 </default rotation>
Uno T.
has entered the room
Jeff
excellent point about others contributing files
Thanks
Mark M.
Uno: hi! do you have a question?
Uno: do you have a question?
Uno T.
hello
Mark M.
OK, Bob, back to you: do you have another question?
7:45 PM
Mark M.
Uno: do you have a question?
OK, does anyone have a question?
Uno T.
hmm.. suddenly i forget what i want to ask. let me think
i just still confuse about the difference of tardgetsdk and buildsdk
what is the best practice to set two set those parameters
Mark M.
I do not quite know what you mean by either of them
is "buildsdk" referring to the version of Android that you are compiling against? what you set in Project > Properties > Android in Eclipse?
(BTW, if anyone else has a question, feel free to chime in)
Uno T.
yes build sdk is project > properties
Mark M.
OK, typically you will choose something relatively new
7:50 PM
Mark M.
the real rule is: you want to choose something that has all of the classes and methods that you want to use in your code
so it does not have to be the absolute latest one, but you probably do not want one from 2009, either :-)
is "tardgetsdk" referring to android:targetSdkVersion?
Uno T.
yes tartgetsdk=android:targetSdkVersion
Mark M.
choosing a targetSdkVersion is a bit of an art
more than a science
at least for your initial value, when you start the project
typically, I will choose the latest version of Android, unless I have a strong reason to do something else
however, as months go by, and new versions of Android are released, you will need to consider whether or not to increase your targetSdkVersion
Bob R.
Well I got it clean compiled and working again. Thanks for your help:)
Mark M.
Bob: glad to hear it!
Bob R.
I just have 1 more question
Mark M.
Uno: if you read http://developer.android.com/reference/android/... you will see what the changes are that will occur when you set your targetSdkVersion to a particular API level
Bob: go ahead
Uno T.
for buildsdk: does it mean to set as lower sdk as possible ?
Mark M.
Uno: no
Bob R.
What is a good software (cheap) that I could use to create a custome icon for my apps.
Uno T.
as long all the class and methods are included in that sdk ?
7:55 PM
Mark M.
Uno: that is the minimum requirement
7:55 PM
Mark M.
however, bear in mind that the older of an SDK you use, the less features and functionality your app can have for newer devices
what you do not want to do is only use stuff from four years ago
as your app will look and behave "out of date" right away
that being said, so long as your app works, you can do whatever you want
Bob: for serious icon work, use a graphic designer
whether an individual or some online service
Bob R.
OK thats what I've been looking for
Mark M.
beyond that, everyone has their own preference, and so my approach (Inkscape) is not necessarily common
(BTW: Jeff, if you have a question, feel free to chime in)
Bob R.
I just began looking at inkscape
I need to look at their docos
Mark M.
I am fan of vector art, and Inkscape is one of the few open source vector art programs out there, particularly for Linux
Uno T.
let say, i want to include google mobile ads that have the minimum sdk=9, and i want to add navigator drawer too. what do you suggest for buidsdk and targetsdk?
Bob R.
Mark Thanks
Mark M.
Uno: well, personally, I have largely given up development for devices older than API Level 15, for new apps
they represent less than 20% of the market, and that market share is declining
so, I would choose at least API Level 14 as my build target
8:00 PM
Mark M.
but, if you still want to support API Level 9-10, DrawerLayout will work with the AppCompat action bar (and, with a little work, with ActionBarSherlock as well)
Jeff
has left the room
Bob R.
Have a great evening all:)
Mark M.
ActionBarSherlock will require a build target of API Level 14 or higher; I forget what AppCompat requires
Bob: see you around!
Uno T.
build target= buildsdk ?
Mark M.
Uno: yes, build target = buildsdk
Uno T.
then the targetsdk is the latest right ? so targetsdk=19 ?
Mark M.
yes, that is what I would start with as my targetSdkVersion
Uno T.
i prefer to use AppCompat rather than actionbarsherlock
to support lever 9
Mark M.
while AppCompat will support API Level 7 on up, the build target (what you compile against) may be higher
bear in mind that the build target is *not* the oldest version of Android that you support
that is the android:minSdkVersion
8:05 PM
Uno T.
actually what is the disadvantage if i choose build target = the latest sdk ?
Mark M.
there is no disadvantage
Uno T.
hmmm
Mark M.
so long as your android:minSdkVersion is set to be the oldest version of Android that you support, your build target can be whatever level you want, including the latest
if you try using classes and methods that are available in your build target, but are newer than android:minSdkVersion, the build tools will yell at you
that's where you will see @TargetSdk annotations, to tell the build tools that you know what you are doing :-)
Uno T.
little bit clearer
can i have another question?
Mark M.
sure, go right ahead
8:10 PM
Uno T.
this is about @targetsdk and subclasses, i have to search the source code in your book first... please wait
8:20 PM
Bob R.
has left the room
8:25 PM
Mark M.
Uno: the chat is almost over -- do you have another question?
Uno T.
hmm.. i can't find the source code... maybe next time
Mark M.
OK
is there anything else I can answer for you today?
Uno T.
see you next
Jeff
has entered the room
Uno T.
can i save the chat?
Mark M.
Uno: the chat transcript will be archived at http://commonsware.com/office-hours/ shortly after the chat ends
Jeff
Hi Mark - just wanted to offer that I would contribute the phones I test to your configuration framework if you create it.
Mark M.
um, are you working with the camera?
Jeff
yes, a lot
Mark M.
oh
well, keep tabs on my CWAC-Camera library
Jeff
if you recall, we swapped email about the Droid Mini
OK
Mark M.
well, no offense, but there's more than one Jeff in the world :-)
8:30 PM
Jeff
huh
;)
Mark M.
and I am hoping to work on that Droid Mini bug tomorrow or Saturday
I have a big release coming up for the library
Jeff
happy to contribute - I'll watch your library
Mark M.
sounds great!
and that's a wrap for today's chat
Jeff
I just rotated the picture after taking it
good night
Mark M.
the next chat is Monday at 10am
Uno T.
it's morning now here.. :D
Mark M.
US Eastern Time, that is
have a pleasant day!
Uno T.
thanks
Jeff
has left the room
Uno T.
has left the room
Mark M.
turned off guest access

Tuesday, February 4

 

Office Hours

People in this transcript

  • Bob Richardson
  • Jeff
  • Mark Murphy
  • Uno Tursadi