Android :: Pass Float Array Between Activities In Android?

Nov 12, 2010

class1.java has creates a float[] array that is need to have in class2.java. How do you do this? The float[] is points. Here is an example code:

class1.java
import android.app.Activity;
import android.content.Context;
import android.app.ListActivity;
import android.content.Intent;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Typeface;......................

Android :: pass float array between activities in android?


Android :: Pass More Than One Array To A Listview?

Jan 7, 2010

I am using a listview to display items.
Currently I am passing an String array of items to it.
But I want to pass one more array and display its items alongwith the items of the first array(i.e somehow two lines of text).
How can I do that?

View 3 Replies View Related

Android :: Way To Pass An Object Array To An Activity

Nov 15, 2010

I have read posts on passing arrays from and to activities, but I am confused as to how I would do it for my specific case.

I have an array of objects called DaysWeather (a DaysWeather[] array) where the objects have several String attributes as well as a bitmap attribute. I read somewhere that you have to make it serializable or parceable or something, but it seems messy at first glance.

Could someone lead me in the right direction?

Is there a simple way to do this?

View 1 Replies View Related

Android : Want To Pass Array Strings From One Activity To Another

Feb 15, 2009

I have two activities. I want to pass array strings from one activity to another. I am using putStringArray and getStringArray functions. But still its not working. Could you please let me know how can I do it? Is there any other way to do it?

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 The Data To Sub Activities?

Jul 2, 2009

The main activity includes some variables with set values. I created a sub-activity with the form which has to be filled with the data from main activity so I guess the data have to be passed to the sub-activity when it starts. how to pass the variable values to the sub-activity from the main activity?

View 1 Replies View Related

Android :: Pass Data Between Activities?

Oct 6, 2010

