Android :: Aligning Components At Desired Positions

Mar 30, 2010

Seeking help to design a layout as shown here:

http://docs.google.com/Doc?docid=0AQhgDtGvE2HgZGZ6cmtua185MTd0eGdyZmc&hl=en

The major challenge I face is aligning the components at desired positions. Please refer the three buttons(icons) and the way they are positioned.

Literally, going nuts, thinking how to position those exactly at the desired places.

Android :: Aligning components at desired positions


Android :: How To Increase FPS When Draw On Canvas - Now 20 - Desired 40-50

Jan 18, 2010

First I want to say that I have read many articles on this subject in this forum and on some external resources(very helpful was Robert Green's diary at www.rbgrn.net and www.droidnova.com).

However, despite all of this I want to start topic regarding FPS, and ask for advice from experienced game developers on Android platform.

My main question is "How to improve FPS when draw on Canvas?"

I have implemented simple 2D arcade game skeleton for testing purpose. Now I have ~20 FPS and want to increase this value to 40-50 FPS, if this is possible of course. I know about Open GL ES, but so far I am interested in Canvas.

In every frame I draw following stuff on the screen: - Canvas.drawColor(Color.BLACK) - to clear the screen - 1 spaceship PNG 24x24 image 1.25 kb - 5 asteroids PNG 64x64 image ~8 kb each - from 1 to 30 bullets PNG 8x8 image 299 b - 4 30x30 Rectangles - to control objects on the screen

After running my app, in logcat I can see following output data: - Average FPS: 20 (Total frames drawn: 1945 in 97 seconds) - Average onDraw: 32 ms (clear canvas: 3, draw game stuff: 26, draw controls: 1) - Average updatePhysics: 1 ms

From this output I can assume, that my main problem here is "draw game stuff" wich includes: - draw 1 spaceship - draw 5 asteroids - draw from 1 to 30 bullets

Here is my code:........................

View 1 Replies View Related

Android : Use Combination Of Layouts To Get Widgets At Desired Position?

Oct 19, 2010

we are confused with designing interface file for android,we have made user interface with Absolute layout and used "dip" instead of "px" (for different screen size issue) ,but it looks like,Absolute layout has been depreciated,and developer.android, recommends not to use Absolute layout

So other option we have is to use
1.Linear layout
2.Frame layout
3.Table Layout
But we are unable to bring Combination of above layouts so,that we can make button/widgets to proper position we need
How do we make widgets to desired position of screen with above said layouts and making them compatible with different screen sizes we have in android devices
would like to get a generic answer about same,

Tools used are: DrawDroid

View 1 Replies View Related

Android :: Aligning Right Column In The List

Dec 2, 2009

I am having multiple choice list where I have three column like below ************************* Col1 Col2 Col3 ************************* Col2 and Col3 should be right aligned with a gap of 10 px in between

code:................

View 3 Replies View Related

Android :: Aligning Image Button Bottom Right?

Nov 8, 2010

How to align an image button bottom right. My code is as follows:

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/ android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="center_horizontal" android:background="@drawable/help"

View 2 Replies View Related

Android :: App - Aligning ImageviewS In Center Horizontally

Jul 19, 2010

Im messing with imageviews and I am able to align a single imageview in the center horizontally with android:layout_centerHorizontal="true"

Now my main problem is that I have X imageviews and when I align them all like that, and then use the android:layout_toRightOf="", they just start from the middle.

View 1 Replies View Related

Android :: Aligning With Center With Hierarchical Layouts?

Oct 3, 2010

Why doesn't the following code align with the center?

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

View 1 Replies View Related

Android :: Getting Ready To Publish - Signing / Aligning Of Application

Nov 10, 2010

I'm just about ready to Publish my application. I have a question about the Signing/Aligning of the application. In looking at the Android documentation they say to run "ant release" to compile the application in release mode. Then to sign and align the apk run "jarsigner" and "zipalign". I had used "android create project" to create my build.xml.

I modified it to run proguard. I find that when I run "ant release" it appears that signing is done as part of the process (I'm prompted for my keystore password) and the apk is zipaligned. I guess I'm confused that the documentation makes it 3 steps, "run ant release" then jarsign, then zipalign. BUT, my "ant release" seems to do everything. Is the documentation not upto date? Is it safe/acceptable to just run "ant release"?

View 2 Replies View Related

Android :: Droid ScrollView Not Aligning In Screen Landscape / Can I Fix

Oct 19, 2010

I am having a problem in ScrollView. When i run my application on X10i it works fine but when i change the view to landscape half of the layout at the bottom (RelativeLayout) go down to the screen. Here is my Layout code. please suggest a general solution that will be applicable to all phones not only X10i. code...

View 2 Replies View Related

Android :: Relative Layout Limitation - Aligning Items Between Groups

Aug 4, 2009

Is it true that if you have a ViewGroup, say a RadioGroup, you can't align items outside the group to ones inside the group (using toRightOf, alignTop, etc.) That is, does toRightOf, toLeftOf and the rest only work with views at the same hierarchy level? I was trying to label some vertical radio buttons today and find I can only align to the RadioGroup and not the buttons inside the group.

If I remove the RadioGroup, then I can align things OK. There are lots of workarounds, of course, so I'm not stuck. Just thought I'd ask and document. And, BTW, where is the hot sh*t resource editor for Android so I can bang out screens quickly like the iphone guys, using a visual interface designer that knows all these silly interactions? The tools I've seen so far have been toys.

View 2 Replies View Related

Android :: Relative Layout Aligning Images About Right Bottom Corner

Nov 2, 2010

I am using relative layout to superimpose one smaller image on top of a larger one. I want the bottom-right corner of the smaller image to coincide with B-R corner of the larger image. Im using margin parameters in my layout xml (specifying measurement in dips) but this doesnt seem to work for all devices and resolutions - in some cases the small image is shifted by 4-5px from the border. Is it possible to specify the position of the smaller image without pixel values? Ie with gravity or something?

View 1 Replies View Related

Android :: Getting Home Screen Positions

Oct 19, 2010

My question today relates to the android home screen and where it stores icon / widget positions. Specifically, I am interested in accessing the positions and sizes of any icons that are currently being displayed. I have, so far, been unable to find a method of retrieving the positions of other applications but i figure it must be possible in some way due to the presence of third-party home screen applications. Ideally, I am hoping to query the positions of whatever is on the screen at the moment from a live wallpaper and adjust my rendering accordingly.

View 1 Replies View Related

Android :: Specifying Relative Positions In Layout?

Sep 30, 2009

I need to implement a screen containing a list of blocks one below the other. Each block will contain mutiple superimpose elements (Images, text) for which the relative position needs to be specified with respect to the top left corner of the block.

For creating the list of blocks i have used listview. For each block i tried to use relative layout.This works ok when the phone is in landscape mode and absolute position is specified relative to left edge of the phone. But when the phone is put in the portrait mode the layout gets distorted.

1) What layout can be used for this scenario?

2) Can relative positions be specified in terms of percentage of screen width/height instead of pixels?

