Android :: Passing AppWidgetId To A Service

Sep 2, 2010

I got a Widget on my HomeScreen on which i add an click to a Button. I pass the widget id from the Widget to a Service, but when im reading the WidgetId at the Service it's always 3.

Android :: Passing AppWidgetId to a Service


Android :: Passing Parameter Value To Web Service

Nov 4, 2010

How to pass parameter value to web service in Android?

View 2 Replies View Related

Android :: Passing A Service Handler

Aug 9, 2009

I've read the android AIDL documentation and have a general idea of how RPC works between an Activity and a Service. However, for my application it seems overboard to implement such features: basically, I want to pass a Service a nice handler so its thread can pass data to my Activity. Currently I'm getting around this by using a static public member (a hack) but I would prefer just passing a Handler object in the Service's starting Intent. However since a Handler isn't serialize-able , I haven't found a way to pass it to the service without a simple static member hack. Any insight? Or, am I just going to have to suck it up and do a formal RPC to the service?

View 1 Replies View Related

Android :: Passing Parameters To .net Web Service

Dec 15, 2009

Im using ksoap2 to call web .net services. The call works just fine except when I pass paramaters. The passed paramaters are always recieved as null values by the web service. I dont know what the problem is, I hope someone can help.

View 7 Replies View Related

Android :: Passing Arguments To JSON C# .net Web Service

Sep 27, 2010

i searched the net to find something about how to pass arguments to JSON c# .net web service, but i didn't find anything useful for me. I have to pass arguments like GUID or at least Username and Password. Is params.put("var", ""); the right thing? How do i pass multiple parameters like this, let's say username and password?

View 24 Replies View Related

Android :: Passing Data Between Service And Activity

Sep 19, 2010

So I'm getting really confused on how to do this whole thing and I was hoping someone could break it down for me a little bit.I have a service that should always be running, and at certain times it needs to alert the user that a task is to be completed(probably through a notification bar icon). When the user accepts the task, the service needs to look into the local database, construct some non primitive objects, and give them to the activity that it just started.I have looked all over and gotten very confused as to a proper approach so I have a few questions to help me wrap my head around it.If an activity creates a local SQLite database can the service and activities of that application access that same database later?Does the service and activity need to be in the same or separate packages? I would think no but for some reason I remember seeing something about this elsewhere.

How would I do the data transmission from the service to the activity? I was thinking a content provider but it seems like there should be an easier way for the service to just hand off the data. Similar to an Intent but for non primitives.

View 2 Replies View Related

Android :: Passing Parameters Using KSoap2 To Net Web Service / Null Values

Dec 9, 2009

I'm having a problem in calling .net c# web services from android using ksoap2. The call is executed just fine without parameters, but when I pass parameters of any type, the web service just receives a null value. I tried everything possible but no luck so far. I hope someone can help, The client side code is:

