Do you have Twitter? if so hook me up and id be glad to answer any questions for you, my twitter is @Scruffyfox
Quote:
My current questions are:
Do all objects/layouts have to be added to a "stage" like in flash? (i.e. setContentView(object)
Is there any positioning syntax that can be used or is it all like pos_x = (window.width/2)-(this.width/2) kind of stuff?
I'm currently running Android SDK on Eclipse. I've set up an AVD, but for some reason I don't really have full functionality on it (ie, app drawer). Am I missing something? Is there a better/more usable emulator I should be using? Or should I just use my phone (Samsung Galaxy S II Epic 4g Touch)?
My emulator shows an icon and the name of the app below the actual application bar with the name in it, is there a way to hide these?
Can I hide the application bar that says the name?
Is there a way to make each screen I intend to use a different activity, with one main activity running listeners and passing info as needed between them like in cold fusion?
If each page were defined as an activity, when a user switches pages, would the other pages just maintain their current state, or would I have to store the state and use onResume()?
|
1. All objects have to be in the activities 'content view', you can set this inside onCreate using the method "setContentView" either using view extended objects, such as text view or image view, or an ID of a layout such as main.xml (called using R.layout.main)
2. The positioning is determined by the container of the object, nothing should ever be asbolutley positioned because of the screen size differences in devices. Different containers have different uses, such as a LinearLayout puts objects in ascending order either vertically or horizontally.
3. Using your phone would be best. The emulator sucks.
4. Use the code "requestWindowFeature(Window.FEATURE_NO_TITLE) ;" in your "onCreate" just before the "setContentView"
5. To start a new activity, you need to create an Intent. and you also need another activity (seperate class file) to go to. the intent goes as follows:
Code:
Intent newActivity = new Intent(this, your_new_class_name.class);
startActivity(newActivity);
Don't forget to declare your activity in the android manifest xml
6. A activity retains all its data when going forwards, say from activity A -> activity B, but when you go back from B to A, everything in B is destroyed and the method 'onDestroy' is cleared.