Android :: RelativeLayout : Description Of How It Works
Oct 13, 2010Can anyone point me to a good one?
View 2 RepliesCan anyone point me to a good one?
View 2 RepliesI have published a free app on the android market. I want to edit the description and add a couple of screen shots. While the "Upload Aplication" screen on http://market.android.com/publish lets me make these changes & saves them too, they don't show up in the description of the app when I go the android market. Do I have to unpublish & republish the app (in which case I might run into version issues)? Or else, how do I make these changes to description appear on the android market?
View 1 Replies View RelatedIs there any idea if this will increase in the future? This is extremely limiting.
View 2 Replies View RelatedOkay, so I'm writing my first Android app and am basically stuck. The app is a short 4 question quiz with two choices per question. This creates 16 possible results, which I've created descriptions for. I want the app to display the description corresponding to the user's responses on each of the questions after the 4th question is answered. Right now I am storing the values in a string, which is supposed to build upon the previous string answer, after each question. So the first answer is t1, the second answer is t2, and so on. Here is the code for the second question: My problem is that the strings won't hold the values I assign them in the previous question. I have a textview that briefly displays the values returned by the question's answer string (t2 for Question2) and it displays null alpha or nullbeta, depending on the user's response. How do I retain the t1's previously assigned value into Question2 so I can add to it? For instance, if T = "alpha" from Question1, and the user selects button b1 in Question2 how do I make t2 actually equal "alphagamma" instead of "nullgamma"? Is this even possible with strings?
View 1 Replies View RelatedIt should be application to iPhone or Android or other mobile platform, where, basically, user can access map with "places of interest" and add it's own "place of interest" (with photo and description). Kind of, community generated sightseeing map. I know it is quite simple and not a groundbreaking idea, but my google-fu is quite weak and I can't find anything like that.
View 1 Replies View RelatedI've been curious as to all the optimizations that go into the building of an .apk. I'm curious because of two things I've tried in the past to bring down the size of my .apk:
I have had a few large json assets in projects before, as well as a static sqlite database. I tried bringing down the size of the apk by gzipping them before the build process, but the resulting size is exactly the same.
I just today tried pngcrush on my /drawable/ folders. The resulting build was exactly the same size as before.
I would think that perhaps #1 could be explained by the zip process, but simply zipping the /drawable/ folders in #2 result in different-sized files. Perhaps the build process runs something akin to pngcrush?
Regardless, I was wondering if anyone knew where to find a detailed description of all the optimizations in the Android build process. I don't want to waste my time trying to optimize what is already automated, and also I think it'd help my understanding of the resulting apk.
I'm working on my new project but I can't figure out how to add a text under my Gallery.
I have 3 pictures, if I slide on picture 2 I can see under picture 1 and 3 the correct description but it doesn't appear the description under the selected picture (in this case the number 2).
This is my code...
Can anyone send me link which has an example for parsing json in android with a detailed description?
View 5 Replies View RelatedI'm searching for some good material on android threads but I couldn't find references for a complete description about this subject. So if you know any valuable reference please point them to me.
View 1 Replies View RelatedMy first android game is nearly ready and its already in the market.
I hope you could give me some good feedbacks.
QR - Code:
http://fs01.androidpit.info/aqr/x76/370976-1272358669695.png
Little screen with explanations:
http://fs01.androidpit.info/ass/x70/200570-1273055185311-160x240.jpg
It has global highscore.
Game discription:
The goal is to collect boxes using the touchscreen to control the avoider, while avoiding the red smileys that move around the map to avoid death.
(100 Boxes comes with the next update in 2 days)
You have to collect the 100 boxes that appear one at a time on screen using the avoider. Each time a box is hit with the avoider a new box will be revealed at a different place on the field. With every box picked however,a red smiley will materialize as well. These move across the screen in various speeds and directions. Every box collected gives 1 to 5 points, depending on the time taken to pick it and increase the red smiley speed. Apart from getting less points when being slow, the avoider will also slowly grow bigger if it doesn't pick a box. It regains its original small size after picking up a box.
Every 15 boxes a green smiley will appear from the left hand side of the screen. When the avoider touches it, it goes into 'rage', meaning it will temporarily change into a big evil avoider that can eat the red ones, who now are the grey ones. The rage lasts for about 3,5 seconds, with every red smiley eaten counting as a point, which makes the game easier after the rage.
If you kill more then 15 boxes in a row, you gain the difference between the kills and 15 as bonus points for each pointbox. It will be shown next to the box. One important feature is the 'slowmo'. With every eaten pointbox a bar fills to a maximum of 10 seconds. You can activate it anytime by making an doubletab everywhere on the screen. The red smileys will move very slowly, allowing the avoider to maneuver easily.
The last feature is the bomb. You have one at start and about ~ 50 eaten point boxes it will appear an new bomb falling down the screen. You can only have one bomb at time. You activate it by making a doubletab on the bomb icon. Is has the affect, that all smileys die instantly.
*add I hope you enjoy it. Now I have implemented a integrated highscorelist (scoreloop)
Scoreloop Community | Avoiding. Have fun!
I've been progressively expanding my UI, and I want to add a ListView in the middle of my UI. When I add it and change the activity to extend a ListActivity instead of just an Activity, I'm getting a Force Close. Using 1.5. Does a ListView not work embedded in a RelativeLayout?
CODE:.........
XML looks like this:
CODE:..........
And the listrow.xml:
CODE:.............
I have a Relative Layout.
Which has 2 buttons, side by side and it is right-aligned.
So this is my layout xml file. My question is there are no spacing between the right-most button and the right border of the RelativeLayout and between the 2 buttons. How can I add that? I play with android:paddingRight, but nothing helps. code...
So the cable advertised that comes with this phone is a micro - USB cable. I went and ordered four cables as spares (2 for the cars and an 1 for each of our work). These cables have not yet arrived so I have not tried them yet. This is what I ordered:
Amazon.com: RiteAV - USB A to Micro-B Cable 6 ft.: RiteAV: Electronics
However, this morning I forgot my cable that came with the phone at home so I asked around if anyone had one so I could charge my phone. 4 people gave me cables to try that were micro - USB cables. They *look* like the cable that came with the phone but none of them will insert into the phone. So - now I have doubts that what I ordered will work with this phone.
1) Can anyone tell me if they think the above cables will work?
2) Can anyone tell me if there is a more precise description of the phone cables type?
3) Can anyone point me to a source of 6 foot long cables that will work with this phone?
There is an repeating background attribute like in css for layout on Android API?
View 5 Replies View RelatedI know my original post (at http://groups.google.com/group/android-developers/browse_thread/threa..., I could not find a way to perform a reply, maybe it's too old) is not sexy, but I'm now facing that problem in many situations. Let me please rephrase what I attempt to do, and what my problem is.
I have a RelativeLayout made of three widgets (named 1, 2 and 3 on the illustrations below): one attached to its parent left border (labelled 1), one to its parent right border (labelled 2) and the third (labelled 3) inserted between the 2 previous ones (its left border is attached to the first widget right border, and its right border is attached to the second widget left border). The third widget (the middle/central one laballed "3") is far taller than the two others, and I would like the first and second items (1 and 2) to be vertically centered with the middle widget.
I have resorted to the "android:layout_centerVertical" attribute for both the first and second widget, but I do not get the expected result. See at the bottom the various layouts I'm mentionning. Could someone please help me, and tell me whether what I intend to do is feasible, and how? Thank you for your time.
Layout with no "android:layout_centerVertical" specified: ------- |1|3|2| --|3|-- |3| ---
Layout with "android:layout_centerVertical" set to "true":
--- |3| |3| |3| ------- |1| |2| --- ---
What I'd like: --- --|3|-- |1|3|2| --|3|-- ---
I've always been using RelativeLayout everytime I needed a View container, because of it's flexibility, even if I just wanted to display something really simple.Is it ok to do so, or should I try using a LinearLayout when I can, from a performance/good practices standpoint?
View 1 Replies View RelatedI want a RelativeLayout to have a rounded corner just like we have it in the Iphone.Please let me know how can we do this in Android.
View 2 Replies View RelatedI'm trying to center a button in relative layout, is this possible? I've tried the Gravity and Orientation functions but they don't do anything.
View 3 Replies View RelatedI would like to further annotate the custom markers I have placed on a MapView (using ItemizedOverlay) by displaying a simple text label that appears for a particular item when the onTap event is fired.
This is a trivial exercise in the Google Maps JavaScript API and in MapKit on iPhone, but it is not obvious to me what the best or easiest way to do this is on Android.
I have a problem with two Textviews on the same height in a RelativeLayout running into each other.
I use the following Layout.
CODE:...........
This gives me this view:
Everything is as I need it except the two textviews name and information are displayed on the same screen space with the one on top of the other.
Since I'm still just learning Android (and it appears Amazon says it'll be 2 months till I get the Hello, Android book) I'm still playing around with doing simple things. I have no problem getting an icon to display with the click of a button on my RelativeLayout using ImageView. The code for creating it is as follows:
private int mIconIdCounter = 1;
private ImageView addIcon(){
ImageView item = new ImageView(this);
item.setImageResource( R.drawable.tiles );
item.setAdjustViewBounds(true);
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams( LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT );
if( mIconIdCounter != 1 ){
params.addRule(RelativeLayout.RIGHT_OF, 1 );
}
item.setLayoutParams( params );
item.setId( mIconIdCounter );
++m_IconIdCounter;.......................
Can anyone tell me how can i do this using Java code or in activity class? I do not know how to set android: layout_alignParentBottom="true".I want to implement whole view via java code.
View 1 Replies View RelatedI'm trying to build an android application that features a graphical display drawn within a RelativeLayout. I want to place "+" and "-" buttons next to several of the parameters, which are drawn at various points on the canvas. The positions are free-form don't seem to conform to any of the standard XML layouts.I know how to create the buttons programmatically, but I don't know how to place them over the canvas where I need them to be. I'm assuming that this would be done in the view thread's doDraw() method, after all the graphics have been drawn, but how?
View 2 Replies View RelatedI have ScrollView with RelativeLayout as a child of ScrollView. I am trying through JAVA code to set Layout_Gravity to CENTER so my RelativeLayout is centered (horizontally and vertically) in the middle of ScrollView (that covers whole screen).This works fine in XML and produces desired result, but when I try to do this programmatically, it seems there is no way to set Layout_Gravity of RelativeLayout. I tried using LayoutParams, but couldn't find anything there that would help me to center RelativeLayout in the middle. So, am I missing something or this simply can't be done?
View 7 Replies View RelatedI have the following structure defined in an xml layout file.
<RelativeLayout android:id="@+id/mainLayout"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content" android:layout_height="wrap_content">
<FrameLayout android:id="@+id/frame" android:layout_centerInParent="true" android:layout_width="wrap_content" android:layout_height="wrap_content" ></FrameLayout>
<Button android:id="@+id/button" android:layout_below="@id/frame" android:layout_width="wrap_content" android:layout_height="wrap_content" />
</RelativeLayout>
The FrameLayout is positioned correctly in the center of its parent. But the Button isn't getting positioned under it. Instead it's displaying in the top left corner. Am I doing something incorrectly or is this a bug with RelativeLayout?
As i am facing limitation of layout depth in my application, i am replacing some LinearLayout with RelativeLayout. However i am stopped by a supposely very simple issue (but apparantly without clean solution regarding that http://stackoverflow.com/questions/1499555/android-layout-centering-i..., nor in the ApiDemos sample where RelativeLayout are too simple):
How can i align vertically 3 items (in a simple way!) which are on a horizontal line with RelativeLayout without?
does not seem to have any effect at all.
Here is the xml; in this example i would like an icon at left (fixed width), a text label in the middle (fixed width) and an edit text on the right (remaining space). the problem is that the TextView seems to ignore the parameter android:layout_gravity="center_vertical", and seems to be top aligned with parent. code...
Of course i can use marginTop/Bottom and alignTop/Bottom on each single item but that's not very clean.
I created a background .png for my application in GIMP. It's resolution is 640x480, which from googling, seems to be the resolution for a default emulator. My problem is when I apply the background to the RelativeLayout with android:background=@drawable/bg and run it, there are lots of artifacts in the image. As if the emulator could not provide enough colors to display the .png correctly. This image is nothing to fancy, just simple lines and radial gradients.
View 1 Replies View RelatedIn my Android App Activity, I have a RelativeLayout with one ImageView and a couple of TextViews being populated at runtime. I also have a Save button in the activity that I use to save the image in the ImageView to the device SD Card. Now what I really want to do is Convert the elements (image and the text in the RelativeLayout) together to a PNG image when the Save button is clicked and Save it to the SD Card. Have anyone tried a conversion like this before? It would be very helpful if someone can give me some hints or code snippets on how to go about doing this?
View 1 Replies View RelatedJust include the name, description and picture. It will be interesting to see what some people have. I am looking forward to learning of some new goodies.
View 2 Replies View RelatedI'm starting to use RelativeLayout more and more but there are some things I keep running into.
Say I have a status textview that I want top and center. Then I have a bunch of other objects below it like images and a table layout.
I want the stuff below the status text view to respect the status textview's personal space and not draw themselves right on top of it.
But what I'm seeing is that in a relativelayout, everything piles up on eachother unless I use alignment such as android:layout_below and android:layout_above.
Is there an attribute that I can add to the status textview to make it so other objects don't want to draw right on top of it? Or do I have to keep using the alignment tags on everything and align things away from it?