public static boolean temp(){try {
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME_TEMP);
PopertyInfo p = new PropertyInfo();
p.type = PropertyInfo.INTEGER_CLASS;
p.setName("num");
p.setValue(5);
p.setNamespace(NAMESPACE);
request.addProperty(p);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope (SoapEnvelope.VER11 );
envelope.dotNet = true;
envelope.encodingStyle = SoapSerializationEnvelope.ENC;
envelope.setOutputSoapObject(request);
AndroidHttpTransport androidHttpTransport = new AndroidHttpTransport (URL);
androidHttpTransport.setXmlVersionTag("<?xml version= "1.0" encoding="UTF-8"?>")
androidHttpTransport.call(SOAP_ACTION_TEMP, envelope); ....

View 3 Replies View Related

Android :: Passing Parameters Using KSoap2 To Net Web Service/Null Values

Jul 21, 2010

I am new to android applications, I am using Ksoap2 to access .Net webservice and The call is executed just fine without parameters. But with parameters I am getting Empty. I followed all the steps provided in sites. I tried everything possible but no luck so far.

private static final String SOAP_ACTION = "http://www.agilelearning.com/GetProvincelist1";
private static final String METHOD_NAME = "GetProvincelist1 ";
private static final String NAMESPACE = "http://www.agilelearning.com" ;
private static final String URL = "http://192.168.1.24/Service.asmx";

//Method executed when Province is selected
private OnItemSelectedListener selectListener = new OnItemSelectedListener(){
public void onItemSelected(AdapterView parent, View v, int position, long id){
try{
ArrayList districts=new ArrayList();
int Provinceid=position+1;//parent.getItemAtPosition(position).toString();
SoapObject request1 = new SoapObject(NAMESPACE, METHOD_NAME1);
request1.addProperty("Provincename","East Province");
SoapSerializationEnvelope envelope1 = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope1.dotNet = true;
envelope1.setOutputSoapObject(request1);
HttpTransportSE at = new HttpTransportSE(URL);
at.debug = true;
at.setXmlVersionTag("");
at.call(SOAP_ACTION1, envelope1);
SoapObject rs = (SoapObject)envelope1.getResponse();
int count=rs.getPropertyCount();
for(int i=0;i aa;
aa = new ArrayAdapter(home1.this, android.R.layout.simple_spinner_item, districts); aa.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
sd.setAdapter(aa);
}catch(Exception ex){
MessageBox("No Districts found");}}

View 2 Replies View Related

Android :: Passing Intents From Service To New Launch From Main Activity

Mar 30, 2009

How do you pass an intent from a service to a new activity launched from a main activity? There's a passextra( intent src ); but I don't think thats what I am looking for?

activity main > start service( intent wuteverserviceintent );
activity main > start activity( intent newactivityintent );

View 2 Replies View Related

Android :: Preference Activity And AppWidgetId Relation

Jul 4, 2010

i'm using PreferenceActivity class to configure my widget. PreferenceActivity class automatically saves user preferences, so in widget update service i can call context.getSharedPreferences() and i obtain user preferences.Problem is follow: if you have many widget of same type, how PreferenceActivity class saves prefs? how i can load appWidgetId specific prefs from sharedPreferences?

View 7 Replies View Related

Android :: Make Different Instances Of A Widget Behave Different Based On Their AppWidgetId

Oct 5, 2009

I am developing a simple widget which has a couple of buttons in its layout.

Before the widget gets added, the configuration activity is displayed, where the user can choose if the widget makes any sounds when the buttons get pressed or not.

Thus, a user can put two instances of the widget, one where he chose sound to be activated and another where he chose the opposite. However, I can not seem to be able to reproduce the expected behavior (that one reproduces sound and the other doesn't).

The buttons' behavior varies according to the flags specified to the PendingIntent:

- FLAG_UPDATE_CURRENT seems to override the previous intent/setting - no flags (0x00) seems to ignore any intent/setting after the first instance of the widget is put.

What I want to do: I want to be able to configure different instances of the same widget to behave in a different way, according to what the user specified in the configuration activity. I am attempting to do this with the help of the appWidgetId of each instance:

I have tried the following when assigning an action to the click of the button:

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

This results in the first widget acting properly (The IDs printed in logcat are as expected) When adding a second widget, however, the first widget starts reporting the second widget's appWidgetId in its onReceive(), when it previously did no such thing. (because of the FLAG_UPDATE_CURRENT, I guess)

How can one make different instances behave in a different way? Is there a way to do this with the help of the appWidgetId?

I have elaborated a widget application for the purpose of debugging this problem which tries to be minimal, while reproducing the (un) desired behavior: http://www.2shared.com/file/8243059/b6519584/IntentTesttar.html

View 5 Replies View Related

Android :: Passing An ArrayList Of Objects

Nov 12, 2010

Is there a way to pass an Array List of objects between activities? The myObject implements Parcelable and I'm able to successfully pass the objects around individually, but that means I need to have an exact amount of "myObjects" coded. I want this to dynamically grow/shrink by what the user does with the app. I have seen some posts on the web about doing:

Activity A
ArrayList<myObject> myObjArray = new ArrayList<myObject>();

Then when passing this into the intent I would use:
intent.putParcelableArrayListExtra("myObjArray", myObjArray);

Activity B
ArrayList<myObject> myObjArray = new ArrayList<myObject>();
Bundle extras = getIntent().getExtras(); myObjArray = extras.getParcelableArray("myObjArray");

However, the myObjArray always gets filled with "null". How can I achieve this?

View 3 Replies View Related

Android :: Passing ArrayList Across Activities

Apr 7, 2009

I have an ArrayList<MyList> aList in an activity. I would like to send this data to another activty. Such that,
ArrayList<MyList> aList;
Intent intent = new Intent(); intent.setClass(mainactivity.this, newActivity.class); intent.putExtra("MyList", aList ); startActivity(intent);

On the receiving activity,
Intent i = getIntent(); newList = (ArrayList<MyList>) i.getSerializableExtra("MyList");
But this gets me no where. ERROR! My intention is to share this List between activities.

View 4 Replies View Related

Android :: Passing Values With Intents

Nov 17, 2010

I have searched and searched and I just can't get this code to work. I have a main.xml layout and a setting.xml. I have some values I would like the Settings.class to change in my main apps class.Three string to be exact. I have tried this simple test code in my main app class.

settings.setOnClickListener(new OnClickListener(){
@Override
public void onClick(View v) {
Intent intent = new Intent(v.getContext(), Settings.class);
startActivityForResult(intent, 0);}});

//Then a function
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent intent){
super.onActivityResult(requestCode, resultCode, intent);
Bundle extras = intent.getExtras();
String value = extras.getString("myKey");
if(value!=null){
Log.d("hmmm",value);}}}

In my settings.class I have the following
returnHome.setOnClickListener(new OnClickListener(){
@Override
public void onClick(View v) {
Intent intent = new Intent();
intent.putExtra("myKey", "YEAH");
setResult(RESULT_OK, intent);
finish();}});

Back in main app class it is not getting logged. Like I said I have three string in the main class that I want settings class to change and send back.

View 2 Replies View Related

Android :: Passing Values From One Activity To Another

Feb 11, 2010

I have an app which makes use of several layout-views. Every layout - view also got a class for it, which extend the Activity class. One class for example retrieves some database values whilst offering a search form to the user. Afterwards the user can select one of those values and he gets presented with another screen which gives similar options as the one selected. Anyways, I'd like for the first Activity to be able to send an array with data (Strings for example) to the second one. Right now I show an activity by using:

Intent i = new Intent(this, activitysName.class); startActivity(i);

I have no idea whilst using this construction how I can "initialize" the new object with the String array I want to pass to it. So how should this be achieved ? Should I be using something else instead of an Intent-Activity combination ?

View 5 Replies View Related

Android :: Passing Intent Value To Another Class

Oct 14, 2010

I have four groups in a listview each with four url's I want to load in a webView. When the user select a url to goto I set a value like so;

if (position == 0) webb = webb +2;
{
Intent intent = new Intent(this, official.class);
startActivity(intent);
}

I then carryout the intent to move to the webView class where I have given each URL a value like so;

if (webb == 2) mWebView.loadUrl("http://yahoo.com");
if (webb == 3) mWebView.loadUrl("http://www.bbc.co.uk");

But the screen stays blank, if I state the value inside the official.class it works. How can I get this value to pass to another class based on the selection the user makes from the listview.

View 3 Replies View Related

Android :: Passing Intent Value From One Class To Another

Oct 16, 2010

I have been trying to get "getExtra" to work but without success, I have a listview with 4 choices which launch a webpage within a webView class, when the user selects the option lets say option 3 I want to pass the value of 3 to the webView class so that it will load the correct webpage, at the moment I get no errors, but the app force closes when I select the option, could this be due to having to announce this in the manifest? can somebody help with where I am going wrong. This is my intent

public void onListItemClick(ListView l, View v, int position, long id) {
if (position == 0) {
Intent intent = new Intent(this, official.class);
intent.putExtra("weburl", 3);
startActivity(intent);}
This is the official class:
public class official extends Activity {
int number = getIntent().getIntExtra("weburl", 0);
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if ((keyCode == KeyEvent.KEYCODE_BACK) && mWebView.canGoBack()) {
mWebView.goBack();
return true;
} return super.onKeyDown(keyCode, event);
} WebView mWebView;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.browser1);
mWebView = (WebView) findViewById(R.id.webview);
mWebView.getSettings().setJavaScriptEnabled(true);
if (number == 2) mWebView.loadUrl("http://bcafc.livewwware.co.uk");
if (number == 3) mWebView.loadUrl("http://www.bbc.co.uk");
mWebView.setWebViewClient(new HelloWebViewClient());

View 1 Replies View Related

Android :: Passing Bitmap To Another Activity

Jun 7, 2010

I have a Bitmap image and i want to forward the bitmap to another activity. I have two activities Activity A and Activity B. This is how I started the Activity B
startActivityForResult(new Intent(Activity A.this, Activity B.class), 120);
in activity B
private void forwardImage(Bitmap bit) {
Intent i = new Intent(MMS.this, Compose.class);
i.putExtra("MMS", bit);
setResult(RESULT_OK, i);
finish(); }

This is not forwarding to Activity A but if I put a String to the intent it'll forward. This is how I listen to result in Activity A

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// TODO Auto-generated method stub
// super.onActivityResult(requestCode, resultCode, data);
switch (resultCode)
case RESULT_OK: Intent intent = getIntent();
Bitmap bitmap = (Bitmap) intent.getParcelableExtra("MMS");
mmsImage.setImageBitmap(bitmap);
default: break;
} }