I'm developing an app which basically navigates through a xml-feed. When I parse the feed or let's say the list, then each (list)item becomes a model. All the models are wrapped up in an array list. Now, when the user clicks on a list item, the underlying model is going to be serialized and sent as IntentExtra to the next Activity (e.g. a deeper sub list). (Originally I asked here a different question. The solution was not related to Serializable and wouldn't help anybody. However MatteKarla gave an interesting input. Thats why I decided to rewrite this question.)

View 1 Replies View Related

Android :: Pass Checkbox Status Between Activities

Jan 3, 2010

How can we pass checked box status from one activity to the calling activity? For e.g., I have two activities. The first activity calls the second activity that has a listview with checkboxed items and two buttons, 'OK' and 'CANCEL'. The second activity has to pass the names of list items that are checked to the calling acitivity. I am not able to figure out how to do this efficiently?

View 4 Replies View Related

Android :: Pass ArrayList Parameters Between Two Activities

Apr 19, 2010

Today I met a problem, I need to pass a ArrayList<MyClass> from an activity to another. I dont know what the Intent exactly do when I use putExtra to pass in an ArrayList<MyClass> object. I guess MyClass need to implement Parcelable interface, so I just did it. But still, it does not work. Maybe I need to create a Bundle and then use Bundle's putParcelableArrayList method to put my ArrayList<MyClass> object in, and then pass this bundle as parameter of putExtra to the intent. So crazy! I am lazy, I just want to pass an ArrayList<MyClass> object simply, is there a simple way??

View 10 Replies View Related

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 Unparcelable Object Between Activities

Nov 17, 2010

I have an Object that I need to be able to pass between Activites. It implements Parcelable and I've written all the code related to that. The problem is that one of the properties of the Object is a Drawable - and really needs to be. Unfortunately, Drawable is neither Parcelable or Serializable. I don't understand how to pass it. The reason for having the Drawable is that I need to cache an Image that I've downloaded from the internet at runtime. I don't want to cache the images on the filesystem, since this would potentially end up using up a lot of space over time. I'm putting the image into a Drawable so that I can easily put it into an ImageView.

View 2 Replies View Related

Android :: Pass Remote Interface (aidl) Throughout Activities?

May 13, 2010

I am developing an application using services and Remote interface. I have a question about passing the reference of my Remote interface throughout Activities. In my first Activity, I bind my service with my activity, in order to get a reference to my interface I use

private ServiceConnection mConnection = new ServiceConnection() {
@Override
public void onServiceConnected(ComponentName arg0, IBinder service) {
x = X.Stub.asInterface(service);
}
@Override
public void onServiceDisconnected(ComponentName arg0) {
// TODO Auto-generated method stub
}
};

x being the reference to my interface. Now I would like to access this interface from another activity, I see two ways to do it but I don't know which one is the "proper" way to do it: passing x with my intent when I call the new Activity redo this.bindService(new Intent(y.this,z.class), mConnection, Context.BIND_AUTO_CREATE); in the onCreate() of my new Activity

View 1 Replies View Related

Android :: Safely Pass Object References To New Activities?

Dec 8, 2009

I'm working on an application that requires non-serializable objects to be passed between Activities. The following page suggests using a HashMap of WeakReferences to accomplish this:

http://developer.android.com/guide/appendix/faq/framework.html

Is this solution safe? I know Activities are completely destroyed and recreated when the screen orientation changes. Couldn't those weakly referenced objects get GCed in the split second when the screen is rotated, since they wouldn't be referenced elsewhere at that point?

View 3 Replies View Related

Android :: Pass Data Between Activities In Droid Application?

Jun 3, 2010

How to pass data between activities in an Android application?

View 1 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 : Pass An Array From One Activity To Another In Android?

Aug 24, 2010

I want to pass an array from one Activity to another Activity,for example pass arrat frin image_view Activity to Blackimage Activity..

View 5 Replies View Related

Android :: Android - Pass ArrayList - CustomObject - Between Activities?

Oct 15, 2010

How can I pass a Object: ArrayList from one Activity to another? Seems that intent cannot hold custom ones except ArrayList. As a kind of hack, I use a static member: staticResultList = new ArrayList<SingleExamResult>(m_examResults); and Get it in the following Activity by: m_examResults = DoExam.staticResultList; It's not the correct way obviously, any 'common' approaches?

View 1 Replies View Related

Android :: Pass Data Between Activities In Android?

Jan 19, 2010

i have a scenario of login page after logging in there will be sign out button on each activity. on clicking signout i will be passing session id of signed in user to signout. can any one guide me how to keep session id available on all activities??

View 3 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 :: Convert Json Array To Normal Java Array

Aug 3, 2010

Is there a way to convert JSON Array to normal Java Array for android ListView data binding?

View 2 Replies View Related

Android :: Converting Byte Rgb_565 Array Into Argb Or Rgb Array

Jan 12, 2010

I have Picture data in byte rgb_565 array, and I want convert it in a productive way into argb array. Right now I have found only one (little slow) way to do this: Bitmap mPhotoPicture = BitmapFactory.decodeByteArray(imageData, 0 , imageData.length);

where imageData is my byte[] array in rgb_565, and then: int pixels[] = new int[CameraView.PICTURE_HEIGHT*CameraView.PICTURE_WIDTH]; mPhotoPicture.getPixels(pixels, 0,PICTURE_WIDTH, 0, 0, PICTURE_WIDTH, PICTURE_HEIGHT);

The point is I believe creating a Bitmap object is exacting and not necessary in this case. Is there any other faster way to convert rgb_565 array into argb array? I need this because making image processing on rgb_565 array seems to be a little annoying. Or maybe it is not so hard?

View 1 Replies View Related

Android :: Converting Short Array To Byte Array

Feb 16, 2010

I am trying to make an application that would be able to send the user's voice over the network using RTP. I am using the ported stack from hsc (JLIBRTP) and I am able to record user's voice in a saperate thread. the problem is that jlibrtp uses has a class named RTPSession that is responsible for the session and has the sendData method that takes a byte [] as argument and the AudioFormat class I am using to record user's voice is in AudioFormat.ENCODING_PCM_16BIT wich is short. I have tried using 8bit audioformat but I get an illigalargument exception in my htc magic and in my emulator. So is there any way I can convert the short [] to byte [] ? would that be acceptable in order of voice quality?, is the above error a known bug for htc magic or the platform doesn't support 8bit audio format?

View 3 Replies View Related

Android :: Navigating An Array - String Array

Oct 12, 2010

I'm new to android developing but right now I'm working on an application that displays Random Facts. Since I don't want it to be in a random order, I would like to have them in a list. I would like to order through them one by one and show them using TextView.

Resources res = getResources();
myString = res.getStringArray(R.array.FactsArray);

That's what I have so far. If I'm right, that just establishes the array so I can be able to use it later. What I had before was rgenerator which chose a random string from the array and displayed it when I clicked a button.

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

But Like I said, I would like to just order through them one by one when a button is clicked.

View 1 Replies View Related

Android :: Convert JSON Array To Array

Jul 27, 2010

Is there a simple way to convert a JsonArray to a standard Java Array? Obviously, you can iterate and do it explicitly, but I wanted to see if there was a direct way to do so.

View 2 Replies View Related

Android :: Insert Array Into Array

Sep 13, 2010

In my android application i need to insert an array into an array and access its values. Is there any way that i can get this done.

View 3 Replies View Related

Android :: Subtracting A Float From Another

Jul 18, 2009

Double mChange = Double.parseDouble("7.1") - Double.parseDouble ("7.15"); Float mChange = Float.parseFloat("7.1") - Float.parseFloat("7.15"); mChange should be -0,05 in both cases, right? So why is mChangeD = -0.05000019 ???

View 5 Replies View Related

Android :: Same Value When Converting From String To Float

Jul 8, 2010

I have a JSON Object with a latitude and longitude String on which I get the values doing this: String latitude = picInfo.getString("latitude"); String longitude = picInfo.getString("longitude");Then I convert them to floats like this: float latInt = Float.valueOf(latitude).floatValue(); float longInt = Float.valueOf(longitude).floatValue();And place them on a GeoPoint like this: GeoPoint X = new GeoPoint((int) (latInt*1E6),(int) (longInt*1E6) ); Debugging this values I can see JAVA approximates the values, is there anyway to keep them exactly the same?

View 6 Replies View Related

Android :: String From EditText To Float

Nov 19, 2010

I have an EditText for which will be using for a float number. So I'm trying to read the text from the EditText and put it into a float variable. But I seem to have a text to float problem.I've tried using Float.parseFloat(string) and just general casting, but nothing seem to do it. What can I do here? Also, is there a way to check for a valid float number before writing it to a variable?

View 1 Replies View Related

Android :: Avoiding Float Operations In Game Design

Jun 8, 2010

I've read this in a few articles, that one should avoid floating point operations within the physics update of a game.

But how do you really achieve this? Surely all half decent games are going to involve this kind of maths?

Does it mean, convert all your variables to int, or use double instead, or simply just cut it out as much as possible?

View 9 Replies View Related







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