Android :: Should App's With Multiple Layouts Have Multiple Activities To Handle Each

Jul 1, 2010

I'm planning to develop and app that presents the users with several different screens (of different information).
Was wondering what would be the best way to implement this?

Is it better to have separate XML layouts and an activity to display and allow the user to interact with each screen of data?

OR would handling all of these in the same activity be more efficient (and dynamically load / unload each layout)?

Android :: Should app's with multiple layouts have multiple activities to handle each


Android :: Pros - Cons Of Multiple Activities In An App Vs One Activity - Multiple Views

Aug 16, 2010

Are there design guidelines to help decide if an application with multiple views should be designed with multiple activities or just one activity and control the back button itself.

I've tried both. My most complex applications using one activity per screen. However, now that I'm successfully written an app with just one activity and handling the back button myself, I don't see any compelling reason to use multiple activities. The one activity application is much simpler and more straightforward.

What advantages of multiple activities am I missing?

View 8 Replies View Related

Android :: Use Multiple Activities Or Multiple Content Views

Feb 18, 2010

I'm working on an application using xml layouts.

I wish to know which is better:
1. Use few activities and change its contentview
2. Use an activity for each 'view' needed

If both works, in which case which option would be better?

View 1 Replies View Related

Android :: Multiple Activites That Share 75% Of Layout - Layouts Within Layouts?

Sep 6, 2010

I'm creating a game where there's a screen that, for the most part, is shared by four different activites - but a key portion of the screen will be completely different, depending upon which activity is active. Basically, on the left will be an image of the player and along the bottom there will be a row of buttons (let's say for Armour, Weapons, Magic, Skills). This leaves the top-right portion, which will need to dynamically change to represent the button pressed. (So, one moment the top-right portion is the armour selection activity, and the next it's the weapon selection activity, and so on.)

Is this possible? Can I have a layout within a layout and dynamically point the nested layout at a (nested) layout.xml of my choosing? Or, am I looking at just duplicating most of the layout four times (for the four different activities?) Or, am I going to be looking at linking the four activities to a (the top-right) view component, and then having to dynamically construct all of *that* view's child views based on the currently active activity? Well, that's about as much sense as I can make this question make.

View 4 Replies View Related

Android : Using Multiple Layouts For Different Screens

Dec 3, 2009

I am getting my feet wet developing software for the Android. My test app will have multiple screens (each having their own layout file). The main screen will direct the user to view the other screens based on user input. I kinda see this as layers of cake. Bottom layer being main; then you add and remove layers as the user makes UI inputs. The crazy trouble is how to view a second layer. I have created a second class which has its own onCreate method, which has its on setContentView(R.layout.secondlayer).

This class extends Activity much like my primary class does. I have a click event on a button within the main layout. This button will instantiate the new second layer class which I have done. And that is where my story endsI don't know what to do from this point. This is surely a newbie question If someone has an example that would be extremely helpful teach me to fish and I will be on my way.

View 6 Replies View Related

Android :: Multiple Screen Sizes - Layouts

Dec 16, 2009

I have created layout-large and testing against android 2.0.1 WVGA. however, its picking layout-normal. Can anybody suggest me what I am doing wrong. Even though, I have 3 layouts ( layout-normal, layout-large, layout- small), Its always picking layout-normal. why its so.

I added properties to manifest file

CODE:.............

View 2 Replies View Related

Android :: Use Motion Events With Multiple Layouts

Aug 22, 2009

I'm beginning in android development, and I've stumbled upon a problem. My application has different layouts stored in xml files, and I use motion events such as onFling or onSingleTapup. These motion events seem to apply whatever layout i'm in. My problem is simply identifying which layout i'm currently using so I can define the appropriate action. I guess what i'm trying to do is a bit like this:

