Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning Android Application Development
This is the forum to discuss the Wrox book Beginning Android Application Development by Wei-Meng Lee; ISBN: 978-1-1180-1711-1
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Android Application Development section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 15th, 2011, 04:03 PM
Registered User
Points: 25, Level: 1
Points: 25, Level: 1 Points: 25, Level: 1 Points: 25, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2011
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Basic GridView Question

Hi, I'm a newbie. My question is this: is there a way to build a GridView dynamically? In the example in the book, we are told to place images in the "drawable" directory, and the grid is built from that. How do we build a grid "on the fly"? Do we copy images to the "drawable" directory, or do we write a custom view for that? My aim is to create a grid of thumbnails of the photos on the phone. Thanks.
Reply With Quote
  #2 (permalink)  
Old December 16th, 2011, 07:39 PM
Registered User
Points: 11, Level: 1
Points: 11, Level: 1 Points: 11, Level: 1 Points: 11, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2011
Posts: 3
Thanks: 0
Thanked 1 Time in 1 Post
Default

It may well be that later chapters will indicate a way.
Reply With Quote
  #3 (permalink)  
Old December 18th, 2011, 05:38 PM
Registered User
Points: 25, Level: 1
Points: 25, Level: 1 Points: 25, Level: 1 Points: 25, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2011
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It turns out that Android has a number of predefined content providers, one of which is for images and one for thumbnails (either internally or externally on the SD card). Also, the Activity class has a predefined method which will retrieve a database cursor for the data in a given content provider. This cursor can then be used to create an adapter which will link the image data to the grid layout. Pretty funky.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
a basic question Howard Pai BOOK: Beginning C# 3.0 : An Introduction to Object Oriented Programming ISBN: 978-0-470-26129-3 1 August 11th, 2011 09:44 AM
Please HELP Very Basic Question jkoe578 BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 1 November 18th, 2006 10:06 AM
xslt basic question kgoldvas XSLT 2 January 25th, 2006 02:48 PM
basic xslt Question abhishek verma XSLT 4 January 24th, 2006 05:35 AM
basic question but..... Adam H-W Javascript How-To 2 February 10th, 2004 01:24 PM



All times are GMT -4. The time now is 01:30 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.