Porting iPhone UI with multiple screens over a map to Android. Use multiple Activities? - iphone

I have this setup in an iPhone app:
There is always a MKMapView on screen & a additional UI layer on top. The upper UI layer is managed by a simple state system. Each state is a UIViewController and has a .nib attached to it containing the layout.
I'm very new to Android development. What is the best way to build this on Android?
So far I see two options:
1. Have a single Activity & insert/remove layouts as the states change.
2. Have multiple Activities and have a layout for each. Is there then a way to keep a single MapView around beneath, without having one per activity?
Thanks.

In general, it is easier to have multiple activities, each with their own layout.
Before you get to far, make sure you read through the basic Android documentation and UI guidelines. Android has some UI paradigms that are a little bit different from the iPhone, so you generally don't want to just copy over exactly what you have.

Related

best way of dealing with layers of images / views for an iphone app

If i wanted to create a system whereby you could display a little rectangle ON TOP of an app already running, in which I could put any number of things, what would be the best, most apple standard way of doing it?
I'm thinking of something similar to iAdd. basically layers of views I suppose. I know that microsoft has a standard war of coding game menus for example. they're layered - each one has various event handlers for when things start and finish and they're own little update / load / draw methods etc that get called when appropriate. is there something similar for apps?
The most important thing really is just the starting point. what should I be doing in order to create another view over the existing one?
All UI elements in iOS inherit from class UIView. To add one view inside another use [view addSubview:subview]
For detailed information about how to use the UIView class, see View Programming Guide for iOS

How to make iPhone app "skinnable"?

I was asked by a client to make a "skinnable" app and I don't really know what that means.
I googled like crazy and I didn't found a clear answer or an example.
If anyone has a clue about this, any tip would be appreciated.
Thanks.
Generally this means the app will allow the user to choose different looks for the UI, each of which will have a different color scheme, feel, etc.
What I actually did with my project. I decided to use multiple storyboards to give me greater control over the entire UI and UX of each theme. I programmatically link them all together via a master storyboard that links them all together. That's what I did, and it works very very well. Performance is great, while still maintaining high level of fine grain control over each theme. You can even keep your Header and Implementation files the same for individual view controllers, just so as you keep the names the same on the storyboard.
So for instance, one of my apps that I'm working on called Jam-mout (A music player) has multiple high quality themes. (Image attached). Each theme has it's own storyboard.
For iPhone apps, where the majority of the GUI design is provided by the operating system, you could do it by setting custom Navigation bar background images, custom button graphics, and different fonts/sizes/weights and whitespace. Make sure you're working with a designer who's familiar with the iPhone GUI (if you're not working closely with a designer this is going to be a nightmare).
I recently put together an app for a client who wanted a heavily customised GUI: http://itunes.apple.com/us/app/gogoparis/id428497937?mt=8. A 'skinnable' app would have several sets like this, so the user could choose between several different overall styles. (I hope your client has an enormous design budget!)
my post here should help you get started:
What is the recommended method of styling an iOS app?
if you need live theme changes, each theme in this example could post notifications when the user selects another theme (or skin) - then you can update either the theme instance itself.
alternatively, you can create identifiers for themes which are mapped (NSCFDictionary) to a central theme factory. an example identifier for a specific view for use with the theme factory could be a string MONImageSelectorTableCellThemeIdentifier.
an example manager/factory which handles all theme loading and vends references to themes:
#interface MONThemeManager : NSObject
//...
- (MONTheme *)themeForCurrentlySelectedSkinForViewWithIdentifier:(NSString *)identifier;
//...
#end
beyond that, it's hard to answer your question in more detail without knowing your requirements. the implementation of skinning an app can range from very simple to very very complex. good luck.
Already some good answer here, but I'd add that if you use a ui toolkit such as Three20
you can skin everything using CSS as you might for web pages.
I do realise this is an old post, but I thought I'd share my penny on the matter:)
To make any Cocoa app skinnable you need you think of 3 aspects of the app:
1) Uniformity: By this I mean that on all windows, views (including buttons, text inputs etc...) you want to have a 'standard' that will apply throughout the app. This is the first thing you need to look at. Although iOS and OS X alike already have 'themes' as to put it i.e. Apples default way of shading and laying things out, you can override these (refer to the individual view / window etc... documentation.
2) Performance: With skinning etc... performance is always an issue when it comes to writing your own drawRect etc... methods. The code apple have in place for the 'default' is already optimised, so you need to keep a close eye on the performance of the app whilst you are doing this. Good examples are: Do I use an image with a gradient, or do I use NSGradient? Both of which have performance issues when it comes to rendering them, but it's a question of which is the better of the two
3) userDefaults: This is generally the area where you'd be getting your 'skin settings' pulled from. userDefaults is basically where you store all of the information which you generally set in a preference pane.
If I were you I'd look into the class reference of it:
http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSUserDefaults_Class/
Furthermore, here's a nifty example of using userDefaults:
http://mobile.tutsplus.com/tutorials/iphone/nsuserdefaults_iphone-sdk/
Hope this helps!

