Android :: More Complex Scrollview Example Needed
Nov 6, 2010
I am working on some sort of record lookup for a database. My code allows to search for some kind of string within an index (of that database) and returns the database-position of the found thing . With this found position my program is then able to move to adjacent records from the database moving forward and backwards from the initial position in small steps. ListView seems to not work in this case, as ListView starts per default at ListAdapter position 0 and not at an arbitrary position in the (here virtual) list. The api-docs doesn't seem to specify some sort of "start somewhere else and follow during scrolling". At least I haven't found that. So what I thought of is to use a ScrollView. Unfortunately I don't have a real understanding of how that could be realized with a huge number of records (and not just a handfull like in the examples). So, my questions are: - Is it possible to start a ListView at some defined position (without reimplementing {Abs}ListView) - Or can someone provide an example on how to implement a more complex ScrollView.
View 10 Replies
Apr 28, 2010
I've made a complex layout that has the following structure:
CODE:........
Since Scrollview only supports one child, I've created a RelativeLayout to scroll several Views. Unfortunately, this doesn't work (no scrolling). Are there limitations to the kind of children used in Scrollview or am I doing anything wrong?
View 9 Replies
View Related
Feb 16, 2010
Im pulling a list of product objects from a database call and I want to build a ListView of the data in my activity with a non-scrolling header and footer. Each row will consist of a product thumbnail, some data and a button arranged horizontally. I understand that using the ListView I can inflate each row using a separate layout. Most of the examples Ive seen using ListView just show a simple array of strings that fill the whole view of the activity, but most real-world examples will be more complex and I can't find any good examples that explain how all these pieces fit together. Does anyone have any pointers to sample code with a good explanation ?
View 2 Replies
View Related
Jul 16, 2010
I must be overlooking something real simple here, but i think i'm trying to do something fairly basic.. Simply retain the scrollbar position of a ScrollView on orientation change...
Here is the code for my onSaveInstanceState and onRestoreInstanceState.. sView is the container for the ScrollView layout. Within my scrollview is a linearlayout with a lot of textviews.
CODE:............
If I set a Toast with the values of sViewX and sViewY on the Restore, the values are kept and correct.
I just tried to do a sView.scrollTo(0,150); in my onCreate.. just to see if that would open the activity at 150px down, and it didn't. I think my issue has to do with the .scrollTo method.
View 1 Replies
View Related
Mar 10, 2010
I want some of the goodies in a ListView, like being able to use a ListAdapter, and item selection, etc, but I don't want the ScrollView portion of it. I want to implement that part myself, in a different way (why or how I do this isn't really the point of this question, so please don't ask "why"). Is there a way to have a ListView that's not in a ScrollView or has the scrolling disabled?
View 2 Replies
View Related
Mar 7, 2010
I have a TabHost that requires indicators more complex than a simple string label (the tab itself, not the contents of the tab). There is no graphics involved, just font size and layout of text. The documentation suggests I may call the setIndicator method with a View instead of a CharSequence, but do not provide any pattern to follow. This almost works -- the tabs function but are not colored properly. I can probably use OnTabChangeListener to set their background color to white or black, but clearly this is wrong also -- the orange color transitions, etc. are lost. I just want the existing label behavior on text that's laid out. What pattern should I be following here?
View 3 Replies
View Related
May 10, 2010
I made the connection between my service WCF and my app android. But i'm wondering if u have ideas about using complex types (classes created on the server side). should i implement the serialization process? or should i juts create the classes on my client side(android)
View 8 Replies
View Related
Nov 29, 2009
I need to call a web service using ksoap2, I have been doing this successfully up till the point where I need to pass a more complex type to the web service.Does anybody have an example of passing a complex type to a webservice, preferably, only using SoapObject (the object in question is only Strings and dateTimes.
View 5 Replies
View Related
May 18, 2009
I have ListActivity to show a custom list. The adapter for this list is a complex layout only known for each row at runtime depending on data gathered in a previous activity. The question I have is simple. I know it takes 4-6 seconds to prepare the adapter for the rows that will be visible (first 10), however I would like to let the user know by means of the empty list functionality or otherwise. At present the ListActivity is launched via a button on a previous activity and when that button is clicked the new activity will not be loaded until the adapter is completed, and the user is stuck with the previous activity until this happens. Code...
View 5 Replies
View Related
Aug 3, 2010
All the examples I have found assume that Spinner is given an array of String. I have a Spinner whose Adapter contains an Object more complex than a String. I want the capacity to display some parts of this object. a) during drop down b) when the item is selected. Nothing fancy, just some straight text, but I need ot whole object. If I override Adapter#getView, the View that super#getView returns is a TextView, so I could set that to be some relevant text value, but it feels kind of undocumented. I did try inflating a layout containing 2 TextViews and populating them, but UI became a bit screwed up. I'm not really sure what's ok to change here and what's not. Likewise, the above presumably applies to the drop down view, but I am also not sure how to render the selected item.
View 4 Replies
View Related
Oct 18, 2009
I am trying to pass a user defined object to another activity Bundle bundle = new Bundle(); bund.putSerializable("myData", myData); intent.putExtra("bundle", bundle); where myData class implements Serializable interface. I am getting following error: java.lang.RuntimeException: Parcelable encountered IOException writing serializable object how to pass complex objects between activities?
View 7 Replies
View Related
Oct 20, 2009
I'd like to map an Array of "complex" data to a ListView. In a very simplified form my data model would look like something like this:
Code...
View 2 Replies
View Related
Jul 30, 2009
How to handle a complex type object from webservice. Presently I am able to handle simple String messages. But if I am extracting some array of objects or String, then how to handle this.
View 4 Replies
View Related
Feb 8, 2010
We want to add below update sql into our content provider:We found current update of content provider does not support it, which would not recognize the "column1" of "column1 + 1" as column name. So we have to add execSQL method into ContentProvider and I think it is dirt. So I wonder if anyone know how to do such thing with ContentProvider or any more elegant way to achieve it.
View 5 Replies
View Related
Nov 18, 2010
I am trying to extend the "android.content.Intent" class by adding a private attribute of a custom class. My goal is to send complex objects from the main Activity to a background Service.
The extension itself is not a problem, the class gets compiled without any errors and the project runs. The only problem is that the BroadcastReceiver does not receive the modified Intent and the "onReceive" method gets never called.
It there any way to pass complex objects with the help of Intents?
View 1 Replies
View Related
Nov 29, 2009
I am currently working on a collision detection routine for an Android based game which is capable of handling complex concave curves in 2D. I use complex in this post to describe any non-trivial, arbitrary shape (beyond circles, squares, etc). My problem is that all of the various methods I have come across are either too simplistic to be realistic or too complex for a cell phone. At the moment I am favoring a tile-based scheme but I am having problems figuring out how to do this with convex curves that span several tiles and may have several line segments per tile. I gave some thought to representing the curves mathematically, with each tile being an interval of the function, but there will likely be points where the curve doubles-back on itself (think the big loop at the top of a pinball table that brings the ball all the way around the table and back the direction it came). My questions boil down to:
1. Does anyone know of a way of hit testing a given simple shape (e.g. a circle) against a concave series of line segments (shapes beyond circles can be figured out from there) beyond just a Boolean result?
2. What is the best way to represent large, complex shapes programatically? I am currently favoring an XML file describing my levels and the objects in them with shape/position/physics/etc. data to be parsed in during load time.
3. Is there an altogether better way of doing this beyond line segments?
The one saving grace in this conundrum is that I know the vast majority of the objects are stationary with, at most, three or four (usually one) dynamic objects moving around.
View 3 Replies
View Related
Jun 10, 2010
I have a graphic in Adobe Illustrator (lets say a cat) that I want to use in an Android application. I would like to have the user be able to change the color of the fur using a color picker. What can I save the graphic as (SVG?) to allow me to programatically control the color from with the android app? Do I have to have a separate image for each color of the cat?
View 5 Replies
View Related
Jun 3, 2010
I'm new to opengl-es and I wonder how people are able to draw these much detailed OpenGL ES graphics, e.g. on Android OS. It's already hard to draw a single squre, because it's composed of triangles due to the reason that OpenGL ES obviously cannot draw anything else than triangles.
I thought about this approach:
Drawing and rendering an object in Blender.
Export it somehow as array of vertices and an array of colors
Copy this array of vertices into the Java code
Run the code
Or are there approaches to solve such problems in a better way? I do not think that people just "draw" their graphics as array of vertices in the code. I'm sure they draw them anywhere else and import it into the code.
If there is such a solution with Blender, I would be pleased to know how this is solved.
View 2 Replies
View Related
Apr 30, 2010
This is a bit complicated to explain (and my first post), so bear with me please: I am currently trying to figure out the best way of saving my application's state in a bundle on the onSaveInstanceState event (working on a game). My application's state is based on a "world" class which contains various objects. Among these objects there is a creature object which contains bitmaps (Bitmap object)(allowing me to draw the various sprites of the creature when it's walking with more flexibility and accessibility).
Bit of creature constructor Java:
CODE:.................
After looking around for a few hours I found that serializing the world object (and all its sub-objects) was an acceptable way of saving it in the bundle. Unfortunately it appears that we can't serialize bitmaps and considering they're a part of my "creature" I can't seem to see a workaround.
Here come my questions: 1- Am I doing something fundamentally wrong? (not supposed to save bitmaps in objects? supposed to handle bitmaps in a separate class which I don't pass on the bundle and reload my bitmaps when restoring the application? ...) 2- Is there another way of passing my "world" object into my bundle (would using Parcelable work?)
View 5 Replies
View Related
Nov 13, 2010
I am working android app, where i need a Listview which contain different types of view sets. They have to update dynamically. i.e , initially i have some list of views, with one header. Next when i click button i have to add new view set with different header. So can any one tell me . how to achieve this complex listview.
View 1 Replies
View Related
Feb 9, 2010
I am working on a project for which I have formulated a fairly complex layout but I have no earthly idea how I could implement such a thing. Attached is an image of what I'd like it to look like, can anyone think of a way to generate such layout?
View 3 Replies
View Related
May 30, 2009
This is my first S/O question.
I'd like to know more about porting C applications to native ARM for use on Android devices.
I can make simple programs using the prebuild toolchain which comes with the source, but how can I use this toolchain with applications which are more than one file and require configure and make?
View 2 Replies
View Related
Feb 17, 2010
The object passing between an Android service and the remote binder is happening through serialization of the object. If the service needs to return a very large collection, it seems very inefficient to use this. What is the recommended way to deal with this?
View 1 Replies
View Related
Feb 27, 2012
My app sends a request to a php script on my website and the php script sends back a JSON string like this:
Code:
{"route": [
{
"summary": {
"leaveat": "11:58",
"arriveby": "12:23",
"duration": "25 mins",
"transfers": 1,
"fareA": "1euro",
"fareC": "0.8euro"
[code]....
The main tag is "routes", it contains "route" which is an array of objects consisting of a "summary" and "sections", "sections" is an array itself.Well, what I need is to parse this JSON to be able to write details for each "route" such as:
-duration: 25 mins - transfers: 1 - fareA: 1euro - fareC: 0.8euro - Station1/11:58-11:59 - Station2/12:06-12:23 - Station3/x
-duration: 40 mins - transfers: 2 - fareA: 1.4euro - fareC: 1euro - Station1/12:03-12:20 - Station2/12:21-12:25 - Station3/12:28-12:32 - Station4/x"
I'm trying to do this from yesterday and I can't find the way to read the data from the JSON string.I've tried with getJSONObject() and getJSONArray() in many combinations, but no the correct one.Since I've tried many codes, I think is useless to write here what I tried.I've removed the outer "routes" which actually was useless, but I yet can't parse it.
View 1 Replies
View Related
May 15, 2010
Why is the 2.1 update for the Moment so complex. I have a droid and convinced my mother to get the moment a few months ago when she was do for an upgrade. She was over last night and I went to update her phone for her. Verizon updates are easy. You put an update.zip file on your sd card, reboot into recover, apply update.zip, reboot and your done. No computer needed since with Astro you can copy paste the update.zip file to the proper location if you download it via your phone. Not so with the moment. You have to download a .exe file and leave the device connected to your computer? there is a multi page guide to read? what? And no over the air update at all? With verizon you only had to do the update manually if you were too impatient to wait for your hand set to get the update OTA. This is another example of why sprint is doing so poorly. This is terrible customer service. My computer has all of its usb ports broken, but i have my phone rooted and flash new roms all the time and the lack of usb ports is no problem but i couldn't even update my mothers phone to a long awaited update because of this.
View 4 Replies
View Related
Feb 11, 2013
I am more of a graphics designer than a programmer.I have very basic knowledge as far as programming and API's are concerned.I know there are tools out there which can Compile and Recompile APKs,but I was wondering if its possible to edit just the graphical elements of the app (say, change the app icon,or modify the typography, or color accents) without the need for changing a whole lot of the code?
View 6 Replies
View Related
Oct 5, 2010
I have just got a Galaxy s and i am looking for an app that i can set up my own alerts i used to be able to set up different things on my blackberry so when i was in work it would just vibrate and beep on a message also looking for a notification app for missed calls messages etc
View 3 Replies
View Related
Aug 17, 2010
I'm waiting for an ordered HTC Evo and will use it primarily for WiFi use and talk/ Text. I plan to use this with my desktop connecting to Evo's hot spot function. What will I need to get internet from Evo using a Compaq Presario SR2170NX Desktop? Do I just go to the network area and let it "find" the Evo after stetting it up?
View 8 Replies
View Related
Aug 17, 2010
I have a huge filofax thing, which I would like to ditch from my bag, and wondered if I could turn my phone into something more suitable. I have jorte calendar, but I do find it annoying that you can't read what's in the box, as even the smallest font is too big. Any ideas on a better calendar. I would also like somewhere to store my addresses, and a password locked notepad. I often use a note pad to jot down passwords & username etc. Any suggestions would be great, free or not i dont mind!
View 6 Replies
View Related
Aug 6, 2010
I really like the built-in calendar app on my new HTC Desire. But there's 3 things that it can't do, and I really need them:
1. I need to be able to set up how the calendar calculates week numbers. I live in Demark and in Europe we don't calculate week numbers the sane way as they do in the US.
2. I need to be able to set up repeated appointments that repeat every second week, or every third day.
3. I really want to be able to set the default reminder time to 'Do NOT remind me'. The built-in calendar app lets me set the reminder value to 'No remind' when I create a new event, but it won't let me set the default value to 'No remind'.So basically I need a calendar app that works precisely like the built-in one, apart from the 3 things mentioned above
View 11 Replies
View Related