Mar 15 | 3:55 PM |
Mark M. | has entered the room |
Mark M. | turned on guest access |
Tom O. | has entered the room |
Mark M. |
howdy, Tom!
|
Mark M. |
how can I help you today?
|
Tom O. |
Hello!
|
Tom O. |
Today I am curious about In-App Billing, and a bit about fragments.
|
Mark M. |
can't help you much with in-app billing
|
Mark M. |
fragments, you may have better luck
|
Tom O. |
Bummer. But, that does seem to be a common theme. In-App billing seems a bit to new.
|
Mark M. |
I just have zero experience with it
|
Mark M. |
and probably never will
|
Mar 15 | 4:00 PM |
Mark M. |
I can't just create some fake app and charge people for it, to learn how the billing works... :-)
|
Tom O. |
Ah, well, no matter. I'll figure it out.
|
Tom O. |
:)
|
Tom O. |
So on to fragments then.
|
Tom O. |
I have an activity with a fragment.
|
Tom O. |
Well to be specific, my layout for the activity that has a FrameLayout
|
Tom O. |
MyActivity.OnCreate will load fragment1 when in landscape, and fragment2 when in portrait.
|
Tom O. |
So, when the app starts on my Xoom, it will probably load fragment1, as my Xoom is in landscape.
|
Tom O. |
Now I rotate my Xoom 90 degrees.
|
Ron T. | has entered the room |
Tom O. |
I though that when the activity is destroyed and then recreated, that fragment1 would disappear from the FrameLayout
|
Tom O. |
and that OnCreate would then add fragment2
|
Mark M. |
and, let me guess: you get both fragments
|
Mark M. |
(BTW, howdy, Ron!)
|
Tom O. |
Yes.
|
Tom O. |
Hello Ron.
|
Ron T. |
Hi!
|
Mark M. |
been bit by that myself
|
Tom O. |
The fragments are one atop the other.
|
Mark M. |
that's because that's the layout rule for FrameLayout
|
Tom O. |
oh?
|
Mark M. |
the stacking, I mean
|
Mark M. |
FrameLayout puts everything in the upper-left corner, but later children float over top earlier children on the Z axis
|
Mar 15 | 4:05 PM |
Tom O. |
But I thought rotatiing the device would causes the Activity to be destroyed?
|
Mark M. |
quoting from _The Busy Coder's Guide to Advanced Android Development_...
|
Mark M. |
View paste
|
Mark M. |
(page 186)
|
Mark M. |
basically, in a configuration change, Android tries to reconstitute your previous set of fragments
|
Tom O. |
ah. THat makes snese.
|
Mark M. |
is there a particular reason why you have separate fragments for portrait vs. landscape?
|
Tom O. |
Not a good reason.
|
Mark M. |
you are probably better served trying to make them be the same fragment
|
Tom O. |
I was demonstrating fragments to someone.
|
Mark M. |
ah
|
Tom O. |
and was showing transactions.
|
Mark M. |
also ah
|
Tom O. |
Then they rotated the device.....
|
Mark M. |
you are welcome to keep them separate, but you'll need to alter your transactions (e.g,. replace() instead of add())
|
Mark M. |
Tom: we can follow up on this in a bit
|
Mark M. |
Ron: do you have a question?
|
Tom O. |
Sure.
|
Ron T. |
Yes, simple quick question on Webview...
|
Ron T. |
I've built a simple Activity and it displays the URL fine...
|
Ron T. |
Does the .loadURL method have to be executed in a background thread?
|
Mark M. |
no
|
Mark M. |
in fact, I'm not sure if it works in a background thread
|
Ron T. |
So the method does the http on its own in the background?
|
Mar 15 | 4:10 PM |
Mark M. |
yes
|
Mark M. |
WebKit has its own thread pool for this sort of thing
|
Mark M. |
little, if anything, inside a WebView actually occurs on the main application thread, AFAICT
|
Ron T. |
Great, I've got more to do with this project but
that is my only question for now. I'll be working over the weekend and
will no doubt have more questions next week. Thanks! over and out.
|
Mark M. |
OK
|
Ron T. | has left the room |
Mark M. |
Tom: do you have another question?
|
Mark M. |
(besides how on Earth #16 UNC Asheville can be up by 5 over #1 seed Syracuse?)
|
Tom O. |
No. that is basically it. Just didn't get why the fragments were stacking
|
Tom O. |
Ummm actually that question never entered my mind. :)
|
Tom O. |
Thanks for the answer.
|
Mark M. |
I basically pay attention just for the massive upsets :-)
|
Mark M. |
sure, no problem
|
Tom O. |
Have a good day. Now off to figure out in-app billing.
|
Mark M. |
best o' luck!
|
Mar 15 | 4:30 PM |
Tom O. | has left the room |
Mar 15 | 4:35 PM |
Raza | has entered the room |
Mark M. |
howdy, Raza!
|
Mark M. |
how can I help you today:?
|
Mark M. |
(give or take a colon)
|
Raza |
Hello mark
|
Raza |
Can you tell how i can create the MWC Android app layout? check screenshot here http://i.imgur.com/2xZAI.png
|
Mark M. |
the top half is probably just an ImageView
|
Mar 15 | 4:40 PM |
Mark M. |
the bottom half is either a TableLayout or perhaps a dashboard
|
Raza |
and in downside?
|
Mark M. | |
Raza |
can i create that layout in GridView ?
|
Mark M. |
that does not look like a GridView
|
Mark M. |
though you could use one, I suppose
|
Raza |
aww thanks for the post link
|
Raza |
very helpful
|
Mark M. |
GridView is typically used where there is an indefinite number of items, not a fixed half-dozen
|
Mark M. |
the link is to a DashboardLayout, derived from the Google I|O conference app (iosched)
|
Raza |
yeah just downloaded iosched application
|
Raza |
one more thing TableLayout is good for multiple screen size?
|
Mark M. |
that depends a bit on what you are putting in the TableLayout, and where the TableLayout is going
|
Mark M. |
the existence of android:stretchColumns and android:shrinkColumns helps
|
Mark M. |
but that's mostly for small changes in size (e.g., 3.5" phone to a 4.5" phone)
|
Mark M. |
if you are thinking phones versus tablets, you might wind up using TableLayout in a fragment
|
Mark M. |
but on a tablet, you probably have multiple fragments at once
|
Raza |
thanks, i've to keep these thing in mind, i find that building UI is more difficult in Android
|
Mar 15 | 4:45 PM |
Raza |
Any idea about external library where i can find Actionbar & ViewPager in same library ?
|
Mark M. |
I doubt any such library exists
|
Mark M. |
ViewPager is part of the Android Support package
|
Mark M. |
the action bar is part of native Android (API Level 11+)
|
Mark M. |
you will find some action bar equivalents for earlier Android versions, like ActionBarSherlock
|
Raza |
i mean ViewPager+ tabs generally we seen such thing in ICS
|
Mark M. |
even still, there is unlikely to be a single library that has both of your requested items
|
Mark M. |
it is akin to seeking a library that offers language translation and an RPN calculator
|
Mark M. |
they just are not that related
|
Mark M. |
so it is unlikely any developer combined them into one library
|
Raza |
ok
|
Mark M. |
with respect to ViewPager and tabs, the standard solution is PagerTitleStrip
|
Mark M. |
though that is not interactive (shows labels, but they are not clickable)
|
Mar 15 | 4:50 PM |
Mark M. |
I have not run across a ViewPager + tabs solution, but I have not been actively looking for one yet
|
Raza |
Actually this looks really neat in Apps
|
Raza |
i seen Viewpager+ tabs in many apps
|
Mark M. |
oh, it looks good -- just not quite certain how they are implementing it, that's all
|
Raza |
Any good tool for wire framing ?
|
Mark M. |
I do not wireframe, so I cannot answer that, sorry
|
Raza |
If i'm not wrong you're going to combine 4 books in single one?
|
Mark M. |
that is correct
|
Raza |
any idea when you're going to release and yes please release print edition too
|
Mark M. |
the "omnibus" (combined) edition is slowly rolling out now
|
Mark M. |
you will see Version 0.1 on your Warescription page in EPUB format
|
Mark M. |
with luck, it will be completed in May
|
Mark M. |
I have no current plans for updating print editions, since 90+% of the readers go with the digital subscription
|
Mar 15 | 4:55 PM |
Mark M. |
I will likely do *something* in print, but exactly what and when, I do not know
|
Mark M. |
that's a wrap for today's chat
|
Raza |
Bye
|
Mark M. |
next one is Tuesday at 7:30pm Eastern
|
Mark M. |
have a pleasant day!
|
Raza | has left the room |
Mark M. | turned off guest access |