How can I pass a bitmap.

View 3 Replies View Related

Android :: Passing Variable From One Class To Another

Nov 15, 2010

I am working to set a countdown timer. I have successfully (borrowed) a number picker (spinner) and set up the dialog box for the user to set the time. This is in a class called timepickactivity and the variables are hour and mins (R.id.hour and R.id.mins). I want to call the set values (R.id.hour and R.id.mins) from the dialog (timepickeractivity) to the actual countdown class (countdown) but I can't figure out how to get the values.

View 4 Replies View Related

Android :: Passing Parameters To New Activity

Mar 2, 2009

I'm programming an Activity that launches a second one through startActivity just like in the Forwarding example. The main difference is that I'd like to pass some data to the second Activity when starting it, for example an item selected in a list owned by the first Activity. I can't find how to do that. Am I missing something? I guess I do.

View 3 Replies View Related

Android :: Passing An Array To A View

Apr 8, 2010

My background is in C, but I'm relatively new to Java and to Android. I have a question as to whether I'm implementing code in the best way:

As a learning exercise in Java and in meeting the Model-View- Controller pattern, I wrote a simple game. It plays out on a 2D grid owned by the game class, and is drawn to the display by an extended View class. I have it working, but I'm wondering after the fact if I'm going about it the right way.

Here's a simplified version of what I have:

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