View 3 Replies View Related

Android :: Selected Positions In A Listview

Aug 27, 2009

How can I retrieve the positions of the selected item in a multichoice listView ? The getSelectedItemPosition method returns only the first one...

View 1 Replies View Related

Android :: Swap Two Buttons Positions In TableLayout

Jul 21, 2010

Suppose I have the following layout

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

How could I swap position of button01 with button02? And would it work also for swapping button01 with button05?

Before asking what I have tried so far, I don't even know where to start. I googled but the only answer I could find was about AbsoluteLayout.

View 1 Replies View Related

Android :: Actualice The Positions Of The Items In A Googlemap?

Nov 18, 2010

Hi, i have a googlemap app that displays two items (itemizedoverlay class) and i have a Update button. When i press the update button, i want to remove the items from the map, and put again the same items but with the new latitude and longitude values (i have a service that actualice the latitude and longitude fields that i have in sharedPreferences, and also i recibe the other position by a bundle)

what i am doing wrong? when i try my code, the items of the map doesn't be removed.... just new items appear... but i want to remove the old ones

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

And these are my two functions:

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

I also tryed with invalidate() on the mapview but it doesn't works... still paint the old items...

View 1 Replies View Related

Android :: Change Object Positions In Layout?

Jun 7, 2010

I'm currently working on a very simple aplication, and I intended to make it change the visual aspect depending on the screen size. The application just has 6 buttons like this:

