Search Results

Search found 17553 results on 703 pages for 'android sdk 2 1'.

Page 33/703 | < Previous Page | 29 30 31 32 33 34 35 36 37 38 39 40  | Next Page >

  • Examples of Android Joystick Controls? [on hold]

    - by KRB
    I can't seem to find any well executed code examples for Android joystick controls. Whatever it may be, algorithms, pseudo code, actual code examples, strategies, or anything to assist with the design and implementation of Android joystick controls; I can't seem to find anything decent on the net. What are some well executed examples? More specifically, Pseudo Code Current Examples Idea/Design Functionality Description Controller Hints Related Directly to Android Architecture What kind of classes will I have making this? Will there be only one? How would this be implemented to the game architecture? All things I am thinking about. Cheers! UPDATE I've found this on the subject Joystick Example1, though I am still looking for different examples/resources. Answered my own question with a link to the code of the above video. It's a fantastic start to Android Joystick Controls.

    Read the article

  • Ubuntu 12.04 Very slow especially with Android Studio

    - by Dew
    I have an old laptop with the following specification: Memory: 485 MiB, Processor: Genuine intel CPU T2300 @ 1.66 GHz ×2, OS Type: 32 bit, Disk: 78.1 GB, I installed on it Ubuntu 12.04 LTS and I noticed that the overall system is very slow in responding. I tried to search about that in the internet and I found some articles talking about how to make Ubuntu 12.04 LTS run fast I applied all what they said including download LXDE desktop environment and then nothing different in the system response time. Then I need to develop some android applications so, I download Android Studio (Beta) 0.8.6. The problem became worse than before whenever I tried to open the Android Studio the screen is frozen for some minutes then it took time to download the projects and initialize the work space also, when I tried to move the cursor he is move very slowly. When I tried to run my first application on the AVD it took three hours and still not run yet. I delete the Android Studio and install it again several times, I was trying to solve the problem but still nothing change. Please if you have any suggestions that may help me make my laptop and Android Studio work faster I will appreciate it for you. Thank you in advance.

    Read the article

  • Android Game Development in Java [on hold]

    - by Nusrat
    I have been searching for some good tutorials/frameworks for developing an Android Game . I want to develop a 3D Car Racing game . I have already looked into http://stackoverflow.com/questions/4227759/android-game-engine-for-2d-and-3d-games. Now , i know that Android Games can be developed using Java/Action Scripts/JS etc . Many of the users are suggesting me to use http://unity3d.com , but i found that it uses JavaScript, C#, Boo . I don't know JS too much , Is it possible to develop a very professional level Game for Android using my Java knowledge ? Any Software like Unity which allow me to code in Java ?

    Read the article

  • External device/USB support in android API level 10 [migrated]

    - by chandan
    I am an android UI developer and having problem with issue with USB and external storage device support on android. What I want to have is on plug-in USB/SD card, the storage items in the devices directly show up on screen. For example the modern Operating systems have this feature that we plug in our device and it just automatically shows the contents of the device on new window. I am implementing my UI on android API level 10 and my device is IMX reference kit which has android 2.3.4 installed. I would be grateful if anyone could give specif suggestion or guideline. I already tried with external_storage.java class. but it only says that the APK is installed successfully. But no action launches on plug-in external device.

    Read the article

  • Android JSon Array is not working with Maplocations class

    - by user1505962
    I am developing a map application in android i have made maplocation class to pass latitude and longitude and using Json Array to fetch data from MYSQl to display in map.But When I run application it crashed unfortunantely here is my log cat 07-07 14:02:26.423: E/AndroidRuntime(366): FATAL EXCEPTION: main 07-07 14:02:26.423: E/AndroidRuntime(366): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.icons.draw.view/com.icons.draw.view.DrawIcons}: android.view.InflateException: Binary XML file line #6: Error inflating class com.icons.draw.view.LocationViewers 07-07 14:02:26.423: E/AndroidRuntime(366): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647) 07-07 14:02:26.423: E/AndroidRuntime(366): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663) 07-07 14:02:26.423: E/AndroidRuntime(366): at android.app.ActivityThread.access$1500(ActivityThread.java:117) 07-07 14:02:26.423: E/AndroidRuntime(366): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931) 07-07 14:02:26.423: E/AndroidRuntime(366): at android.os.Handler.dispatchMessage(Handler.java:99) 07-07 14:02:26.423: E/AndroidRuntime(366): at android.os.Looper.loop(Looper.java:130) 07-07 14:02:26.423: E/AndroidRuntime(366): at android.app.ActivityThread.main(ActivityThread.java:3683) 07-07 14:02:26.423: E/AndroidRuntime(366): at java.lang.reflect.Method.invokeNative(Native Method) 07-07 14:02:26.423: E/AndroidRuntime(366): at java.lang.reflect.Method.invoke(Method.java:507) 07-07 14:02:26.423: E/AndroidRuntime(366): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 07-07 14:02:26.423: E/AndroidRuntime(366): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 07-07 14:02:26.423: E/AndroidRuntime(366): at dalvik.system.NativeStart.main(Native Method) 07-07 14:02:26.423: E/AndroidRuntime(366): Caused by: android.view.InflateException: Binary XML file line #6: Error inflating class com.icons.draw.view.LocationViewers 07-07 14:02:26.423: E/AndroidRuntime(366): at android.view.LayoutInflater.createView(LayoutInflater.java:518) 07-07 14:02:26.423: E/AndroidRuntime(366): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:570) 07-07 14:02:26.423: E/AndroidRuntime(366): at android.view.LayoutInflater.rInflate(LayoutInflater.java:623) 07-07 14:02:26.423: E/AndroidRuntime(366): at android.view.LayoutInflater.inflate(LayoutInflater.java:408) 07-07 14:02:26.423: E/AndroidRuntime(366): at android.view.LayoutInflater.inflate(LayoutInflater.java:320) 07-07 14:02:26.423: E/AndroidRuntime(366): at android.view.LayoutInflater.inflate(LayoutInflater.java:276) 07-07 14:02:26.423: E/AndroidRuntime(366): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:207) 07-07 14:02:26.423: E/AndroidRuntime(366): at android.app.Activity.setContentView(Activity.java:1657) 07-07 14:02:26.423: E/AndroidRuntime(366): at com.icons.draw.view.DrawIcons.onCreate(DrawIcons.java:16) 07-07 14:02:26.423: E/AndroidRuntime(366): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 07-07 14:02:26.423: E/AndroidRuntime(366): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611) 07-07 14:02:26.423: E/AndroidRuntime(366): ... 11 more 07-07 14:02:26.423: E/AndroidRuntime(366): Caused by: java.lang.reflect.InvocationTargetException 07-07 14:02:26.423: E/AndroidRuntime(366): at java.lang.reflect.Constructor.constructNative(Native Method) 07-07 14:02:26.423: E/AndroidRuntime(366): at java.lang.reflect.Constructor.newInstance(Constructor.java:415) 07-07 14:02:26.423: E/AndroidRuntime(366): at android.view.LayoutInflater.createView(LayoutInflater.java:505) 07-07 14:02:26.423: E/AndroidRuntime(366): ... 21 more 07-07 14:02:26.423: E/AndroidRuntime(366): Caused by: java.lang.NullPointerException 07-07 14:02:26.423: E/AndroidRuntime(366): at org.json.JSONTokener.nextCleanInternal(JSONTokener.java:112) 07-07 14:02:26.423: E/AndroidRuntime(366): at org.json.JSONTokener.nextValue(JSONTokener.java:90) 07-07 14:02:26.423: E/AndroidRuntime(366): at org.json.JSONArray.<init>(JSONArray.java:87) 07-07 14:02:26.423: E/AndroidRuntime(366): at org.json.JSONArray.<init>(JSONArray.java:103) 07-07 14:02:26.423: E/AndroidRuntime(366): at com.icons.draw.view.LocationViewers.getMapLocations(LocationViewers.java:102) 07-07 14:02:26.423: E/AndroidRuntime(366): at com.icons.draw.view.LocationViewers.init(LocationViewers.java:65) 07-07 14:02:26.423: E/AndroidRuntime(366): at com.icons.draw.view.LocationViewers.<init>(LocationViewers.java:45) 07-07 14:02:26.423: E/AndroidRuntime(366): ... 24 more And Here is My JSOn Array and loop code to make markers double LAT; double LANG; String INFO; public List<MapLocation> getMapLocations() { if (mapLocations == null) { try{ jArray = new JSONArray(result); JSONObject json_data=null; for(int i=0;i<jArray.length();i++){ json_data = jArray.getJSONObject(i); LAT=json_data.getDouble("lat"); LANG=json_data.getDouble("lang"); INFO=json_data.getString("info"); mapLocations = new ArrayList<MapLocation>(); mapLocations.add(new MapLocation(INFO,LAT,LANG)); } } catch(JSONException e1){ Toast.makeText(getContext(), "No Vehicles Found" ,Toast.LENGTH_LONG).show(); } catch (ParseException e1) { e1.printStackTrace(); } } return mapLocations; } Please Help to Remove this error

    Read the article

  • Business Objects Enterprise reporting using SDK client gives exception

    - by Dev_Karl
    Hi! We have a client that is using the SDK for invoking reports on the Business Objects Embedded Report Server. We can login, but when calling the openDocument method, something goes wrong. code: //logon IEnterpriseSession session = sessionMgr.logon(username, password, clusterNode, authType); .... clientDoc = reportAppFactory.openDocument(report, 0, locale); /*row 58 in exception*/ exception: com.crystaldecisions.sdk.occa.report.lib.ReportSDKServerException: Unable to connect to the server: . - Server not found or server may be down---- Error code:-2147217387 Error code name:connectServer at com.crystaldecisions.sdk.occa.managedreports.ras.internal.RASReportAppFactory.a(Unknown Source) at com.crystaldecisions.sdk.occa.managedreports.ras.internal.RASReportAppFactory.a(Unknown Source) at com.crystaldecisions.sdk.occa.managedreports.ras.internal.RASReportAppFactory.a(Unknown Source) at com.crystaldecisions.sdk.occa.managedreports.ras.internal.RASReportAppFactory.openDocument(Unknown Source) at com.reportclient.MyReportClient.getReportFromInfoStore(MyReportClient.java:58) ... 28 more Caused by: com.crystaldecisions.sdk.occa.report.lib.ReportSDKServerException: Unable to connect to the server: . - Server not found or server may be down---- Error code:-2147217387 Error code name:connectServer at com.crystaldecisions.sdk.occa.report.lib.ReportSDKServerException.throwReportSDKServerException(Unknown Source) at com.crystaldecisions.sdk.occa.managedreports.ras.internal.CECORBACommunicationAdapter.connect(Unknown Source) ... 32 more Caused by: com.crystaldecisions.enterprise.ocaframework.OCAFrameworkException$NotFoundInDirectory: Server not found or server may be down at com.crystaldecisions.enterprise.ocaframework.j.find(Unknown Source) at com.crystaldecisions.enterprise.ocaframework.AbstractServerHandler.buildServerInfo(Unknown Source) at com.crystaldecisions.enterprise.ocaframework.AbstractServerHandler.buildClusterInfo(Unknown Source) at com.crystaldecisions.enterprise.ocaframework.aa.for(Unknown Source) at com.crystaldecisions.enterprise.ocaframework.ServiceMgr.for(Unknown Source) at com.crystaldecisions.enterprise.ocaframework.o.a(Unknown Source) at com.crystaldecisions.enterprise.ocaframework.o.a(Unknown Source) at com.crystaldecisions.enterprise.ocaframework.o.a(Unknown Source) at com.crystaldecisions.enterprise.ocaframework.p.a(Unknown Source) at com.crystaldecisions.enterprise.ocaframework.ServiceMgr.getManagedService(Unknown Source) ... 33 more The communication obviously works when logging in. Please let me know if you got any ideas or know where I can go and look for the answer. :) Regards, Karl

    Read the article

  • Click in a ListView item changes status of elements inside the item?

    - by Antonio
    Hi, I don't know exactly how to explain this problem, but I'll try. I have a ListView with several items. Each item has inside a TextView and two ImageView. I want the ImageView change when I click on them, and I want to open a context menu when I press for a long time into the ListView item. For the ImageView, everything works properly. For the whole item, I can show the context menu after a long press, but my problem is that the ImageView changes as well when I am pressing the TextView, for example. Somo pieces of my code: ListView item: <TextView android:id="@+id/title" android:textColor="@color/black" android:maxLines="2" android:textSize="14dip" /> <ImageView android:id="@+id/minus" android:src="@drawable/minusbutton" android:adjustViewBounds="true" android:gravity="center" /> <ImageView android:id="@+id/plus" android:src="@drawable/plusbutton" android:adjustViewBounds="true" android:gravity="center" /> Drawable to change the status of the plus button: <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_enabled="false" android:drawable="@drawable/button_add_normal_disabled" /> <item android:state_enabled="true" android:state_pressed="true" android:drawable="@drawable/button_add_pressed" /> <item android:state_enabled="true" android:state_focused="true" android:state_pressed="false" android:drawable="@drawable/button_add_active" /> <item android:state_enabled="true" android:state_focused="false" android:state_pressed="false" android:drawable="@drawable/button_add_normal" /> I hope you understand my problem. I think that all the children of a view are affected by an event in the parent, but I am not sure. Do you have a solution? Thanks in advance

    Read the article

  • RelativeLayout differences between 1.5 and 2.1

    - by Kilnr
    I've got a ListView with items composed of RelativeLayouts. This is the relevant XML from the list items: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content"> <TextView android:id="@+id/xx" android:gravity="center_vertical" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:layout_centerInParent="true" android:layout_alignParentLeft="true"/> <TextView android:id="@+id/title" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_toRightOf="@id/xx" /> <TextView android:id="@+id/tag" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toRightOf="@id/xx" android:layout_below="@id/title" /> <TextView android:id="@+id/subtitle" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toRightOf="@id/tag" android:layout_below="@id/title" /> </RelativeLayout> On Android 2.1 (tested on a Nexus One), this shows the desired behavior: On Android 1.5 however (tested on a HTC Hero), it shows up like this: [edit] On 1.6 (emulator), it works as expected as well. The small grey line on the top left is what shows up in the first pic as "xx", so that should be vertically centered. As far as I can see, the XML dictates this, but for some reason, 1.5 ignores it. Why is this? I can't find anything about this difference, and I've been brute forcing any combination of layout_center, center, alignParent*, but to no avail... Can anyone shed some light on this? Thanks!

    Read the article

  • Android ListView with Custom List Selector causing Flickring problem

    - by y ramesh rao
    I'm setting a selector.xml to the ListView Selector : <item android:state_focused="false" android:state_selected="true" android:state_pressed="true" android:drawable="@drawable/timeline_selected_rect"/> <item android:state_focused="false" android:state_selected="true" android:state_pressed="false" android:drawable="@drawable/timeline_selected_rect"/> <item android:state_focused="true" android:state_selected="true" android:state_pressed="true" android:drawable="@drawable/timeline_selected_rect"/> but setting this is causing the TextView flickr over selection. this thing is not happening when the Default selector is used... whats wrong with this selector. I have even added android:cacheColorHint="#00000000" as provided info by some other blogs.

    Read the article

  • Eclipse complains android:scrollbars and android:fadingEdge do not allow Strings - includes code.

    - by emanuel
    Having a problem in Eclipse with regards to an XML file. Eclipse complains that android:scrollbars and android:fadingEdge do not allow Strings. I checked the Android developer site and they do in fact accept strings in the xml file. A related question posed had the problem where there was a missing :android after xmlns. As you can see from the code the line beginning with xmlns is correct I believe. Here is the complete file contents: <?xml version="1.0" encoding="UTF-8"?> <com.example.todolist.TodoListItemView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="10dp" android:scrollbars="verticle" android:textColor="@color/notepad_text" android:fadingEdge="verticle" />

    Read the article

  • Permission denial to read from emailprovider in android

    - by Ambika
    Hello Everyone, I've the problem when I want to read "com.android.email.provider" to get email accounts. Here is my code to retrieve the account : Cursor c = null; Uri CONTENT_URI = Uri.parse("content://com.android.email.provider/account"); String RECORD_ID = "_id"; String[] ID_PROJECTION = new String[] {RECORD_ID }; c = getContentResolver().query(CONTENT_URI,ID_PROJECTION,null, null, null); I get a security exception: java.lang.SecurityException: Permission Denial: reading com.android.email.provider.EmailProvider uri content://com.android.email.provider/account from pid=278, uid=10003 requires com.android.email.permission.ACCESS_PROVIDER I want to know the account is created or not in some other app. Is there any other way to resolve this so that I can read from the provider. I have also tried by adding the permission in manifest: That dint not help. Any solution would be greatly appreciated. Thanks in advance

    Read the article

  • wsimport and Android or any other ProxyGenerator for android?

    - by Shoaib Shaikh
    I am currently developing an Android app i previously developed for IPhone. My Backend is built using WCF service with basichttpEndpoint, i also enabled RESTful methods for better support with other Mobile platforms as well. Now i want to access my existing WCF service(SOAP/REST endpoint) on Android but i need some good ProxyGenerator to consume my services. I just google around for some solution and i found wsimport and wsdl2java(Axis) are two options in java domain. But i am still unable to find any solution related to Android. Can anyone suggest me the best practice in such scenario?

    Read the article

  • How to define GPS module in Android?

    - by Osama Gamal
    I'm porting android to Devkit8000 which is a BeagleBoard clone. I have a GPS module connected on /dev/ttyS0. I could successfully get NMEA output when writing "cat /dev/ttyS0" in the terminal emulator. I want to know how to let android know that there is a GPS module on /dev/ttyS0 and it is outputting NMEA standard? To be able to use the android.location class with it! Is there something to edit in the android's source? adding driver for example, writing a code with android-ndk or what?

    Read the article

  • Android: How to maintain backwards-compatibility?

    - by Peterdk
    According to the instructions found here, to make your app state which screen sizes you can support, you'll need to compile your app against Android 1.6. Using the minSdkVersion and targetSdkVersion this should run also on Android 1.5: <uses-sdk android:minSdkVersion="3" android:targetSdkVersion="4"/> However, when I try to launch my app from Eclipse to run in a emulated 1.5, I get the following error: Failed to find an AVD compatible with target 'Android 1.6'. Is this an error of the eclipse tools/emulator? Or how do I get it to also target 1.5 correctly while giving me the option to specify the supported screens?

    Read the article

  • building mono from svn - android target

    - by Jeremy Bell
    There were patches made to mono on trunk svn to support android. My understanding is that essentially instead of Koush's system which builds mono using the android NDK build system directly, these patches add support for the android NDK using the regular mono configure.sh process. I'd like to play around with this patch, but not being an expert in the mono build system, I have no idea how to tell it to target the android NDK, or even where to look. I've been able to build mono from SVN using the default target (linux) on Ubuntu, but no documentation on how to target android was given with the patches. Since anyone not submitting or reviewing a patch is generally ignored on the mono mailing list, I figured I'd post the question here.

    Read the article

  • Android: Dynamically change Image in Listview

    - by Vivek
    Hi All, I have a listview defined by the following xml. I need to toggle the image in the list during runtime when the user clicks on any row. How can I achieve this? Any help is highly appreciated. Thanks //list_item.xml <?xml version="1.0" encoding="UTF-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content"> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/play" android:id="@+id/img" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center_vertical" android:id="@+id/txt" /> </LinearLayout>

    Read the article

  • Android 2.1 NullPointerException with TabWidgets

    - by ninjasense
    I have an issue I have not been able to figure out and it is only happening on devices running <2.1. It works fine on android 2.2. I have ansynchronous task that displays a loading dialog while it loads all the tabs. Here is the code for the TabActivity: public class OppTabsView extends TabActivity { Dialog dialog; String errorText; boolean save; final int OPP_SAVE = 0; public static boolean edited; public void onCreate(Bundle icicle) { try { super.onCreate(icicle); new DoInBackground().execute(); } catch (Exception e) { Toast.makeText(this, "Error occured. Please try again later.", Toast.LENGTH_SHORT).show(); } } @Override protected void onResume() { super.onResume(); } @Override protected void onStop() { super.onStop(); } @Override protected void onPause() { super.onPause(); } public boolean onCreateOptionsMenu(Menu menu) { menu.add(0, OPP_SAVE, 0, "Test"); return true; } public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case OPP_SAVE: save = true; new DoInBackground().execute(); return true; } return false; } public void LoadOpp() { handler.sendEmptyMessage(0); } public void SaveOpp() { DoStuff(); } public void LoadLayout() { setContentView(R.layout.view_opptabs); /* TabHost will have Tabs */ TabHost tabHost = (TabHost) findViewById(android.R.id.tabhost); /* * TabSpec used to create a new tab. By using TabSpec only we can able * to setContent to the tab. By using TabSpec setIndicator() we can set * name to tab. */ /* tid1 is firstTabSpec Id. Its used to access outside. */ TabSpec firstTabSpec = tabHost.newTabSpec("tid1"); TabSpec secondTabSpec = tabHost.newTabSpec("tid1"); TabSpec thirdTabSpec = tabHost.newTabSpec("tid1"); /* TabSpec setIndicator() is used to set name for the tab. */ /* TabSpec setContent() is used to set content for a particular tab. */ firstTabSpec.setIndicator("General", getResources().getDrawable(R.drawable.tab_moneybag)) .setContent(new Intent(this, OppTabGeneral.class)); secondTabSpec.setIndicator("Details", getResources().getDrawable(R.drawable.tab_papers)).setContent( new Intent(this, OppTabDetails.class)); thirdTabSpec.setIndicator("Contact", getResources().getDrawable(R.drawable.tab_contact)).setContent( new Intent(this, OppTabContact.class)); /* Add tabSpec to the TabHost to display. */ tabHost.addTab(firstTabSpec); tabHost.addTab(secondTabSpec); tabHost.addTab(thirdTabSpec); } private void do_update() { if (save) { SaveOpp(); } else { LoadOpp(); } } Handler handler = new Handler() { public void handleMessage(Message msg) { LoadLayout(); } }; private class DoInBackground extends AsyncTask<Void, Void, Void> implements DialogInterface.OnCancelListener { protected void onPreExecute() { String verb = "Connecting"; if (save) { verb = "Saving"; } dialog = ProgressDialog.show(OppTabsView.this, "", verb + ". Please Wait...", true, true, this); } protected Void doInBackground(Void... v) { do_update(); return null; } protected void onPostExecute(Void v) { dialog.dismiss(); } public void onCancel(DialogInterface dialog) { cancel(true); dialog.dismiss(); finish(); } } } Here is the stack trace from the error: java.lang.NullPointerException at android.widget.TabWidget.dispatchDraw(TabWidget.java:206) at android.view.ViewGroup.drawChild(ViewGroup.java:1529) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258) at android.view.ViewGroup.drawChild(ViewGroup.java:1529) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258) at android.view.ViewGroup.drawChild(ViewGroup.java:1529) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258) at android.view.View.draw(View.java:6538) at android.widget.FrameLayout.draw(FrameLayout.java:352) at android.view.ViewGroup.drawChild(ViewGroup.java:1531) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258) at android.view.ViewGroup.drawChild(ViewGroup.java:1529) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258) at android.view.View.draw(View.java:6538) at android.widget.FrameLayout.draw(FrameLayout.java:352) at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1830) at android.view.ViewRoot.draw(ViewRoot.java:1349) at android.view.ViewRoot.performTraversals(ViewRoot.java:1114) at android.view.ViewRoot.handleMessage(ViewRoot.java:1633) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:123) at android.app.ActivityThread.main(ActivityThread.java:4363) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:521) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) at dalvik.system.NativeStart.main(Native Method) I have tried stepping through it but the error seems to come out of no where, not at a specific line. Any help is greatly appreciated.

    Read the article

  • Android Jar libraries

    - by Jeremy Edwards
    How do you setup a project that can result in a jar library file that can be used for android? I want to create a custom library across all projects. Few other questions: Does it need to be compiled against a specific version of android sdk? When an android package is compiled against a jar library does the classes necessary to work with the code get compiled with main code into the apk or does the entire jar get included? Any notable optimizations or pitfalls I need to know about with using a jar instead of integrating the code directly? Does the jar have to be signed like the apk needs to?

    Read the article

  • How can I reference a drawable class in Android XML

    - by James Veenstra
    I've created a class that extends drawable that I'd like to reference inside a resource xml. I happen to need it in a selector, like so: <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_window_focused="false" android:state_pressed="false" android:drawable="com.sample.android.contacts.TopBarCollapsed" /> <item android:state_window_focused="true" android:state_pressed="true" android:drawable="@drawable/top_switcher_collapsed_selected" /> <item android:state_focused="true" android:drawable="@drawable/top_switcher_collapsed_focused" /> com.sample.android.contacts.TopBarCollapsed is the class that extends drawable.

    Read the article

  • Android UnknownHost in asyncTask - loading web page

    - by Sneha
    I followed this tutorial for AsyncTask and getting the following error log: 03-23 11:44:42.936: WARN/System.err(315): java.net.UnknownHostException: www.google.co.in 03-23 11:44:42.936: WARN/System.err(315): at java.net.InetAddress.lookupHostByName(InetAddress.java:513) 03-23 11:44:42.936: WARN/System.err(315): at java.net.InetAddress.getAllByNameImpl(InetAddress.java:278) 03-23 11:44:42.936: WARN/System.err(315): at java.net.InetAddress.getAllByName(InetAddress.java:242) 03-23 11:44:42.936: WARN/System.err(315): at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:136) 03-23 11:44:42.936: WARN/System.err(315): at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164) 03-23 11:44:42.936: WARN/System.err(315): at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119) 03-23 11:44:42.936: WARN/System.err(315): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:348) 03-23 11:44:42.936: WARN/System.err(315): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555) 03-23 11:44:42.936: WARN/System.err(315): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487) 03-23 11:44:42.944: WARN/System.err(315): at org.apache.http.impl.client.AbstractHttpC lient.execute(AbstractHttpClient.java:465) 03-23 11:44:42.944: WARN/System.err(315): at com.test.async.AsyncTaskExampleActivity$DownloadWebPageTask.doInBackground (AsyncTaskExampleActivity.java:36) 03-23 11:44:42.944: WARN/System.err(315): at com.test.async.AsyncTaskExampleActivity$DownloadWebPageTask.doInBackground (AsyncTaskExampleActivity.java:1) 03-23 11:44:42.944: WARN/System.err(315): at android.os.AsyncTask$2.call(AsyncTask.java:185) 03-23 11:44:42.944: WARN/System.err(315): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305) 03-23 11:44:42.944: WARN/System.err(315): at java.util.concurrent.FutureTask.run (FutureTask.java:137) 03-23 11:44:42.944: WARN/System.err(315): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068) 03-23 11:44:42.944: WARN/System.err(315): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561) 03-23 11:44:42.944: WARN/System.err(315): at java.lang.Thread.run(Thread.java:1096) How do i fix it?? My Code: public class AsyncTaskExampleActivity extends Activity { private TextView textView; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); textView = (TextView) findViewById(R.id.TextView01); } private class DownloadWebPageTask extends AsyncTask<String, Void, String> { @Override protected String doInBackground(String... urls) { String response = ""; Log.i("", "in doInBackgroundddddddddd.........."); Log.i("", "in readWebpageeeeeeeeeeeee"); /* * try { InetAddress i = * InetAddress.getByName("http://google.co.in"); } catch * (UnknownHostException e1) { e1.printStackTrace(); } */ for (String url : urls) { Log.i("", "in for looooooop doInBackgroundddddddddd.........."); DefaultHttpClient client = new DefaultHttpClient(); HttpGet httpGet = new HttpGet(url); try { Log .i("", "afetr for looooooop try doInBackgroundddddddddd.........."); HttpResponse execute = client.execute(httpGet); Log .i("", "afetr for looooooop try client ..execute doInBackgroundddddddddd.........."); InputStream content = execute.getEntity().getContent(); BufferedReader buffer = new BufferedReader( new InputStreamReader(content)); String s = ""; while ((s = buffer.readLine()) != null) { response += s; Log .i("", "afetr while looooooop try client ..execute doInBackgroundddddddddd.........."); } } catch (Exception e) { e.printStackTrace(); } } Log .i("", "afetr lasttttttttttttt b4 response doInBackgroundddddddddd.........."); return response; } @Override protected void onPostExecute(String result) { Log.i("", "in onPostExecuteeee.........."); textView.setText(result); } } public void readWebpage(View view) { /* * System.setProperty("http.proxyHost", "10.132.116.10"); * System.setProperty("http.proxyPort", "3128"); */ DownloadWebPageTask task = new DownloadWebPageTask(); task.execute(new String[] { "http://google.co.in" }); Log.i("", "in readWebpageeeeeeeeeeeee after execute.........."); } } main.xml: <Button android:id="@+id/readWebpage" android:layout_width="match_parent" android:layout_height="wrap_content" android:onClick="readWebpage" android:text="Load Webpage"> </Button> <TextView android:id="@+id/TextView01" android:layout_width="match_parent" android:layout_height="match_parent" android:text="Example Text"> </TextView> Manifest: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.test.async" android:versionCode="1" android:versionName="1.0"> <uses-sdk android:minSdkVersion="8" /> <uses-permission android:name="android.permission.INTERNET"></uses-permission> <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".AsyncTaskExampleActivity" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> Thanks Sneha

    Read the article

  • Android: Prompt user to save changes when Back button is pressed

    - by chriskopec
    I have an activity that contains several user editable items (an EditText field, RatingBar, etc). I'd like to prompt the user if the back/home button is pressed and changes have been made that have not yet been saved. After reading through the android documentation, it seems like this piece of code should go in the onPause method. I've tried putting an AlertDialog in the onPause however the dialog gets shown and then immediately tears down because nothing is there to block the pause from completing. This is what I've come up with so far: @Override protected void onPause() { super.onPause(); AlertDialog ad = new AlertDialog.Builder(this).setMessage( R.string.rating_exit_message).setTitle( R.string.rating_exit_title).setCancelable(false) .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { // User selects OK, save changes to db } }).setNeutralButton(android.R.string.cancel, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { // User selects Cancel, discard all changes } }).show(); } Am I on the right track or is there another way to accomplish what I'm trying to do here? Any help would be great!

    Read the article

  • Android: Alignment of four squares

    - by metter
    Hello There I am trying to align four equally sized squares on an Android Screen & I have now tried what feels like a million different approaches, yet none of them seem to work :(. What I've got at the moment is the following: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/MasterLayout" android:layout_width="wrap_content" android:layout_height="fill_parent" android:background="#FFFFFF" <TableRow android:layout_weight="1" android:background="#BBBBBB" android:padding="0dip"> <TableRow android:layout_weight="1" android:padding="0dip"> This basically does the job. However, every one of those four Images has a huge padding above and under it. How do I get rid of that? Or do I need to use a different Layout type alltogether? To help illustrate my problem, here's a picture. On the left is what I got, on the right is what I need. Image Thank you very much! Cheers, Markus!

    Read the article

  • Android: Communication with host computer

    - by dannyn382
    I am looking for ideas as to how all of you can think to solve this issue. I am going to be using an Android Tablet as basically a touch screen input for a project. I need to be able to control servos and solenoids and such, so I will be using a Raspberry Pi to do this. I am looking for ideas on how to get the tablet and the Raspberry Pi to talk. Here are a few that I have though of so far. Use Wifi (which I really do not want to, Ethernet would be okay) to ssh into the Raspberry Pi (with an external library) and run scripts that way from the Android app. Use a com port for Android (maybe Andropod if there hardware becomes available?) and run scripts on the Raspberry Pi. Those are probably two of the "best" ideas that I can think of for now. Can anyone think of any other "better" ideas? Thanks in advance for the help, Dan

    Read the article

  • Which Android app resolutions to support?

    - by wordyword
    I see on the Android SDK pages, it mentions some screen resolutions to expect on Android platforms: Small screen QVGA (240x320), 2.6"-3.0" diagonal Normal screen WQVGA (240x400), 3.2"-3.5" diagonal FWQVGA (240x432), 3.5"-3.8" diagonal HVGA (320x480), 3.0"-3.5" diagonal WVGA (480x800), 3.3"-4.0" diagonal FWVGA (480x854), 3.5"-4.0" diagonal Large screen WVGA (480x800), 4.8"-5.5" diagonal FWVGA (480x854), 5.0"-5.8" diagonal Obviously, testing an app you want to sell on all these resolutions is going to be a pain. Is there any data on what percent of android phones being used use the above resolutions? My hope is that there's only really 3 or so popular resolutions...

    Read the article

  • AutoCompleteTextView displays 'android.database.sqlite.SQLiteCursor@'... after making selection

    - by user244190
    I am using the following code to set the adapter (SimpleCursorAdapter) for an AutoCompleteTextView mComment = (AutoCompleteTextView) findViewById(R.id.comment); Cursor cComments = myAdapter.getDistinctComments(); scaComments = new SimpleCursorAdapter(this,R.layout.auto_complete_item,cComments,new String[] {DBAdapter.KEY_LOG_COMMENT},new int[]{R.id.text1}); mComment.setAdapter(scaComments); auto_complete_item.xml <?xml version="1.0" encoding="utf-8"?> <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/text1" android:layout_width="wrap_content" android:layout_height="wrap_content"/> and thi is the xml for the actual control <AutoCompleteTextView android:id="@+id/comment" android:hint="@string/COMMENT" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textSize="18dp"/> The dropdown appears to work correctly, and shows a list of items. When I make a selection from the list I get a sqlite object ('android.database.sqlite.SQLiteCursor@'... ) in the textview. Anyone know what would cause this, or how to resolve this? thanks Ok I am able to hook into the OnItemClick event, but the TextView.setText() portion of the AutoCompleteTextView widget is updated after this point. The OnItemSelected() event never gets fired, and the onNothingSelected() event gets fired when the dropdown items are first displayed. mComment.setOnItemClickListener( new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) { // TODO Auto-generated method stub SimpleCursorAdapter sca = (SimpleCursorAdapter) arg0.getAdapter(); String str = getSpinnerSelectedValue(sca,arg2,"comment"); TextView txt = (TextView) arg1; txt.setText(str); Toast.makeText(ctx, "onItemClick", Toast.LENGTH_SHORT).show(); } }); mComment.setOnItemSelectedListener(new OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long arg3) { Toast.makeText(ctx, "onItemSelected", Toast.LENGTH_SHORT).show(); } @Override public void onNothingSelected(AdapterView<?> arg0) { // TODO Auto-generated method stub Toast.makeText(ctx, "onNothingSelected", Toast.LENGTH_SHORT).show(); } }); Anyone alse have any ideas on how to override the updating of the TextView? thanks patrick

    Read the article

< Previous Page | 29 30 31 32 33 34 35 36 37 38 39 40  | Next Page >