View 2 Replies View Related

Android :: AutoCompleteTextView - Passing Focus And 1.6

Nov 15, 2009

Has anyone noticed that AutoCompleteTextView doesn't pass the focus to the next field when you tap on "NEXT" button on soft keyboard? And it's all happening on Android 1.6. v1.5 works flawlessly! Is there any known solution for this?

View 3 Replies View Related

Android :: Best Practice - Passing Id To New Intent?

Sep 22, 2009

I am creating a database driven app for managing people. I am showing a list of people with each name in a TextView. When a TextView is clicked, I launch a new intent to show the detail for the person. My question: What's the best practices for passing the id of the person to the new intent? The TextView is displaying the name of the person, so how do I know the id of the person? Once I know the id, I know how to pass it to the new intent, but I don't know what the best way to associate the id of the person to the TextView. Is there a best practice for this?

View 2 Replies View Related

Android :: Passing Value From ListView To A New Activity?

Jun 14, 2010

I have a ListView that shows a list of names. When you select a name, I want to pass the selected person' ID to the next view (Profile) and retreieve their data based on their ID. I am able to load the Profile View, but do not know how to pass the ID from the ListView to the Profile. Here is how I am loading the Profile: Code...

View 2 Replies View Related

Android :: Message Passing Between Two Droid App?

