Sep 19 | 9:55 AM |
Mark M. | has entered the room |
Mark M. | turned on guest access |
Sep 19 | 10:00 AM |
Gaurav B. | has entered the room |
Mark M. |
hello, Guarav!
|
Mark M. |
how can I help you today?
|
Sep 19 | 10:20 AM |
Bayram M. | has entered the room |
Mark M. |
hello, Bayram!
|
Mark M. |
Bayram: how can I help you today?
|
Sep 19 | 10:25 AM |
Bayram M. |
Just bought the books and having a look around
|
Bayram M. |
thanks for the offer :)
|
Mark M. |
the office hours chats are for Q&A, on Android development questions
|
Mark M. |
you can find archives of past office hours transcripts at http://commonsware.com/office-hours/
|
Mark M. |
normally, when you are logged into your
Warescription page, you will see a calendar here, instead of the chat
room access (which is only here when the office hours are live)
|
Mark M. |
if either of you have a question, feel free to chime in
|
Bayram M. |
thanks :)
|
Gaurav B. |
Hi Mark
|
Gaurav B. |
I was just here to check out the questions being asked
|
Jose L. | has entered the room |
Gaurav B. |
i had just one question about what is a zygote with relavane to Android Process model
|
Jose L. |
hello everyone!
|
Mark M. |
(BTW, hello, Jose -- I will be with you shortly!)
|
Mark M. |
Guarav: When Android boots, one of the first processes created is called the zygote
|
Sep 19 | 10:30 AM |
Mark M. |
it loads the Dalvik VM, JIT compiler, and framework classes (e.g., android.*, java.*)
|
Mark M. |
when any Android app runs, what really happens is that the zygote process is forked to create the app's process
|
Mark M. |
all of the stuff that the zygote loads is in "copy-on-write" memory shared between all of the forks of the zygote process
|
Mark M. |
this allows each app to reference a shared instance of all of that stuff, saving memory
|
Mark M. |
yet, Linux's copy-on-write feature means that if a
process attempts to tamper with that shared memory, the process
transparently gets a local copy of that memory
|
Mark M. |
this prevents one app from tampering with, say, Dalvik, and having those changes affect other apps
|
Mark M. |
this architecture allows app processes to be lean (just your own classes and heap), while still offering process-level security
|
Gaurav B. |
cool thanks
|
Gaurav B. |
for all the information
|
Mark M. |
Jose: do you have a question?
|
Jose L. |
yes
|
Jose L. |
it's more related to the development process and how to setup things than android development stuff
|
Mark M. |
OK
|
Jose L. |
I'm working on a project, it's bringing an iPad app to android, so I am starting with two projects
|
Jose L. |
a library project and the app itself that uses that library project
|
Sep 19 | 10:35 AM |
Jose L. |
I have to do the library thing because this is the first of really similar apps
|
Jose L. |
that share functionality
|
Jose L. |
both projects (library and app) has their own git repositories
|
Jose L. |
I am using gradle to set up building and such (for now mainly to build the app from a CI machine runing jenkins)
|
Jose L. |
so in the root of the app project repo I have a
directory with the app itself and a dependency folder where I linked a
git submodule pointing to the library repo
|
Jose L. |
that works fine with gradle
|
Jose L. |
but
|
Jose L. |
the thing is that I am setting up the dependencies using two systems
|
Jose L. |
gradle AND git submodules
|
Jose L. |
and that's something I don't really like
|
Jose L. |
so my question is... how would you set up all this
|
Jose L. |
?
|
Jose L. |
I have to say that for development I cloned both repos and work with both repos at the same time
|
Mark M. |
well, bear in mind that I am not all that well-versed in the Gradle stuff at the moment
|
Mark M. |
that being said
|
Jose L. |
using only the submodule-copy for gradle building
|
Sep 19 | 10:40 AM |
Mark M. |
I would use an AAR for the library, and have the app depend upon the AAR, not the git repo for the library
|
Sep 19 | 10:40 AM |
Mark M. |
the AAR can be published as an artifact, whether
to some full Maven install or simply a local artifact directory with
appropriate metadata
|
Mark M. |
the dependency on the AAR can be specified in the gradle build file
|
Jose L. |
yes, problem that I see with that approach is that
I am developing both projects at the same time since I am in a really
early stage of the development
|
Mark M. |
so?
|
Jose L. |
so everytime I make a change in the library I want to use in the app
|
Jose L. |
I have to compile, build and upload the AAR to the local artifact directory
|
Jose L. |
(for development in my machine I am just linking one project as dependency as the other)
|
Mark M. |
write a batch file/shell script around the gradle script for the app that runs both builds
|
Mark M. |
and use that until such time as you are ready to break the always-build-both approach when building the app
|
Mark M. |
besides, today is International Talk Like a Pirate Day -- AAR files *have* to be the answer!
|
Mark M. |
:-)
|
Jose L. |
LOL true that
|
Bayram M. |
Hello Mark I have a question :)
|
Jose L. |
so that shell script would...
|
Jose L. |
build the library and upload the artifact
|
Jose L. |
and then build the app downloading the new artifact
|
Mark M. |
(Bayram: give me one moment to wrap up this question with Jose -- I will be with you shortly!)
|
Mark M. |
right, as a temporary bit of scaffolding
|
Jose L. |
is that right?
|
Sep 19 | 10:45 AM |
Mark M. |
there may be a more elegant approach that you could do in the gradle file itself, though that's beyond what I have tried so far
|
Jose L. |
well certainly I am not a gradle expert
|
Jose L. |
just started using it
|
Mark M. |
let me take Bayram's question, and I can come back to you in a bit
|
Jose L. |
I'll give it a try to the shell aproach
|
Mark M. |
Bayram: go ahead!
|
Jose L. |
yes, thanks Mark!
|
Bayram M. |
Thanks
|
Bayram M. |
Well I have a strong requirement to make my app UI very fast
|
Bayram M. |
but the problem is I find that UI using xml is lagging some times
|
Bayram M. |
should I go for view extention though it would violate the MVC pattern ?
|
Mark M. |
no, since "UI using xml" is unlikely to be your problem
|
Bayram M. |
ok
|
Mark M. |
how did you determine that "UI using xml" is the source of your sluggishness?
|
Bayram M. |
for example animations using xml aren't as fast as those made in code ...
|
Sep 19 | 10:50 AM |
Mark M. |
and your proof of this is... what, exactly?
|
Carlos | has entered the room |
Gaurav B. | has left the room |
Mark M. |
if you are going to make these sorts of claims, you need evidence
|
Mark M. |
(hello, Carlos, I will try to get to you shortly, before the chat ends!)
|
Bayram M. |
Just tried both approaches and animation with xml some times are slow
|
Carlos |
Ok Mark. thks!
|
Mark M. |
and how did you measure "some times"?
|
Bayram M. |
on the same device animation using xml lag when I'm updating data in bg
|
Bayram M. |
but those in code don't
|
Mark M. |
what tools did you use to measure "some times"?
|
Bayram M. |
just basic testing, I have a pull to refresh list. When I drag it my animation lag
|
Jeff | has entered the room |
Mark M. |
that is not especially scientific
|
Jose L. |
only if it's an xml animation?
|
Bayram M. |
yes
|
Mark M. |
you are wasting your time worrying about solutions until you *prove* the source of your problems
|
Sep 19 | 10:55 AM |
Mark M. |
there are plenty of tools to help you better measure performance
|
Mark M. |
Traceview is one
|
Mark M. |
the book's chapter on detecting and removing jank covers others (e.g., systrace)
|
Bayram M. |
So for you using xml has no performance hits ?
|
Mark M. |
generally, it should not be an issue
|
Mark M. |
let me try to take some quick questions from the newcomers before the chat ends
|
Mark M. |
Carlos: do you have a quick question?
|
Bayram M. |
ok thanks
|
Carlos |
yes Mark
|
Carlos |
I'm trying to initialize a preference's summary text when the screenpreference is loaded in the fragment
|
Carlos |
I was able to retrieved the last stored preference value in the preferencefragment's onCreate method.
|
Carlos |
However, I don't know how to refresh the UI for that preference inside onCreate
|
Carlos |
this is what I current have:
|
Carlos |
View paste
|
Mark M. |
call findPreference() to retrieve the Preference object
|
Mark M. |
call setSummary() on the Preference object to change its value
|
Carlos |
I was trying that but I get a nullpointer exception
|
Carlos |
this is how I tested it:
|
Carlos |
View paste
|
Mark M. |
did you do it after calling addPreferencesFromResource()?
|
Mark M. |
that is rather strange looking
|
Carlos |
but time_preference is the layout for my timepreference.
|
Sep 19 | 11:00 AM |
Carlos |
The actual preference in xml folder is called general_preferences.xml
|
Mark M. |
findPreference() takes the string name of the Preference as defined in the preference XML
|
Mark M. |
which lines up with the name of the preference as stored in SharedPreferences
|
Mark M. |
none of that has anything to do with a layout resource
|
Carlos |
ohhhh.
|
Mark M. |
try that and see if it helps
|
Mark M. |
Jeff: the chat is just about over -- do you have a quick question?
|
Carlos |
ok Mark. thks!
|
Jeff |
when I set largeHeap in manifest.xml, then Eclipse flags an error because my min sdk version is 10
|
Mark M. |
android:largeHeap was added in API level 11
|
Mark M. |
it will be ignored on API Level 10 devices
|
Jeff |
got that. but is there a way to stop Eclipse from flagging that particular error?
|
Jose L. |
you need to target a newer version, I think
|
Mark M. |
there should be a quick-fix that adds an ignore attribute to the element
|
Jose L. |
and compile with the newer version
|
Jeff |
I'll look for the quick-fix Thanks
|
Mark M. |
that's a wrap for today's chat
|
Jose L. |
thanks!
|
Jeff |
Jose - compling with new version eliminates devices that I worked to support
|
Jeff |
thanks
|
Mark M. |
the transcript will show up on http://commonsware.com/office-hours/ shortly
|
Mark M. |
next chat is Tuesday, 4pm Eastern
|
Mark M. |
have a pleasant day, all!
|
Jose L. |
you too!
|
Bayram M. | has left the room |
Jose L. | has left the room |
Carlos | has left the room |
Jeff | has left the room |
Mark M. | turned off guest access |