Populate data through xml file for Android - android-widget

I am new to Android. I have created a navigation bar. After clicking to one of the buttons from the navigation bar a floating table should be displayed and data must be loaded through a xml file. Should I use listview or table layout for displaying the data? And also I need help with the code.
Thanks

The fact that the data comes from XML is irrelevant.
You probably want a table layout.
Your question is too broad for anyone to answer accurately.

Related

Flip from one ViewController to another iBooks Style

I'm trying to load in content from a database and allow the user to flip through it like pages, then at the end of the content, give them options to go to another section of content (probably with buttons). The content is currently just formatted with html, but how do I implement the buttons to navigate? I'm a little new to Xcode so maybe I'm not even looking in the right direction.
refer a this opensource: https://github.com/devindoty/iBooks-Flip-Animation
this is very little code and perfectly works.

How can I display structured text?

I have some text that I need to load from an XML file. The idea is to be able to make the text interactive. I should be able to tell when a user taps a piece of the text, like in the WordWeb app. I know this seems to be the kind of job that a UIWebView is for but I want to avoid generating HTML and implementing handlers for the hrefs. I hope that made any sense.
Another way could be using a UITableView with UITextViews or UILabels as content views for the cells. However, I couldn't find out how we can customize the appearance of the table view, add a border to the view for example.
The end result expected is a view that looks like a page from a book but pieces of the displayed text can be tapped and bookmarked etc.
Am I even thinking in the right direction?

Two UITableViewControllers and One UISearchDisplay

I'm new to iPhone programming and is faced with a task to show data on of Books where the first table view shows the books in my library using the title of the book to sort and another table view to show the authors. There is a need to have a search bar on both of the table views and when used to search will show results categorized as certain results is returned according to the author and the others returned according to the title. Something similar to the search results returned by the iPod App.
Thanks in advance to all who can shed light.
From what I gather, it sounds like you need to organize this somehow. I recommend you try a tabbed-based application. Create three tabs with the first two having navigation controllers for your tables. The first tab will have the tableView that sorts by book title. The second tab will have the tableView that sorts by the author. The third tab can do the search for either case. Hopefully, that points you in the right direction.

What's the best layout for a scrollable iPhone "detail view" with variable content?

I'm building a navigation controller based iPhone application and am curious how to go about building the detail view for my application. The part that's complicating my endeavor is: What UI elements/hierarchy should I employ to create a variable-height yet scrollable detail view?
A great example of my goal is an arrangement like the mobile App Store detail view. The horizontal divisions between the heading, description, screenshot, etc leads me to believe it's a table view in disguise, but that's just a guess.
Currently, I'm using a UIScrollView for my detail view, but since I can never be sure of the exact length of my incoming content, my description view ends up with either unused space or truncated text. Is there some set of elements that would be best suited for displaying this variable-height content in "blocky" format (like the example) while still maintaining overall view scroll-ability?
Thanks in advance for your assistance!
If you want to be able to easily format complex content you can use a UIWebView. What I basically do is create an HTML template and add it as a resource. At run time I load the content of this HTML doc and do string replacement to add the content I want. Within the HTML I place placeholders like
<div><!-- ARTICLE_TITLE --></div>
I don't think the App Store detail view is a UITableView. In fact, I'm pretty sure it's a subclass of UIScrollView.
To determine the size of your content, you can use NSString's sizeWithFont method.
A little late, but still relevant: The App Store broke a few weeks ago, and the "Featured" tab of the App Store was very obviously HTML without CSS applied. So, it's actually a UIWebView, or web content displayed in some fashion.
The touch-down behaviors of the iTunes app, while appearing quite similar, behave differently, in a more native fashion. I'm not convinced this app is implemented in the same way.

How do I create a dictionary-style scroll bar for iPhone (like in the Contacts list)?

I am creating an iPhone app which I would like to have a similar interface to the iPhone's native contact picker view, i.e. an alphabetical list which you can scroll through, with a search bar up top which narrows down the list. Particularly, I'd like to be able to show the letters of the alphabet down the side so that as you scroll through the list, you see your position in the alphabet in the scrollbar. The problem is that my data basically consists of key-value pairs, not contact data, so I can't easily use the native contact picker.
As far as I can see, I have two options to achieve what I want:
Use the ABPeoplePickerNavigationController class and hack it to use an address book which I fill myself with non-address type data. The problem with this is that, by default, the address book will fill up with the contacts from the iPhone so that each time the app opened, I'd have to flush those contacts and build my own list. (Not to mention other problems associated with using an interface which is bound to a particular data structure)
Use a UISearchBar and UIScrollView. This would be fine, but I'm not sure how to do anything to the scroll bar except change its colour - I can't see how to override its contents.
Any advice on which is the simplest way? What are the pitfalls (particularly of 1)?
To get the letters down the side, you can just provide a -sectionIndexTitlesForTableView: method in your table view datasource. As for searching, there's a bit more work there, and it's very dependent on your data. A UISearchBar is the place to start, however.
For a search bar, have a look at TTSearchBar in the Three20 library.
Everything else can be easily implemented using UITableView.