Apr 25, 2010

I am trying to communicate between two Android applications. Application-A will send message/data to Application-B. After receiving message from Application-A, Application-B will send a reply message to Application-A. Is it possible in Android application? If yes please point me the APIs that can be used to achieve this.

View 3 Replies View Related

Android :: Passing Paramters Between Classes

Apr 6, 2010

I have a class2 which is involved by class1 when clicks are made. I have to pass some parameters/objects from class1 to class2. I only know the standard way which does not have an option of passing parameters.

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

View 1 Replies View Related

Android :: Passing Values From Activity To Another File

Nov 20, 2010

I have a need where I must pass some values from an Activity to another file which extends View class (instead of Activity). Its not the normal passing of values from one activity to another. In my Activity, I will pass some co-ordinate values to the class that extends View. In this class, I will draw an image and place points over the image on the required co-ordinates. But, the problem is, I cant send values using Intent.

View 11 Replies View Related

Android :: Passing An Order By Setting Variable

Jul 24, 2010

I have a list view with several columns; things such as name, date, etc. I want to be able to click on the header TextView and sort the list by that field. When the list loads the variable works, and a list is queried and sorted by the field _id (no surprise other than it works), but when i click on the header TextView I get a force close:

Thread [<3> main] (Suspended (exception SQLiteException))
ViewRoot.handleMessage(Message) line: 1757
ViewRoot(Handler).dispatchMessage(Message) line: 99
Looper.loop() line: 123
ActivityThread.main(String[]) line: 4595
Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]
Method.invoke(Object, Object...) line: 521
ZygoteInit$MethodAndArgsCaller.run() line: 860
ZygoteInit.main(String[]) line: 618
NativeStart.main(String[]) line: not available [native method]

The TextView gives no errors when not changing my orderby variable.
Setting Variable:

private View.OnClickListener NameSortbtnListener = new View.OnClickListener(){
public void onClick(View v){
sort = " KEY_JOURNAL_TITLE ";
fillData();
} };

Populating List:
private void fillData() {
Cursor notesCursor = mDbHelper.fetchAllJournals(sort);
startManagingCursor(notesCursor);
String[] from = new String[]{journalDbAdapter.KEY_JOURNAL_TITLE,
journalDbAdapter.KEY_LOCATION, journalDbAdapter.KEY_JDATE,
journalDbAdapter.KEY_STEPS};
int[] to = new int[]{R.id.text1, R.id.text2, R.id.text3, R.id.text4};
SimpleCursorAdapter notes =
new SimpleCursorAdapter(this, R.layout.notes_row, notesCursor,
from, to);
setListAdapter(notes);
}

Query (In DB Adapter):
public Cursor fetchAllJournals(String sort) {
return mDb.query(DATABASE_JOURNAL_TABLE, new String[] {KEY_JROWID,
KEY_JOURNAL_TITLE, KEY_JOURNAL_NOTES, KEY_JDATE, KEY_LOCATION,
KEY_STEPS},null , null, null, null, sort ,null);
}

View 2 Replies View Related

Android :: Passing Linear Layout From One Activity To Another

Feb 28, 2010

For a rather crazy reason I am trying to pass a linear Layout from one activity to another. Should I use an intent extra for this? What would be the right way to create a Linear Layout in one activity and then spawn a new activity using that linear Layout.

View 8 Replies View Related

Android :: Passing Data With Pending Intent

Jun 28, 2010

I would like to create some home screen app widgets that are entry points into an application. I can put a button in the app widget that uses setOnClickPendingIntent to start the activity. The problem occurs when I want to have two of these app widgets that are entry points to different parts of the activity. I need to be able to pass data into the activity that will distinguish these. Since both app widgets use a Pending Intent that starts the same activity, the two Pending Intents are shared and I can't reliably set extras for the corresponding intents.

View 2 Replies View Related







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