iPhone development - Which is better for my app (Navigation or window based)?

It's a really simple question , but i'm still new at this.
I want to create a game with some levels.
Is it better to use a Navigation based app or a windows based?
views used are:(Main menu- Options - high scores - 10 levels)
Thanks!
If you want to create a game, take a look at the cocos2d framework. It will provide a complete solution for this kind of programs.
As to your question, I would not use a Navigation base app, since you do not want to give the option of going back through levels. You just need a way to manage all the different scenes youd have (levels), moving from one to another, and display a menu/options view when it is the case. So, if you do not want to use cocos2d, a window based app will suit your needs.
Most games have a 100% custom UI, but if you are just getting started, you might want to prototype your screens/flow between screens using UIKit first.

How to design a complex UI without interface builder? (iphone)

I've seen many people saying it's easier to code your UI directly than to manipulate them in IB.
I know how to create UI objects from code but it just seems unnecessarily complicated, especially when you have 10+ subviews/controllers in one view(screen).
1. How do you visualize the UI layout when you create UI from code?
2. How do you make sure you are following the apple guidelines when placing the UI objects? (IB shows the blue dashed line to suggest you the correct(i guess) positions)
3. How do you manage to separate the UI creation part and the UI placement part in code? (maybe to figure out the UI layout easily)
and so on..
I wish there was a tutorial or example that can answer the above questions but hard to google.
Thank you for any suggestion.
I am creating my UIs from code with config files.
I have a test iPhone app that reads a config file and displays the UI, so i can tweak it.

Display "custom" view (various images, various text). Should I use UIWebView?

First: No, none of the content should be loaded from the web. All content parts are shipped with the main bundle.
I have n images and mass of text (including lists). Instead of building all view parts programmatically in objective-c if was thinking of using an UIWebView and build "only" the HTML dynamically.
Does anything speaks against it?
How does UIWebView work with local content?
Links and resources welcome.
Thanks
I would not recommend using the WebView for building application UIs. It introduces many elements that may cripple the user experience. Well, it basically depends on the complexity of the UI.
I created an App UI in WebView myself, using JavaScript and all that advanced CSS animations/transforms that WebKit has to offer, but in the end it was not good for the consumer. My goal was to make the app skinnable, but if something goes wrong - for example in JS - the WebView is stuck, except you spend the time into building a WebView wrapper for your app that deals with this.
That said I, i don't know how complex your UI is going to be, but I would say using IB or building the UI in code with cocoa is still more efficient.
Regards, Erik
I've thought about using web views in these situations sometimes, but then decided against it. 99% of the time, it's better to design the screen in Interface Builder. That will be as fast as or faster than creating an HTML page, and will give you all the benefits of elements functioning as expected (text input for example) and the possibility of customizing things programmatically. But of course, in many scenarios a web view might be the way to go (in fact, several standard UI elements have underlying web views).