Feb 6 | 7:20 PM |
Mark M. | has entered the room |
Feb 6 | 7:25 PM |
Mark M. | turned on guest access |
Feb 6 | 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!
|
Mark M. |
Bob: do you have a question?
|
Jeff |
Hi Mark
|
Jeff |
yes
|
Jeff |
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
|
Mark M. |
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.
|
Bob R. |
The code originally worked fine.
|
Mark M. |
Bob: what do you mean by "made an update to Eclipse"?
|
Bob R. |
zncroid SDK manager
|
Bob R. |
android
|
Mark M. |
OK, I do not know precisely what you did, so we will leave that alone for now
|
Feb 6 | 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
|
Bob R. |
ok
|
Bob R. |
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
|
Mark M. |
so, I would check there
|
Mark M. |
Jeff: by "phone specific settings", do you mean "device model specific settings"?
|
Mark M. |
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
|
Mark M. |
I am not aware of a common solution for it
|
Mark M. |
in fact, I need to invent one
|
Mark M. |
I have the same sort of issue in my CWAC-Camera library
|
Mark M. |
lots of model-specific quirks to work around
|
Jeff |
yes, right now I have lots of ifs
|
Jeff |
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}})
|
Mark M. |
and seeing if that exists
|
Feb 6 | 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
|
Mark M. |
most manufacturer and model codes that I have seen would work in a resource name
|
Mark M. |
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
|
Mark M. |
correct
|
Mark M. |
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
|
Mark M. |
it's easier for others to contribute files if they are independent
|
Mark M. |
and, there could be a lot of them over time
|
Mark M. |
but your approach would work
|
Jeff | |
Uno T. | has entered the room |
Jeff |
excellent point about others contributing files
|
Jeff |
Thanks
|
Mark M. |
Uno: hi! do you have a question?
|
Mark M. |
Uno: do you have a question?
|
Uno T. |
hello
|
Mark M. |
OK, Bob, back to you: do you have another question?
|
Feb 6 | 7:45 PM |
Mark M. |
Uno: do you have a question?
|
Mark M. |
OK, does anyone have a question?
|
Uno T. |
hmm.. suddenly i forget what i want to ask. let me think
|
Uno T. |
i just still confuse about the difference of tardgetsdk and buildsdk
|
Uno T. |
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
|
Mark M. |
is "buildsdk" referring to the version of Android that you are compiling against? what you set in Project > Properties > Android in Eclipse?
|
Mark M. |
(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
|
Feb 6 | 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
|
Mark M. |
so it does not have to be the absolute latest one, but you probably do not want one from 2009, either :-)
|
Mark M. |
is "tardgetsdk" referring to android:targetSdkVersion?
|
Uno T. |
yes tartgetsdk=android:targetSdkVersion
|
Mark M. |
choosing a targetSdkVersion is a bit of an art
|
Mark M. |
more than a science
|
Mark M. |
at least for your initial value, when you start the project
|
Mark M. |
typically, I will choose the latest version of Android, unless I have a strong reason to do something else
|
Mark M. |
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
|
Mark M. |
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 ?
|
Feb 6 | 7:55 PM |
Mark M. |
Uno: that is the minimum requirement
|
Feb 6 | 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
|
Mark M. |
what you do not want to do is only use stuff from four years ago
|
Mark M. |
as your app will look and behave "out of date" right away
|
Mark M. |
that being said, so long as your app works, you can do whatever you want
|
Mark M. |
Bob: for serious icon work, use a graphic designer
|
Mark M. |
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
|
Mark M. |
(BTW: Jeff, if you have a question, feel free to chime in)
|
Bob R. |
I just began looking at inkscape
|
Bob R. |
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
|
Mark M. |
they represent less than 20% of the market, and that market share is declining
|
Mark M. |
so, I would choose at least API Level 14 as my build target
|
Feb 6 | 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
|
Mark M. |
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
|
Uno T. |
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
|
Mark M. |
bear in mind that the build target is *not* the oldest version of Android that you support
|
Mark M. |
that is the android:minSdkVersion
|
Feb 6 | 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
|
Mark M. |
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
|
Mark M. |
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
|
Uno T. |
can i have another question?
|
Mark M. |
sure, go right ahead
|
Feb 6 | 8:10 PM |
Uno T. |
this is about @targetsdk and subclasses, i have to search the source code in your book first... please wait
|
Feb 6 | 8:20 PM |
Bob R. | has left the room |
Feb 6 | 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
|
Mark M. |
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
|
Mark M. |
well, keep tabs on my CWAC-Camera library
|
Jeff |
if you recall, we swapped email about the Droid Mini
|
Jeff |
OK
|
Mark M. |
well, no offense, but there's more than one Jeff in the world :-)
|
Feb 6 | 8:30 PM |
Jeff |
huh
|
Jeff |
;)
|
Mark M. |
and I am hoping to work on that Droid Mini bug tomorrow or Saturday
|
Mark M. |
I have a big release coming up for the library
|
Jeff |
happy to contribute - I'll watch your library
|
Mark M. |
sounds great!
|
Mark M. |
and that's a wrap for today's chat
|
Jeff |
I just rotated the picture after taking it
|
Jeff |
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
|
Mark M. |
have a pleasant day!
|
Uno T. |
thanks
|
Jeff | has left the room |
Uno T. | has left the room |
Mark M. | turned off guest access |