Search Results

Search found 12350 results on 494 pages for 'mono for android'.

Page 15/494 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • Android never receives UDP packet

    - by Quandary
    The below code results in a timeout. It works fine on non-Android Java. What's the matter? //@Override public static void run() { //System.out.println ( "Local Machine IP : "+addrStr.toString ( ) ) ; HelloWorldActivity.tv.setText("Trace 1"); try { // Retrieve the ServerName InetAddress serverAddr; //= InetAddress.getByName(Server.SERVERIP); InetAddress ias[] = InetAddress.getAllByName(Server.SERVERNAME); serverAddr = ias[0]; Log.d("UDP", "C: Connecting..."); /* Create new UDP-Socket */ DatagramSocket socket = new DatagramSocket(); /* Prepare some data to be sent. */ String strQuery="ÿÿÿÿgetservers"+" "+Server.iProtocol+" "+"'all'"; Log.d("UDP", strQuery); //byte[] buf = ("ÿÿÿÿgetservers 68 'all'").getBytes(); byte[] buf = strQuery.getBytes(); /* Create UDP-packet with * data & destination(url+port) */ DatagramPacket packet = new DatagramPacket(buf, buf.length, serverAddr, Server.SERVERPORT); Log.d("UDP", "C: Sending: '" + new String(buf) + "'"); /* Send out the packet */ socket.setSoTimeout(5000); socket.send(packet); Log.d("UDP", "C: Sent."); Log.d("UDP", "C: Done."); // http://code.google.com/p/android/issues/detail?id=2917 byte[] buffer= new byte[1024*100]; DatagramPacket receivePacket = new DatagramPacket(buffer, buffer.length); //, serverAddr, Server.SERVERPORT); socket.receive(receivePacket); HelloWorldActivity.tv.setText("TTT"); String x = new String(receivePacket.getData()); Log.d("UDP", "C: Received: '" + x + "'"); HelloWorldActivity.tv.setText(x); } catch (Exception e) { HelloWorldActivity.tv.setText(e.getMessage()); Log.e("UDP", "C: Error", e); } } public class Server { /* //public static java.lang.string SERVERIP; public static String SERVERNAME = "monster.idsoftware.com"; public static String SERVERIP = "192.246.40.56"; public static int SERVERPORT = 27950; public static int PROTOCOL = 68; */ //public static String SERVERNAME="monster.idsoftware.com"; public static String SERVERNAME="dpmaster.deathmask.net"; public static String SERVERIP="192.246.40.56"; public static int SERVERPORT=27950; //public static int iProtocol= 68; // Quake3 public static int iProtocol=71; // OpenArena } Android manifest: <?xml version="1.0" encoding="utf-8"?> <use-permission id="android.permission.READ_CONTACTS" /> <use-permission android:name="android.permission.WRITE_SETTINGS" /> <uses-permission android:name="android.permission.READ_CONTACTS" /> <uses-permission android:name="android.permission.CALL_PHONE" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_GPS" /> <uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_ASSISTED_GPS" /> <uses-permission android:name="android.permission.ACCESS_CELL_ID" /> <uses-permission android:name="android.permission.RECEIVE_SMS" /> <uses-permission android:name="android.permission.VIBRATE" /> <uses-permission android:name="android.permission.WAKE_LOCK" /> <application android:icon="@drawable/icon" android:label="AAA New Application" > <activity android:name="HelloWorldActivity"> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> </application>

    Read the article

  • Can I use android.os.* libraries in a standalone project?

    - by medicdave
    I'm trying to develop an external library (not sure if that's the right term) to provide prepackaged functionality in Android projects. Working in Eclipse, I've added the appropriate android.jar file to the build path, and everything is happy both while editing and upon compilation. However, when I use Android's Handler and Message classes (android.os.Handler, android.os.Message) for inter-thread communication, I get exceptions unless I'm running within an Android app, on the emulator or a device. I can no longer test my library in a "standalone" way without having to go through a running Android target. Is there any way for me to include these two Android classes and still be able to test my library standalone? Do I need to have the Android source available? Or would it require some sort of conditional compilation hand-waving?

    Read the article

  • How to publish paid Android apps if you're not from US/UK

    - by Sheikh Aman
    I was pretty excited while creating one of my apps but as it turns out you can't actually sign up for Google Checkout if you don't live either in the USA or in the UK. And since Google Checkout is the only way Android Market will pay you, all my efforts seem to be going in vain. So because I live in India, I can't sell my apps. I tried contacting Google by various means on this, but haven't got any response so far. I tried searching the web as well just to find out that one can't be paid via any other way. I am pretty sure that many people here might have gone through the same problem. How did you solve it? I have a PayPal account and an AdSense account as well. Can they help in any way? And if nothing works out, how am I supposed to be selling my app?

    Read the article

  • Mono is frequently used to say "Yes, .NET is cross-platform". How valid is that claim?

    - by Thorbjørn Ravn Andersen
    In What would you choose for your project between .NET and Java at this point in time ? I say that I would consider the "Will you always deploy to Windows?" the single most important decision to make up front in a new web project, and if the answer is "no", I would recommend Java instead of .NET. A very common counter-argument is that "If we ever want to run on Linux/OS X/Whatever, we'll just run Mono", which is a very compelling argument on the surface, but I don't agree for several reasons. OpenJDK and all the vendor supplied JVM's have passed the official Sun TCK ensuring things work correctly. I am not aware of Mono passing a Microsoft TCK. Mono trails the .NET releases. What .NET-level is currently fully supported? Does all GUI elements (WinForms?) work correctly in Mono? Businesses may not want to depend on Open Source frameworks as the official plan B. I am aware that with the new governance of Java by Oracle, the future is unsafe, but e.g. IBM provides JDK's for many platforms, including Linux. They are just not open sourced. So, under which circumstances is Mono a valid business strategy for .NET-applications?

    Read the article

  • Does Mono have a place in the enterprise world?

    - by Daniel
    For enterprise windows-based solutions, .NET is the best choice sometimes. How is Mono looked at by the enterprises who have to use Linux (or rather prefer to use Linux) ? Assuming that the developers aren't a problem and they are familiar with .NET/Mono and other possible competitors such as Java. Would a medium/large company run Mono on their servers as opposite to technologies such as Java? Do you know of any such company ?

    Read the article

  • Why is Android VM-based? [closed]

    - by adib
    By about 2004, it was clear that ARM is the clear winner for mobile CPUs, beating out MIPS, SH3, and DragonBall. PocketPC (Windows Mobile) applications was natively-compiled (at least most of them - except for .NET compact and its competitors). Likewise, Apple's iOS (named iPhone OS at the time) prefers natively-compiled applications. Then why Android chose a virtual machine based system stack? (the Dalvik VM). Wouldn't it be simpler to just compile applications down to ARM code using GCJ or something? Is the decision influenced by the J2ME-way of doing things, or was just because it's "cool"? Perhaps like most things Java, the culture that prefers multiple levels of indirection and abstractions, they just added another layer of abstraction for "just in case"?

    Read the article

  • where can I get Mono 2.10 for Maverick and Natty? [closed]

    - by burli
    Possible Duplicate: Upgrading to latest stable Mono Hi, I want to use Mono for some projects, but in Ubuntu (or Debian in general) is just 2.6.7 avalible. And I could not find any packages or PPAs. I tried to compile it myself, but I failed. Where can I get the current Mono 2.10 Version for Ubuntu Maverick and Natty? http://badgerports.org/ only supports Lucid and Hardy and is not up to date

    Read the article

  • Android design advice - services & broadcast receivers

    - by basudz
    I'm in the process of learning the Android SDK and creating some projects to get a grasp on the system. The current project I'm working with works just fine but I'd like to get some advice about other ways I can go about designing it. Here's what it needs to do. When a text message is received from a specific number, it should fire off a toast message that repeats at a certain interval for a specific duration. To make this work, I created an SMS BroadcastReceiver and checked the incoming messages for the number I'm looking for. If found, an IntentService would be started that would pull out the interval and duration from saved shared prefs. The IntentService would then fire off a broadcast. The BroadcastReceiver for this would catch it and use the AlarmManager to handle the toast message repetitions. This all works just fine, but I'm wondering if there's a cleaner or more efficient way of going about doing this? Any suggestions or advice?

    Read the article

  • Problem with TextViews running into each other in RelativeLayout

    - by Janusz
    I have a problem with two Textviews on the same height in a RelativeLayout running into each other. I use the following Layout. <?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="fill_parent"> <ImageView android:id="@+id/logo" android:layout_width="wrap_content" android:layout_height="wrap_content" android:adjustViewBounds="true" android:scaleType="centerInside" android:src="@drawable/icon" /> <TextView android:id="@+id/name" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="NameNameNameNameNameNameName" android:layout_alignParentTop="true" android:layout_toRightOf="@id/logo" android:gravity="clip_horizontal" android:lines="1" /> <TextView android:id="@+id/information" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="information" android:layout_alignParentRight="true" android:layout_alignParentTop="true" /> <TextView android:id="@+id/nrcoupons" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Number" android:layout_alignRight="@id/information" android:layout_alignBottom="@id/logo" /> <TextView android:id="@+id/subcategory" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Subcategory" android:layout_alignLeft="@id/name" android:layout_alignBottom="@id/logo" /> </RelativeLayout> This gives me this view: Everything is as I need it except the two textviews name and information are displayed on the same screen space with the one on top of the other. How can I avoid this?

    Read the article

  • Is there a difference between starting an application from the OS or from adb

    - by aruwen
    I do have a curious error in my application. My app crashes (don't mind the crash, I roughly know why - classloader) when I start the application from the OS directly, then kill it from the background via any Task Killer (this is one of the few ways to reproduce the crash consistently - simulating the OS freeing memory and closing the application) and try to restart it again. The thing is, if I start the application via adb shell using the following command: adb shell am start -a android.intent.action.MAIN -n com.my.packagename/myLaunchActivity I cannot reproduce the crash. So is there any difference in how Android OS calls the application as opposed to the above call? EDIT: added the manifest (just changed names) <?xml version="1.0" ?> <manifest android:versionCode="5" android:versionName="1.05" package="com.my.sample" xmlns:android="http://schemas.android.com/apk/res/android"> <uses-sdk android:minSdkVersion="7"/> <application android:icon="@drawable/square_my_logo" android:label="@string/app_name"> <activity android:label="@string/app_name" android:name="com.my.InfoActivity" android:screenOrientation="landscape"></activity> <activity android:label="@string/app_name" android:name="com.my2.KickStart" android:screenOrientation="landscape"/> <activity android:label="@string/app_name" android:name="com.my2.Launcher" android:screenOrientation="landscape"> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> </application> <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/></manifest> starting the com.my2.Launcher from the adb shell

    Read the article

  • Spinner original text

    - by user1696863
    I'm trying my Spinner to display "Select City" before the Spinner has itself been clicked by the user. How can I do this? My current XML code is: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:custom="http://schemas.android.com/apk/res/com.olacabs.customer" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/page_background" android:orientation="vertical" > <TextView android:id="@+id/textView1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@android:color/darker_gray" android:gravity="center" android:paddingBottom="4dp" android:paddingTop="4dp" android:text="@string/rate_card" android:textColor="@color/white" android:textSize="20dp" custom:customFont="litera_bold.ttf" /> <Spinner android:id="@+id/select_city" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="40dp" android:prompt="@string/selectCity" /> </LinearLayout> Also, what does android:spinnerMode exactly do. I tried changing its value to dropdown but nothing happened and the application still showed a popup dialogue. My activity that implements this XML file is: public class RateCardActivity extends OlaActivity { public void onCreate(Bundle bundle) { super.onCreate(bundle); setContentView(R.layout.rate_card); Spinner spinner = (Spinner) findViewById(R.id.select_city); ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this, R.array.select_city, android.R.layout.simple_spinner_item); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); spinner.setAdapter(adapter); } }

    Read the article

  • Layout: how to make image to change its width and height proportionally?

    - by Exterminator13
    I have such layout: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal"> <TextView android:id="@+id/title" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_centerVertical="true" android:layout_toLeftOf="@+id/my_image" android:ellipsize="end" android:singleLine="true" android:text="Some text" android:textAppearance="?android:attr/textAppearanceMedium" /> <ImageView android:id="@+id/my_image" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignTop="@+id/title" android:layout_alignBottom="@+id/title" android:layout_alignParentRight="true" android:layout_centerVertical="true" android:adjustViewBounds="true" android:src="@drawable/my_bitmap_image" /> This layout does almost what I need: it makes image view height the same as text view. The image graphic contents stretched also keeping aspect ratio. But, the width of the image view does not change! As a result, I have a wide gap between text and the image view! As a temporal solution, I override View#onLayout. The question: how to change image width in xml layout? UPDATE: This is a final layout I need (text + a few images). Look at the first image: its width should be exactly the same as scaled image in it with no paddings and margins:

    Read the article

  • Android HTTPClient not working inspite of giving permissions in manifest file.

    - by primal
    Hi, I was trying http-cleint tutorials from svn.apache.org. While running the application I am getting the following error in console. [2010-04-30 09:26:36 - HalloAndroid] ActivityManager: java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.org.example/.HalloAndroid } from null (pid=-1, uid=-1) requires android.permission.INTERNET I have added android.permission.INTERNET in AndroidManifest.xml. <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.org.example" android:versionCode="1" android:versionName="1.0"> <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".HalloAndroid" android:label="@string/app_name" android:permission="android.permission.INTERNET"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> <uses-permission android:name="android.permission.INTERNET"></uses-permission> </manifest> The java code in HalloAndroid.java is as follows HttpClient httpclient = new DefaultHttpClient(); HttpGet httpget2 = new HttpGet("http://google.com/"); HttpResponse response2 = null; try { response2 = httpclient.execute(httpget2); } catch (ClientProtocolException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } HttpEntity entity = response2.getEntity(); if (entity != null) { long len = entity.getContentLength(); if (len != -1 && len < 2048) { try { Log.d(TAG, EntityUtils.toString(entity)); } catch (ParseException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } else { // Stream content out } Any help is much appreciated.

    Read the article

  • Problem running apt-get DPKG broken?

    - by nekochan7
    Problem when runing apt-get debian av # sudo dpkg --configure -a Setting up libgdata2.1-cil (2.2.0.0-2) ... mono: ../nptl/pthread_mutex_lock.c:80: __pthread_mutex_cond_lock: Assertion `mutex->__data.__owner == 0' failed. Native stacktrace: /usr/bin/mono() [0x4ac5a1] /lib/x86_64-linux-gnu/libpthread.so.0(+0xf8f0) [0x7fee2c0e88f0] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x37) [0x7fee2bd65407] /lib/x86_64-linux-gnu/libc.so.6(abort+0x148) [0x7fee2bd68508] /lib/x86_64-linux-gnu/libc.so.6(+0x2e516) [0x7fee2bd5e516] /lib/x86_64-linux-gnu/libc.so.6(+0x2e5c2) [0x7fee2bd5e5c2] /lib/x86_64-linux-gnu/libpthread.so.0(+0x113f6) [0x7fee2c0ea3f6] /lib/x86_64-linux-gnu/libpthread.so.0(pthread_cond_wait+0x150) [0x7fee2c0e5140] /usr/bin/mono() [0x6058b3] /usr/bin/mono() [0x5fdd25] /usr/bin/mono() [0x604077] /lib/x86_64-linux-gnu/libpthread.so.0(+0x80ca) [0x7fee2c0e10ca] /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d) [0x7fee2be1605d] Debug info from gdb: ================================================================= Got a SIGABRT while executing native code. This usually indicates a fatal error in the mono runtime or one of the native libraries used by your application. ================================================================= Aborted mono: ../nptl/pthread_mutex_lock.c:80: __pthread_mutex_cond_lock: Assertion `mutex->__data.__owner == 0' failed. Native stacktrace: /usr/bin/mono() [0x4ac5a1] /lib/x86_64-linux-gnu/libpthread.so.0(+0xf8f0) [0x7fcec8eef8f0] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x37) [0x7fcec8b6c407] /lib/x86_64-linux-gnu/libc.so.6(abort+0x148) [0x7fcec8b6f508] /lib/x86_64-linux-gnu/libc.so.6(+0x2e516) [0x7fcec8b65516] /lib/x86_64-linux-gnu/libc.so.6(+0x2e5c2) [0x7fcec8b655c2] /lib/x86_64-linux-gnu/libpthread.so.0(+0x113f6) [0x7fcec8ef13f6] /lib/x86_64-linux-gnu/libpthread.so.0(pthread_cond_wait+0x150) [0x7fcec8eec140] /usr/bin/mono() [0x6058b3] /usr/bin/mono() [0x5fdd25] /usr/bin/mono() [0x604077] /lib/x86_64-linux-gnu/libpthread.so.0(+0x80ca) [0x7fcec8ee80ca] /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d) [0x7fcec8c1d05d] Debug info from gdb:

    Read the article

  • Android AppWidget TextView: How to set background color programmaticly

    - by Amit
    I am trying to create an AppWidget, in which the background color of a TextView changes at random at specified periodic interval. The TextView is defined in layout xml file as <?xml version="1.0" encoding="utf-8" ?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/widget" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" > <TextView android:id="@+id/message" android:background="#ff99ff" android:text="Hello Widget" /> </LinearLayout> In update method, i have loaded the layout as RemoteViews remoteView=new RemoteViews(context.getPackageName(),R.layout.widget_message); To change the background of TextView i used the following statement remoteView.setInt(R.id.message, "setBackgroundResource", R.color.col_1); But i am getting a widget saying problem loading widget. If i remove the above line everything works fine. LogCat says: updateAppWidget couldn't find any view, using error view android.widget.RemoteViews$ActionException: view: android.widget.TextView can't use method with RemoteViews: setBackgroundResource(int)

    Read the article

  • GridView row remove and animation - Android

    - by Pria
    I have a GridView in which each row has a custom view. The grid view adapter has an array that keeps the custom view. At click of a button, I want to remove a specific row from the Grid and while doing so I want animation on it. I have an AnimationListener. When I remove the upper most row from the array and setAdapter in onAnimationEnd(). It works perfectly fine. But, when I remove any other row, it gives a NullPointerException in the main thread. The exception thread is as follows: ERROR/AndroidRuntime(11503): java.lang.NullPointerException at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1227) at android.widget.AbsListView.dispatchDraw(AbsListView.java:1319) at android.view.View.draw(View.java:5944) at android.widget.AbsListView.draw(AbsListView.java:2121) at android.view.ViewGroup.drawChild(ViewGroup.java:1486) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228) at android.view.View.draw(View.java:5841) at android.widget.FrameLayout.draw(FrameLayout.java:352) at android.view.ViewGroup.drawChild(ViewGroup.java:1486) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228) at android.view.View.draw(View.java:5841) at android.widget.FrameLayout.draw(FrameLayout.java:352) at android.view.ViewGroup.drawChild(ViewGroup.java:1486) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228) at android.view.View.draw(View.java:5841) at android.widget.FrameLayout.draw(FrameLayout.java:352) at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1847) at android.view.ViewRoot.draw(ViewRoot.java:1217) at android.view.ViewRoot.performTraversals(ViewRoot.java:1030) at android.view.ViewRoot.handleMessage(ViewRoot.java:1482) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:123) at android.app.ActivityThread.main(ActivityThread.java:3948) 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:782) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540) at dalvik.system.NativeStart.main(Native Method) Please help!!!

    Read the article

  • Why can't Android find android.graphics.OpenGLContext?

    - by lostInTransit
    I am trying to compile some OpenGL samples available on the net in SDK 1.5. But the import statement for android.graphics.OpenGLContext gives me an error saying the class cannot be found. Can someone please tell me where I can find this class. And if it is no longer supported by the android SDK then how do I port the samples to 1.5.

    Read the article

  • Android AppWidget TextView: How to set background color at run time

    - by Amit
    I am trying to create an AppWidget, in which the background color of a TextView changes at random at specified periodic interval. The TextView is defined in layout xml file as <?xml version="1.0" encoding="utf-8" ?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/widget" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" > <TextView android:id="@+id/message" android:background="#ff99ff" android:text="Hello Widget" /> </LinearLayout> In update method, i have loaded the layout as RemoteViews remoteView=new RemoteViews(context.getPackageName(),R.layout.widget_message); To change the background of TextView i used the following statement remoteView.setInt(R.id.message, "setBackgroundResource", R.color.col_1); But i am getting a widget saying problem loading widget. If i remove the above line everything works fine. LogCat says: updateAppWidget couldn't find any view, using error view android.widget.RemoteViews$ActionException: view: android.widget.TextView can't use method with RemoteViews: setBackgroundResource(int)

    Read the article

  • android: start an intent into a framelayout

    - by user329692
    Hi guys! I have a main activity with this layout file: <?xml version="1.0" encoding="utf-8"?> <Button android:id="@+id/btn_reload" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Reload" /> <LinearLayout android:id="@+id/LinearLayout01" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="center_vertical|center_horizontal" > <ImageView android:id="@+id/ImageView01" android:src="@drawable/logo_head" android:scaleType="fitStart" android:adjustViewBounds="true" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </LinearLayout> </LinearLayout> <FrameLayout android:id="@+id/center" android:layout_height="fill_parent" android:layout_width="fill_parent" android:layout_weight="1"> </FrameLayout> <LinearLayout android:layout_height="fill_parent" android:layout_width="fill_parent" android:gravity="center" android:id="@+id/footer" android:layout_weight="2.6" android:background="#ffffff"> </LinearLayout> Basically it is composed by an header, a central part (android:id="@+id/center") and a footer. The footer contains four buttons, created dinamically. At the end it looks like a TabWidget with the tabs at the botton. Each footer's buttons holds an Intent/activity. The question is: How can i start my activity into the FrameLayout? For instance TabHost does this: ..... spec = tabHost .newTabSpec(tabTitle.toLowerCase()) .setIndicator(tabTitle,res.getDrawable(R.drawable.tab_spec)) .setContent(intent); tabHost.addTab(spec); ....

    Read the article

  • Android crashes when calling ImageButton

    - by Joël
    I have a crash (Application Stopped Unexpectedly) problem with this main.xml is a "HelloWorld" type project (while testing and learning features I need for my app) : I isolated the ImageButton as an issue, but I can't isolate any of the parameters... <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <ImageButton android:id="@+id/picture" android:layout_width="240dip" android:layout_height="180dip" android:layout_gravity="center_horizontal" android:src="@drawable/icon" android:adjustViewBounds="true" android:cropToPadding="true" android:clickable="true" android:scaleType="fitCenter" /> </LinearLayout> icon.png exists in my resources... I can see the preview in the Layout tab, even though the image is not centered on the button, but I read that it was normal. The code below works fine (as a regular Button). I can also do the same as an ImageView. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <Button android:id="@+id/picture" android:layout_width="240dip" android:layout_height="180dip" android:layout_gravity="center_horizontal" /> </LinearLayout> I use Eclipse and the AVD, and all my learning is done on 2.1 (SDK level 7). I can't test the app on an actual device yet as I don't have it yet. Thanks in advance !

    Read the article

  • Android customizing ViewFlipper...

    - by wearysamurai
    So I'm having pretty much exactly the problem described here: http://code.google.com/p/android/issues/detail?id=6191 and until the ViewFlipper issue in 2.1 and 2.2 has been resolved, I'm attempting to customize my own ViewFlipper in the manner described: @Override protected void onDetachedFromWindow() { try { super.onDetachedFromWindow(); } catch (IllegalArgumentException e) { // Call stopFlipping() in order to kick off updateRunning() stopFlipping(); } } But I've never done this sort of thing before and am hoping to get a little guidance (as my own efforts are coming up short). Here's what I have so far. FixedFlipper.java: import android.content.Context; import android.util.AttributeSet; import android.widget.ViewFlipper; public class FixedFlipper extends ViewFlipper{ public FixedFlipper(Context context){ super(context); } public FixedFlipper(Context context, AttributeSet attrs){ super(context, attrs); } @Override protected void onDetachedFromWindow(){ try{ super.onDetachedFromWindow(); }catch(Exception e){ super.stopFlipping(); } } } main.xml: <com.site.TestApp.FixedFlipper style="@style/body" android:id="@+id/flipper"> ... </com.site.TestApp.FixedFlipper> And in my activity, I invoke it like so: FixedFlipper flipper = (FixedFlipper)findViewById(R.id.flipper); It seems like it should be pretty straightforward, but I keep getting this: Binary XML file line #4: Error inflating class com.site.TestApp.FixedFlipper I appreciate any suggestions. I've been chasing my tail for hours trying to figure out what piece of the puzzle I'm missing.

    Read the article

  • Problem with sizes of EditText and Button in Android

    - by DixieFlatline
    I want to make the edittext width the same size as button. My EditText is currently very small. I use relative layout. <TextView android:id="@+id/aha4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="17dip" android:text="Vzdevek:" android:layout_below="@id/aha3" /> <EditText android:id="@+id/nick" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_below="@id/nivo" android:layout_toRightOf="@id/aha4"/> <Button android:id="@+id/poslji" android:text="Pošlji" android:layout_height="wrap_content" android:layout_width="20dip" android:typeface="serif" android:textStyle="bold" android:layout_alignParentRight="true" android:layout_below="@id/nivo" android:layout_toRightOf="@id/nick"/> What i currently get is this: What is the appropriate layout_width for edittext and button?

    Read the article

  • Application as part of Android Built

    - by Gidiyo
    Hi, I had built a application using the Android SDK. Now I would like to package this application as part of the Android build. So that when I port Android into my device, it will appear in the Application menu. I tried, copying the apk file into the package folder, and include it in the make file. Doesn't work. How should I do it?

    Read the article

  • Implement Camera on Android Emulator | Need some knowledge

    - by Thisara
    I'm interested in doing some enhancements to android emulator (implement webcam on emulator). Therefore I'm following the android source and emulators source to get basic understanding & the connection between modules. But its really hard to understand it for someone who is new to android. Therefore can anyone please direct me to some resource to understand this. May be some proper documentation, tutorials or anything that i can understand this. And since i'm interested in emulator if i change the code of emulator with in "external\qemu" , then build it using "m emulator" and run using "emulator" , will those changes effect or apply onto the started emulator. And if anyone know please let me know that, what is the sdk it uses when it run as "emulator" from the build android source code. Cos if i want to install some application to that emulator how can i do that? Please help if anyone know...

    Read the article

  • Bug in the official Android Fragments training sample?

    - by Jeff Axelrod
    It seems to me that there must be a bug in the Android Fragments demo. As background, Fragments are apparently sometimes instantiated by the Android OS and thus need a public no-arg constructor: All subclasses of Fragment must include a public empty constructor. The framework will often re-instantiate a fragment class when needed, in particular during state restore, and needs to be able to find this constructor to instantiate it. If the empty constructor is not available, a runtime exception will occur in some cases during state restore. But the NewsReader demo from the official Android training on Fragments constructs the HeadlinesFragment class and configures it with setOnHeadlineSelectedListener(this) from NewsReaderActivity.onCreate(). If the Android OS re-instantiates this fragment, the mHeadlineSelectedListener field will be null because HeadlinesFragment doesn't save or restore its state. Is this a bug or am I missing something?

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >