Android :: Passing Custom Arguments To Aapt In Eclipse
Feb 12, 2010
Is it possible to tell Eclipse to use some extra arguments for aapt (-0 in specific)?I have been looking for past couple of hours and the best hack I came up with was to create a wrapper for the aapt tool to inject the argument to the command line. The trouble with this approach is that whenever I should lose that wrapper, then I'll be quietly introducing a bug into my application.
View 1 Replies
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
Jan 14, 2010
I have an application, which sets an alarm using AlarmManager, which starts another Activity when it goes off. The AlarmManager takes a PendingIntent and spawns a BroadcastReceiver class when the specified time comes. I'm wondering whether there is any way that I can pass arguments to this BroadcastReceiver through the Intent object which goes into PendingIntent?I'd like to be able to retrieve arg1 in the BroadcastReceiver's onReceive(Context, Intent) method. I figured that the local variable my_intent would be the second parameter passed on to onReceive by the PendingIntent, but apparently that's not quite right. Is it possible to pass parameters between an Activity and a BroadcastReceiver in this fashion (using Intent.putExtra()) or should I use a ContentProvider instead?
View 3 Replies
View Related
Nov 16, 2010
I think this should be easy to answer. I have an application that does some long calculations, and I would like to show a progress dialog while this is done. So far I have found that I could do this with threads/handlers, but didn't work, and then I found out about the AsyncTask.In my application I use maps with markers on it, and I have implemented the onTap function to call a method that I have defined. The method creates a dialog with Yes/No buttons, and I would like to call an AsyncTask if Yes is clicked. My question is how to pass an ArrayList to the AsyncTask (and work with it there), and how to get back a new ArrayList like a result from the AsyncTask?
View 1 Replies
View Related
May 16, 2010
I'm writing an application that starts with a loading activity. In the loading activity the app requests html from web and parses the html, then it sends the parsing result to the main activity. The main activity has several tabs, and contents of these tabs are based on the result of parsing.For example, the result of parsing is a list of strings ["apple", "banana", "orange"], and I need to pass this list to main activity, so that the main activity can create three tabs named after three fruits.I would like to know if there is any way to pass a list of strings among activities, BTW, is it the common way of do this?
View 2 Replies
View Related
Apr 7, 2009
In the Android.mk, there are AAPT flags set as below. LOCAL_AAPT_FLAGS := -0 .dat.I'm wondering how to apply this AAPT flag in the eclipse project, so that the .dat raw data files will not be compressed in .apk?
View 3 Replies
View Related
Jul 31, 2010
I have read that in order to clear data stored in the Android emulator I should start the emulator with the "-wipe-data" arguments. However, I can't see how to specify startup arguments. I have read that it should be possible to specify these in the "Target" tab of the Debug Configurations dialog. However, if I open Debug Configurations from the Eclipse Run menu all I see in the Target tab are radio buttons for "Manual" or "Automatic" Deployment Target Selection Mode, buttons for "Refresh" and "Manager..." and drop-down boxes for "Network Speed" and "Network Latency" options. There are buttons for "Details..." and "Start..." but these are grey. I can't see anywhere where I can enter a "-wipe-data" option. The Run Configurations dialog seems to be identical. (I am using Eclipse SDK 3.5.2)
View 1 Replies
View Related
Sep 14, 2010
ADT master execute aapt with the debug-mode option. aapt in Android SDK 07 doesn't support this option. Is there Windows build of SDK which support this ?
View 5 Replies
View Related
Jan 30, 2009
After generating ADT 0.9, using Cupcake SDk, i need to specify a sdcard to emulator, in eclipse. In ADT 0.8 there is a field in Run Configuration, but in ADT 0.9 no. How can i do that?
View 2 Replies
View Related
Dec 15, 2009
I've been trying to create my .apk with aapt tool, but I couldn't get it. can somebody help me?
View 2 Replies
View Related
Dec 14, 2009
Are the newest versions of aapt backwards compatible with the older versions? i.e. can i read 1.0 & 1.5 apks with the 2.0.1 SDK aapt? My tests show me it works, but is it failsafe?If this is not the case, what's the easiest way to determine the android version an APK was developed for and know which aapt binary to use?
View 2 Replies
View Related
Jun 12, 2010
I'm very new to java and am working on my first Android app. I am using the webview demo as a template. I am trying to generate a random integer between 1 and 12 and then call a certain javascript function based on the result. Here's what I have:
int number = 1 + (int)(Math.random() * ((12 - 1) + 1));
number = (int) Math.floor(number);
String nextQuote = "javascript:wave" + number + "()";
mWebView.loadUrl(nextQuote);
So mWebView.loadUrl(nextQuote) will be the same as something like mWebView.loadUrl("javascript:wave1()") I just want to know if what I have here is correct and will work the way I think it will. The application isn't responding as expected and I suspect this bit of code is the culprit.
View 2 Replies
View Related
Apr 23, 2010
Every app I make starts out with a number of common base classes, interfaces, utility classes and a basic package structure that has been working for me. Is there a way for me to set up a project template in Eclipse that will give me all of the basic Android project stuff PLUS a bunch of custom packages, classes and interfaces? I guess I could just put all of this stuff into one or more libraries as opposed to creating a whole project template, so if you have a preferred approach or information/links/etc on how to do any of the above, please share (I'm relatively inexperienced with Eclipse, so the more detail the better).
View 1 Replies
View Related
Jul 16, 2010
I need to carry over the "lib/armeabi" part as well. First off, is this the correct approach for add a 3rd party .so file, and if so, can I force it to preserve the dir structure? If I'm barking up the wrong tree, what is a better way to handle this?
View 2 Replies
View Related
Feb 18, 2009
I update my SDK from 1.0 to 1.1r1 running on Windows XP environment. I develop applications using Eclipse Ganymede.
Since this update my build process crashes on aapt calling.
I tried to reinstall ADT plugin but this doesn't change anything.
Do you have an idea to resolve this issue?
View 2 Replies
View Related
Oct 15, 2010
I've followed the steps given in the Android Developer Blog to generate a build.xml for building releases for an Android Application. I need to do a custom compiling so I have overwritten the target compile of the ant_rules_r3.xml as it is said in the generated build.xml.
<target name="compile" depends="-resource-src, -aidl, -pre-compile" ...
The script works fine and generates the apk, but the problem is that Eclipse shows an error because it cannot find targets -resource-src, -aidl and -pre-compile (which are loaded when executing the script but are not really present on the build.xml). As there are these errors I cannot work with the project in Eclipse.
How can I skip the validation of this single file in Eclipse?
View 2 Replies
View Related
Dec 17, 2009
I have a string defined in my String.xml file that uses format arguments, i.e.: <string name="myString">Hello %1$s.</string> Is there a way to assign a value to the format argument in a layout xml file?
View 2 Replies
View Related
Jun 18, 2010
I am in need of help to complete my application. I am trying to execute a project that uses and android library. Basically I am trying to execute the android facebook sdk to run the sample code provided at http://github.com/facebook/facebook-android-sdk 1. I have downloaded the sdk and extracted the zip file to a folder 2. I used Eclipse galileo import to create an android project from existing resource. I imported the sdk source code (facebook folder of the sdk) into my project explorer successfully. I can also run Build Project for this source code. 3. Now, I am trying to import the sample example in it. The project is imported but I cannot execute it. I cannot build the project. Code...
View 2 Replies
View Related
Jun 3, 2009
I've been trying to include standard android icons in a menu XML file, as described in Android Icon design guidelines. However the build fails with the following errors : [2009-06-04 00:00:31 - Laser] W/ResourceType(16578): Bad XML block: header size 2475 or total size 0 is larger than data size 0 [2009-06-04 00:00:31 - Laser] /home/niko/dev/workspace/Laser/res/menu/ main.xml:4: ERROR Error: Resource is not public. (at 'icon' with value '@android:drawable/ic_menu_play_clip'). [2009-06-04 00:00:31 - Laser] Unknown error: The only threads I could find with this error were about rebuilding android platform xml files. Any idea about what I could have missed?
View 5 Replies
View Related
Jan 19, 2009
I downloaded the android source code and this already has Cupcake branch merged into main. I compile and made the sdk ("make sdk") with success. But now i need the eclipse plugin compatible with this version of this "custom" sdk. Note that i just downloaded and compile. I need to work with audio streaming, and in our prototype we walked around, but now, we really need this feature. So i'm trying to use it. I looked the source, and, apparently, Cupcake solves our needs. I try this link, http://review.source.android.com/5290/diff/201/z474cb3132ea0f2114f9e5..., but when i import the projects into my workspace, many compile errors appear. I think that there is a lot of new functions and classes, that eclipse plugin doesn't detect...So, how can i build successfully the eclipse plugin?
On Jan 17, 5:44 am, Dave Sparks <davidspa...@android.com> wrote: > OK, now I see where you going with it. What you want is coming in Cupcake. There is astreaminginterface
View 4 Replies
View Related
Oct 16, 2010
I have a weird problem where I cannot run aapt from an sbt command as well as from the shell.
I run this command: sbt update package-debug
And everything hums along until I get this error: java.io.IOException: Cannot run program "/home/egervari/Programs/android-sdk-linux_x86/platforms/android-7/tools/aapt": java.io.IOException: error=2, No such file or directory
So I try running it manually, just for the heck of it: egervari@ken:~/Programs/android-sdk-linux_x86/platforms/android-7/tools$ ./aapt bash: ./aapt: No such file or directory
This is pretty weird because it's right there:
CODE:.......................
View 1 Replies
View Related
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
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
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
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
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
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
Nov 4, 2010
How to pass parameter value to web service in Android?
View 2 Replies
View Related
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
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