I'm using the AbsoluteLayout, and changing the x and y of the buttons with the methods offsetLeftAndRight and offsetTopAndBottom. I'm not changing the layout of the buttons in the xml file, so the all start in the same place.

However, if I use this methods inside the onClickMethod they sometimes appear where I want them, sometimes don't (can't figure out why), but if i use them in the onCreate method, nothing happens.

View 2 Replies View Related

Android :: Advanced Gradients - Thumb Positions?

Oct 16, 2010

I am trying to create a gradient drawable to depict a ratio of something. As a general example, lets say you were looking at a listview containing a fleet of cars. The background could be a fuel gauge - I don't want a smooth, wide transition. I want a very tight transition, and I want to be able to set where that transition takes place.

Here's what I'm staring with, but I'm not getting very far.

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

View 1 Replies View Related

Samsung Moment :: Ringer Escalating - When Phone Rings It Doesnt Ring At Desired Volume From Begining

Dec 24, 2009

Okay so i created a folder on my sd card called ringers, worked great for allowing me to use my mp3 files that i croped for my ringtones, however when the phone rings it doesnt ring at the desired volume from the begining, it vibrates only for 1 pulse then the volume slowly comes in from min to the desired level it is as if it is set to escalating. I have searched through all the settings but if there is a way to turn this off i have missed it. I know the mp3 file doesnt escalate because i use the same file on my moment and it rings at full volume from the beginning.

View 1 Replies View Related

Android :: Icon Image Rotate Positions In Contacts?

Jan 10, 2010

I thought it may have been my eyes, when I thought I saw an upside-down Android icon for a contact the other day, on my Android 1.5 device - Samsung Moment. I was playing with contacts just now, and I saw the upside down icon again. Then I was curious, went to see other contacts, and I noticed the Android icon facing right, then facing left in other instances. There is no rhyme or reason as to when the Android icon will change positions, but it is there.

View 1 Replies View Related

Android :: Draw Cupola Circles At Random Positions

Jun 15, 2010

I am trying to draw a cupola circles at random positions in an Android application. I draw them on a bitmap and then draw that bitmap on the canvas. This is the function where a draw the circles:

private void drawRandomCircles(int numOfCircles) {
Canvas c = new Canvas(b);
Paint cPaint = new Paint;
cPaitn.setColor(Color.RED);
for(int i = 0; i < numOfCircles; i++) {
int x = Math.Random % 100;
int y = Math.Random % 100;
c.drawCircle(x, y, 20, cPaint)
}
}

The Bitmap b is global. And after calling this function I just draw the bitmap in the onDraw method. Now the problem is that I only get one circle drawn on the screen, no matter the size of numOfCircles.

View 1 Replies View Related

Android :: Synchronize Two ListView Positions When I Scroll Any One Of Lists

Nov 24, 2010

I have two ListViews. Is there any way to synchronize the position of ListViews when I scroll any one of the Lists

View 1 Replies View Related

Android :: Display Images Dynamically On Dynamic Positions?

Sep 2, 2010

I have rectangles and images and i want to show that images on that positions that rectangle holds in it...it is all dynamic. and i am using bitmap class to display but now i have to set positions according to that rectangle...

View 1 Replies View Related

Android :: Manipulate Positions Of Background Images In ImageButton?

Jun 1, 2009

Is there a way to manipulate the positions of *background* images in an ImageButton?

View 2 Replies View Related

Android :: Need A Profile Manager To Select A Desired "scene"

Sep 8, 2010

Can anyone tell me if there is a profile manager that allows you to select a desired "scene" along with other settings such as Airplane, Volume, etc?

View 3 Replies View Related

Android :: Running Directly Going To Connection Settings Page / Instead Of My Desired Page

Aug 6, 2010

I am trying to use open intents simulator and do all the settings according to the instructions. But when i tried to run a sample program, after running, its directly going to the "connections settings page" in openintents.apk.

View 49 Replies View Related

Android :: Google Maps & Apps With Mapview Have Different Current Positions

Jul 20, 2010