@Override public boolean onSingleTapUp(MotionEvent e) { if(using main layout) { //do this } else if (using settings layout) { // do that } return false;

}

View 4 Replies View Related

Android : ListViews With Multiple Item Layouts

Aug 5, 2010

I have a ListView on my ListActivity and I'd like the rows of the ListView to be 1 of 3 different layouts. The first item in my list is always going to use layout A, the second item in my list is always going to use layout B, and all subsequent items are going to use layout C.

Here is my getView function: Code...

R.id.label1 and R.id.label2 are TextViews on R.layout.layout_A. However, txtLabel1 and txtLabel2 are null after trying to set them. Why?

I stepped through this code in the debugger and it inflated the correct layout (R.layout.layout_A) and fell into the correct case below to set the R.id.label1 and R.id.label2 text. Also, if there is a better way to do this, please let me know.

View 1 Replies View Related

Android : Using Multiple Layouts With Include Tag / Create A Title Bar

Oct 19, 2010

I'm trying to create a title bar that is the same throughout my application and have been creating layouts like this for each of my activities:

main.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent" android:layout_height="fill_parent">
<include layout="@layout/title_bar_layout" android:id="@+id/title_bar_layout" />
<include layout="@layout/main_body" android:id="@+id/main_body" />
</LinearLayout>

main_body.xml:

<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/main_table" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:stretchColumns="1"
android:orientation="vertical">
</TableLayout> Code...

View 1 Replies View Related

Android : Add Couple Of Command Buttons For Creating Multiple Layouts

Mar 25, 2009

I am new to android and trying to create a customized list. Every item in the list has TextView and one Ratingbar. I now want add a couple of command buttons at the end of the list (like BACK, HOME, , NEXT). When I add these extra views to the layout xml file then they get added along with every item in the list. I think there should be another layout defined for the buttons to be displayed separate from the list. Anyone has an idea on how to do this?

View 2 Replies View Related

Android : UI Design Suggestions For Display And Switching Between Multiple Layouts

Jun 26, 2010

I'm trying to create an app that offers the user 3 different kinds of layouts. The only common portion for all 3 would be the TextView (located at the top) that would display information specific to the currently displayed layout and 3 buttons to select the required layouts.

Is there some way we can create this UI in XML to keep only one constant part(the upper TextView) and dynamically display any one of the 3 layouts below it?
Would it be better to create separate XML's for each of the layouts (each including the upper TextView in them)?
OR would doing this via code be better?

Fast switching between the 3 layouts is important. TIA

[EDIT 1]
Actually they are 3 different layouts, with several "child" layouts and views within each of them. Could a ViewFlipper be used for switching between these? I was thinking that a ViewFlipper was only for switching between View elements?

I do have them in individual XML's right now but am looking for some way to load and unload them fast. Not sure how to do the hiding thing, will try reading up on that. [/EDIT 1]

View 2 Replies View Related

General :: Multiple Home Screen Layouts?

Mar 28, 2013

Can you have Multiple Home screen Layouts? Like Like swapping themes but layouts. I designed a bunch of custom wallpapers with corresponding Custom widgets. I'd love a way to just swap between different ones with out having to re-set up all the widgets.

View 2 Replies View Related

Android : Sharing Common View Layouts And Resources Across Multiple Applications

Jun 2, 2009

I am working on developing several individual android applications. We had created common UI Layout View XMLs, classes and resources. I would like to share these common layout xml, classes and resources across all of my android applications. I dont want to duplicate them in my applications. Is there any easy way to do this?

View 5 Replies View Related

Android :: Make ScrollView With A RelativeLayout With Multiple Child Layouts Fill The Screen

Aug 20, 2010

I have a layout that has just a ScrollView visible. It has a relative layout as its child. This layout has several other layouts (mainly text views) as its children. When the text is not big enough, the scroll view does not expand itself to fit the whole screen. Instead, it shows a gap at the bottom where the background shows. I tried setting fillViewPort=true on the ScrollView, but that just made the first child layout (RL1) to fill the screen.

CODE:....................

View 1 Replies View Related

Android :: How To Handle Multiple Adapters For One ListView?

Jul 6, 2009

Currently I'm trying to find an efficient way to handle the following scenario. Please comment on my current implementations and all feedback is greatly appreciated! I have about 7 adapters with data. This data comes from database and some come from xml queries over the internet which are kept static in memory. In my current implementation I re-use one ListView constantly to display this data as requested by the user. Here are the questions: 1. Is this a proper approach? or should I have a ListView for every Adapter?

View 9 Replies View Related

How To Handle Multiple Property Files With Android

Mar 26, 2012

I would like to have multiple property files checked in to my project that each define the same properties but for different environments. For instance, a development one and an operational one that each point to a different server.

Ex. myapp.properties.dev
-> server.host=1.2.3.4
-> server.port=8080
myapp.properties.ops
-> server.host=5.6.7.8
-> server.port=8081

I would like to have some way when building my android project to an apk to specify which property file to include and rename it to just myapp. properties.

View 2 Replies View Related

Android :: App With Multiple Activities

Feb 8, 2010

I have a very simple game that consists of only one activity, and I want to add a title screen.If the title screen is another activity, what changes do I need to make to my manifest file to make the title screen open first?The gameplay activity is called Leeder, and the title screen activity is called LeederTitleScreen.

View 1 Replies View Related

Android :: Need Twitter Client To Handle Multiple Accounts

Jan 8, 2010

So I've poked around a bit, and am mildly disappointed with what I've found so far in my search. I need a Twitter client that can actually reliably deal with two accounts, and not mix them up. I tweet for an organization as well as my own account, and cannot have it bugging up and switching accounts as I've heard that Twidroid does. FYI, I'm using the free version of Twidroid now, and have no complaints about it thus far, but I have not been wowed by it either. Does anyone have any experience with any other clients, or should I just suck it up and throw down for Twidroid? I don't mind paying for an app, as long as it functions solidly.

View 7 Replies View Related

Android :: How To Get Facebook Program To Handle Multiple Acounts?

Aug 15, 2010

I have 3 facebook accounts want to be able to switch between them with one app.

View 1 Replies View Related

HTC EVO 4G :: YouTube App Can't Handle Multiple Uploads

Jul 13, 2010

this will be a fix in Froyo, supposedly due out by christmas for all us EVO owners. (unless you have rooted it already). YouTube App won't upload Multiple movies. I take several clips when documenting my friends and family. then I like to upload them all at the end of the day off the phone. This seems like a normal practice, but it is something that the YouTube app seems to have a problem with.

Here is the scenario:

I'm in Videos.
I click Share.
I choose YouTube from the Pop-up.
Then I choose my videos (plural).
Now they are all in the Que.
First video in the que uploads slowly, and then randomly stops at 40 or 50 or 60% saying "Waiting to retry"

This is the case for every single Multiple Upload I do. So I ran tests with: Gmail - no luck cause it get's stuck on "Sending" with no progress bar. Browser - upload disabled on Mobile devices over browser. What works is - Uploading 1 video at a time.

View 6 Replies View Related

Android :: Activities And Multiple Views

Aug 3, 2010

I start a browser and from the browser,I start a video which occupies only a small part of the screen,say the bottom right corner.

Now the browser will be pushed to the 2nd position in the window order and Video will come to the first position. Is it possible that browser can have the control for active window and receive the key events though the video is the Top Most window.

View 4 Replies View Related

Android :: Run Multiple Activities Simultaneously

Aug 30, 2010

I have buil a file explorer just like a mycomputer.it reads the whole storage and system for files and directories now.i am working with start menu.i have built it in an other activity i wan to make them active at the same time?

View 2 Replies View Related

Android :: Thread In Multiple Activities

Aug 23, 2009

I have started a thread from one Activity and then i have started another activit from parent Activity . Now my Parrent Activity is in pause state . but what will happen to thread that I have started from parrent . I belive it will continue........not going in sleep state........

View 2 Replies View Related

Android :: Multiple Activities In Application

Mar 17, 2010

I seem to be missing something obvious here, why would I want more than one activity per application in Android? Does somebody have some solid examples?

View 3 Replies View Related

Android :: How To Use Multiple Map Activities / Views?

Jul 31, 2010

My situation is the following: I have written one MapActivity class that is able to display a set of places as well as single places. On startup, the application creates an instance of this MapActivity and displays multiple places. If the user clicks on a certain place, then a new Activity is launched that shows the details of the selected place. This activity has a menu item that allows the user to view the place on a map - this causes that a new instance of the MapActivity is created, except that now only this single place is displayed.

The problem now is that if the user navigates back to the first MapActivity (the one that shows multiple places) the tiles won't be loaded anymore + sometimes OutOfMemoryErrors are encountered. According to the Android JavaDocs, it is only possible to have one MapActivity per process. However, I don't want to define my MapActivity as a singleInstance/singleTask, since the user should always be able to navigate back to the first MapActivity that shows multiple places. I have seen that the Google Places app (which has come with Google Map 4.4) for Android uses multiple MapActivity instances. How is this possible?

View 1 Replies View Related

Android :: Multiple OpenGL Activities

Mar 18, 2010

I'm having a problem when I create a Sub-Activity to my main activity. Both activities have their own GLSurfaceViews. Nothing on Logcat. Basically It just opens up the new view and it's black and it never renders with the new opengl stuff. I've tried a bunch of stuff, just want to know if there's some special way I need to pause the first opengl activity to get the second to run, or if there's some toggle which I am missing, or if it just can't be done. When I open the second activity with a GLSurface View, the first activity stops drawing frames, but the second one, never initializes or starts to draw.

Main Activity Creation:

CODE:................

View 3 Replies View Related

Android :: Timer Across Multiple Activities

Jun 28, 2010

i have an android app with several activities. I need to start a timer when the first activity starts and end the timer when the last activity starts and show the elapsed time. How can i use Asynctask to do this.

View 2 Replies View Related

Android :: Running Multiple Activities

Jun 23, 2010

I have developed a simple android application, which when started opens a Timer. User is given two buttons, start/ pause. This is working fine.What i want to do is to add a way to support multiple timers when a user swipes his finger on the screen.When he swipes from left to right, a new timer should show up, but the previous timer should not stop. This is a way to add multiple timers.Also, when he swipes from right to left, i want a previous timer to show.This is what i have done so for. I have a timer activity. I have added a touch event on it. When, a person swipes his finger, i get the co-ordinates and decide whether its from left to right or right to left.This functionality is working fine, as i can see the appropriate log messages.The problem is when I'm trying to load Timer Activity.It just loads the previous Activity and doesn't really create a new one (I figured this from the timer).Is there any way to do it?

View 1 Replies View Related

Android :: Use One Object In Multiple Activities Within My App?

May 25, 2010

I need to be able to use one object in multiple activities within my app, and it needs to be the SAME object. What is the best way to do this?

I have tried making the object "public static" so it can be accessed by other activities but for some reason this just isn't cutting it. Are there any other ways of doing this?

View 6 Replies View Related

Android :: Way To Handle Multiple GetView Calls From Inside An Adapter?

May 20, 2010

I have a ListView with custom ArrayAdapter. Each of the row in this ListView has an icon and some text. These icons are downloaded in background,cached and then using a callback, substituted in their respective ImageViews. The logic to get a thumbnail from cache or download is triggered every time getView() runs.

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved