Android :: Pass Complex Objects With Help Of Intents?

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?

Android :: Pass complex objects with help of Intents?


Android :: Pass Complex Objects Between Activities

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

Android :: Pass Objects Around Activities Using A HashMap Of WeakReferences To Objects?

Oct 26, 2010

The FAQ mentions a method of passing objects around activities. (It is not clear to me): "A HashMap of WeakReferences to Objects. You can also use a HashMap of WeakReferences to Objects with Long keys. When an activity wants to pass an object to another activity, it simply puts the object in the map and sends the key (which is a unique Long based on a counter or time stamp) to the recipient activity via intent extras. The recipient activity retrieves the object using this key.".................

View 7 Replies View Related

Android :: Handle Complex Objects From Webservice

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

Android :: Why Passing Objects To Intents Are Not Straight Forward?

Oct 29, 2010

Why is that the object has to be serialized or be Parcelable in order to be passed to an Intent ?

View 1 Replies View Related

Android :: Transfer List Of Specific Objects Across Intents?

Apr 18, 2010

I wish to send a list of type <MyFriend> from one activity to another. I dont find a bundle.put...... for such an requirement in the api's. Is there a way somebody could suggest through which I could transfer different kinds of data.

View 2 Replies View Related

Android :: How To Pass Complex Data Structures Between Service And Remote Binder?

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

Android :: How To Send Custom Data Objects With Intents Phone?

Jul 30, 2010

Intents in Android are an elegant way to pass messages between uncoupled components, but what if you want to send extra data with the Intent? I know you can add various value types, and objects that implement Parcelable, as extras, but this doesn't really cater for sending user defined types locally (i.e. not over a remote interface). Any ideas?

View 3 Replies View Related

Android :: Pass Objects Between Two Activities?

Aug 30, 2010

I want to pass an object from Activity B to Activity A. Scenario:
- Activity A calls Activity B
- User selects item in Activity B
- Activity B passes an object to Activity A

How do I accomplish this? And in which method do I read in the passed object in Activity A?

View 2 Replies View Related

Android :: Pass Objects From One Dialog To Other

Oct 27, 2010

I am trying to design an activity in Android which consist in a ListView with a button to add items to the List.

When the button is clicked, it opens a chain of Dialogs to configure the new item (each Dialog configures one attribute of the item Object). When the last Dialog is validated, the item is added to the list.

I was thinking of creating a new item Object when the first Dialog opens and using a setXXX() method on each Dialog validation to configure the object, but how am I supposed to pass the object from one Dialog to another?

I got it working using final objects, but it doesn't look clean to me at all. Plus I would have liked to use the activity Dialog manager methods such as onCreateDialog() and showDialog() to manage the Dialogs.

What is the cleanest way to do this?

View 1 Replies View Related

Android : What Intents Do I Use To Pass / Receive Variable To Another Class?

Feb 17, 2009

What intents do I use to pass a variable to another class? And also which intent do I use to receive it?

View 3 Replies View Related

Android :: Pass Data Between Activities - HashMap Of WeakReferences To Objects

Nov 16, 2009

I am trying to pass a custom object to one activity from another. What I would like to use is the HashMap of WeakReferences, but the description isn't clear, at least to me. From above URL: "A HashMap of WeakReferences to Objects. You can also use a HashMap of WeakReferences to Objects with Long keys. When an activity wants to pass an object to another activity, it simply puts the object in the map and sends the key (which is a unique Long based on a counter or time stamp) to the recipient activity via intent extras. The recipient activity retrieves the object using this key."

MyObject object = new MyObject(); HashMap map = new HashMap(); WeakReference reference = new WeakReference(object); map.put(reference.hashCode(), reference);
Intent i = new Intent(myIntent); i.putExtra(map);

I know this is probably way off but I can't figure out how this is intended to be implemented based on the description. Are the keys hashcodes, user defined, or what? It sounds like all that is passed is a HashMap containing the key values but how is the object retrieved with just the key? I couldn't find any code examples or useful documentation on this method of passing objects

View 3 Replies View Related

Android :: Pass Socket - Inputstream - Outputstream Objects Between Activities

Jun 29, 2010

How to pass socket, inputstream, outputstream objects between activities

View 1 Replies View Related

Android :: Unable To Get Data From Activity To Service / How Intents Could Pass That?

Nov 24, 2010

I am pretty new to this but I was told I could get good help here. A friend and myself are playing around with creating Android apps (using ADT)

Here is how we are trying to make the program: in activity, user sets threshold values for the X and Y axis on accelerometer. When user hits button "Start", startService is invoked and starts TiltService.

TiltService is designed to run in the background always on the phone without user interaction. TiltService constantly compares the threshold with the accelerometer values and will vibrate if they are off.

My problem is I can't seem to get the putExtra() data correctly. I have overridden the onStartCommand in my service but I get the message "unreachable code" when I save the getExtras() to a bundle.

Here is the relevant code (I can post the whole thing, just do not want to clog up page) code...

I thought I understood the basic of how Intents could pass data, but I guess I don't. Is it obvious what I am missing?

View 2 Replies View Related

Android :: Complex ListView Example With Complex Data / Layout Of Each Row?

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

Android :: How To Filter Objects To Display Onscreen Objects On Map?

Jun 15, 2010

I have an application that have a Google map on Google Android 1.5 since we have been working on the application for a long time, we are not in stage of upgrading to the newest framework, so we are using 1.5. Now, I have map locations that are dynamically generated and drawn on the map at run-time to visualize some streams, Up to this point the application is working fine, Now my problem is that I am trying to filter the objects ( addresses) to visualize only the on-screen ones. I do NOT want to visualize the addresses that are off-screen. The way I am trying to do this is to check the screen-coordinates of each object (address) before visualizing it, then it the coordinates (x,y) more than (0,0) and less than (320, 460). I should visualize it. I am trying to use this approach, but it is not working for some reasons, I have tried many posts but could not understand why, there must be something missing somewhere that I am not aware of.

View 11 Replies View Related

Android :: Possible Bug With Intents / Pending Intents

Nov 7, 2009

I have some code that is creating and removing alarms, and which works great in Android 1.5 and 1.6 but breaks on the Android 2.0 AVD.The code that's giving this exception is: Code...

View 3 Replies View Related

HTC Incredible :: Can't Sign Into Application Store Pass Invalid Go To Recover Pass?

Jul 13, 2010

I was just on there yesterday i go into browse tonight and now all of a sudden it says pass world invalid from last night till this morning i tried typing in the little letters they had and I cant read it so I go to the google site. I put the info in and it says sorry account has been terminated for terms and conditions I didnt even do any thing to violate them?

View 1 Replies View Related

Android :: Complex Tab Indicators

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

Android :: WCF With Complex Types

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

Android :: Ksoap2 Complex Parameter

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

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 View Related

Android :: Need To Have Complex ListView Adapter

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

Android :: Spinner With A Complex Object

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

Android :: ListView With Complex Data Model

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

Android :: Scrollview Doesn't Like A Complex Child

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

Android :: How To Deal Complex Sql In Content Provider?

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

Android :: Complex Object Collision Detection

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

Android : How To Change Color Of A Complex Graphic?

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

Android : Want To Create Complex 3D Drawings In OpenGL ES?

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







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