I have a mapview where I want to track the user's current location. GPS as well as 'use wireless networks' is activated in my phone settings.

Nevertheless, since I'm indoor I don't get a GPS fix, therefore the location is determined via network; wifi spot is available.

I have the Google Maps app running as well as my application running.

Strangely, the current location differes between Google Maps and my application, where the Google Maps is very accurate while in my app the location is somehow off a few 100 meters.

In my application I basically do the following (for debugging purposes now):

1) initially place one marker on the map: geopoint retrieved via locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);

2) initially place another marker on the map: geopoint retrieved via locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);

This will put the last known locations of both providers onto the map (eventually last known from outside my app).

3) then for the regular updates (since I don't get a GPS fix anyway indoor here), I do:

locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, baseLocationListener);

You can see for the frequency and distance I pass the 0 param in both cases.

In the app manifest, the following permissions are granted:

android.permission.ACCESS_COARSE_LOCATION
android.permission.ACCESS_FINE_LOCATION
android.permission.ACCESS_MOCK_LOCATION

Actually my baseLocationListener does get called, which I see in the log, but the updated location is somehow the same as the last known current position (of LocationManager.NETWORK_PROVIDER), same lat/lng.

I thought maybe I overlooked something or missed a parameter or setting, or my code has a bug. Therefore I installed some other (3 in total) LBS apps from the Android market that also show the current user's location. The current locations displayed in those apps are equals to the one in my application - and they're all some 100 meters off - but at least all the same.

See the screenshot here:

http://img33.imageshack.us/img33/8679/mapproblem.png

Now I am wondering:

1) as I understand, getLastKnowLocation is system-wide and not app-wide, why are there differences between the location in Google maps and all the other apps?

2) does Google Maps not update the lastKnownLocation of a provider?

3) does Google Maps use a different custom location provider (i.e. due to licensing reasons) other than GPS_PROVIDER or NETWORK_PROVIDER as they are in the SDK?

4) how do achieve the same accurate result with the NETWORK_PROVIDER like Google Maps does?

View 2 Replies View Related

Android : Place Controls At Absolute Positions - Custom ViewGroup

Sep 26, 2010

I have a custom ViewGroup. The idea is to be able to place controls at absolute positions and then have the ViewGroup scale those controls based on the difference in the screen dimensions with respect to the original design dimensions. I am using the code below. In response to the 'onMeasure' message, I am storing the width and height of the view. Then on the 'onLayout' message I am computing new dimensions for the child controls and adjusting their sizes proportionally. This all works to some degree. However for certain controls (e.g. button controls), the control resizes, but the text inside does not remain centered within the control. I am thinking that there is some other call I need to make to update the child controls after I change their size.

View 3 Replies View Related

Android :: Google Maps & Apps With Mapview Have Different Current Positions Options

Jul 20, 2010

It seems that the problem is in the data quality of the different map provider that are used for Google Maps and MapView in SDK, which differ.

The map tiles coordinates don't seem to be very accurate, just like in the public google maps web api / tiles.

See this screenshot for an example, where I pinned the same geo point. http://img339.imageshack.us/i/gmaps2.png/

The map using the public map api is off a few hundred meters. Seems that we just have to live with it.

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

View 2 Replies View Related

Android :: Dumped XML Layout File Padding Positions Not Behaving Correctly

Dec 30, 2009

I've been trying to figure out how to make some sense of a dumped XML layout, and it's progressing 'pretty good'. The only thing I'm currently unsure about is the following:

When I use the command:

aapt dump xmltree <pathofapk> <pathofxmlfile>

I get the following result:

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

That's all good, but what I'm trying to figure out is how to convert the following code into the XML layout file:

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

Converting those values to decimal would result in:

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

All good, but I've been trying to figure out what the (type 0x5 means). With all other types, the result is defined in the Android.util.TypedValue.class file

Decompiling that, gives the following result for 0x5:

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

Makes sense, in a way. But, I need to know what kind of value it is, so looking down, I find the following value:

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

But, when I try to use 2561mm and 1025mm (It's a tad much anyway, 25cm is.. larger than my screen), The whole screen is filled with the 'parent LinearLayout'.

View 3 Replies View Related







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