Search Results

Search found 25798 results on 1032 pages for 'android xml'.

Page 69/1032 | < Previous Page | 65 66 67 68 69 70 71 72 73 74 75 76  | Next Page >

  • swf listens to XML, AS3

    - by VideoDnd
    My swf listens to XML from a socket and document. How do I get 'my variables' to grab XML from the socket instead of the XML document? PURPOSE My purpose is to control variables with a XML Socket Server. I hope my question is clear, but ask if there's any questions. EXAMPLE Flash File import flash.net.*; import flash.display.*; import flash.events.*; import flash.system.Security; import flash.utils.Timer; import flash.events.TimerEvent; //MY VARIABLES, LINE 8-12 var timer:Timer = new Timer(10); var myString:String = ""; var count:int = 0; var myStg:String = ""; var fcount:int = 0; var xml_s=new XMLSocket(); xml_s.addEventListener(Event.CONNECT, socket_event_catcher);//OnConnect// xml_s.addEventListener(Event.CLOSE, socket_event_catcher);//OnDisconnect// xml_s.addEventListener(IOErrorEvent.IO_ERROR, socket_event_catcher);//Unable To Connect// xml_s.addEventListener(DataEvent.DATA, socket_event_catcher);//OnDisconnect// xml_s.connect("localhost", 1999); function socket_event_catcher(Event):void { switch (Event.type) { case 'ioError' : trace("ioError: " + Event.text);//Unable to Connect :(// break; case 'connect' : trace("Connection Established!");//Connected :)// break; case 'data' : trace("Received Data: " + Event.data); //var myXML:XML=new XML(Event.data); //trace("myXML.body.file: " + myXML.body.file); //var myLoader:String=myXML.body.file; //var urlReq:URLRequest=new URLRequest(myLoader); //trace("file to load URL: " + urlReq); break; case 'close' : trace("Connection Closed!");//OnDisconnect :( // xml_s.close(); break; } } //LOAD XML var myXML:XML; var myLoader:URLLoader = new URLLoader(); myLoader.load(new URLRequest("time.xml")); myLoader.addEventListener(Event.COMPLETE, processXML); //var myXML:XML=new XML(Event.data); //trace("myXML.body.file: " + myXML.body.file); //var DOINK:String=myXML.body.file; //var urlReq:URLRequest=new URLRequest(DOINK); //trace("file to load URL: " + urlReq); //PARSE XML function processXML(e:Event):void { myXML = new XML(e.target.data); trace(myXML.COUNT.text()); //-77777 //grab the data as a string myString = myXML.COUNT.text() //grab the data as an int count = int(myXML.COUNT.text()); //grab the data as a string myString = myXML.COUNT.text() //grab the data as an int count = int(myXML.COUNT.text()); //grab the data as a string myStg = myXML.COUNT.text() //grab the data as an int fcount = int(myXML.COUNT.text()); //grab the data as a string myStg = myXML.COUNT.text() //grab the data as an int fcount = int(myXML.COUNT.text()); trace("String: ", myString); trace("Int: ", count); trace(count - 1); //just to show you that it's a number that you can do math with (-77778) //TEXT var text:TextField = new TextField(); text.text = myString; addChild(text); } Ruby Server 'Snippet' msg1 = {"msg" => {"head" => {"type" => "frctl", "seq_no" => seq_no, "version" => 1.0}, "SESSION" => {"text" => "88888", "timer" => -1000, "count" => 10, "fcount" => "10"}}} XML <?xml version="1.0" encoding="utf-8"?> <SESSION> <TIMER TITLE="speed">100</TIMER> <COUNT TITLE="starting position">88888</COUNT> <FCOUNT TITLE="ramp">1000</FCOUNT> </SESSION> ENVIROMENT AS3 Ruby 186-25 PROBLEM Coding errors "coercion of value"

    Read the article

  • How to toggle orientation lock in android?

    - by pixel
    I want to create checkbox in my preference Activity that allows user to toggle orientation change. In similar questions people write only about complete orientation lock (by overriding onConfigurationChanged method or adding configChanges in AndroidManifest.xml) or orientation enforcing ( by setRequestedOrientation ). Is there a way to toggle orientation lock?

    Read the article

  • How to manage orientation lock in android?

    - by pixel
    I want to create checkbox in my preference Activity that allows user to toggle orientation change. In similar questions people write only about complete orientation lock (by overriding onConfigurationChanged method or adding configChanges in AndroidManifest.xml) or orientation enforcing ( by setRequestedOrientation ). Is there a way to toggle orientation lock?

    Read the article

  • Providing unique layout for specific resolution in Android 2.3.3

    - by user1384991
    I need to use specific xml-layouts based on screen resolution, not size. So, the first design is used for resolution <= 480x800, and the second - for resolution = 480x800. How is it done ? update. Possible solution: Display display = ((WindowManager) getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay(); final int height = display.getHeight(); final int width = display.getWidth();

    Read the article

  • Android reset activity component state on navigation back

    - by Aure77
    I have 2 activities in my application. In activity1, I set some configuration and I modify the state of some component (ex: set button state disabled). And I navigate to activity2. In activity2 I do some stuff and at end, I finish this activity and come back to activity1. But In activity1, my components state are the same when I leave this activity. How to reset the components state with valuesdeclared in XML file (layout) ?

    Read the article

  • Is there a better way to refresh WebView?

    - by cdg
    Hi all. Ok. I have looked EVERYWHERE and my little brain just can't understand a better way to refresh an activity. Any suggestions that I can understand would be great. :) Here is the java code: package com.dge.dges; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.webkit.WebView; import android.widget.Button; public class dgeActivity extends Activity { WebView mWebView; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); mWebView = (WebView) findViewById(R.id.webview); mWebView.getSettings(); mWebView.loadUrl("http://www.websitehere.php"); Button newButton = (Button)findViewById(R.id.new_button); newButton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { Intent intent = new Intent(dgeActivity.this, dgeActivity.class); startActivity(intent); } }); } } And here is the main.xml <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/RelativeLayout" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#000000" > <WebView android:id="@+id/webview" android:layout_width="fill_parent" android:layout_height="wrap_content" android:scrollbars="none" /> <Button android:id="@+id/new_button" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" android:text="Refresh" /> </RelativeLayout> I don't like the idea of just re-stacking activity after activity. There has to be an easier way to refresh the webview. Please help. :)

    Read the article

  • TableLayout formatting loss after device rotation

    - by roundhill
    I'm seeing a strange issue with a TableLayout after the device is rotated from either orientation. If you load the view in either portrait or landscape mode, the table loads fine. But once you rotate the device, the columns collapse to just fit their width. I would expect that after rotation, the columns would still stretch to fit the width of the screen. Any ideas on what can be done to resolve this? Screenies and layout code below. Before Rotation: After Rotation: Table Layout: <TableLayout android:id="@+id/dataTable" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" android:layout_below="@id/chart" android:stretchColumns="*" android:shrinkColumns="*" android:padding="6dip" > </TableLayout> Table Row: <TableRow xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TextView android:id="@+id/col1" android:layout_marginRight="2dip" android:textColorLink="#FF21759b" android:text="Column 1" android:padding="4dip" android:textColor="#FF464646"/> <TextView android:id="@+id/col2" android:text="Column 2" android:textColor="#FF464646" android:padding="4dip"/> </TableRow> Thanks!

    Read the article

  • Display contact pictures in list view

    - by user1068400
    I need to display the contact pictures in a list view. In my custom_row_view.xml I have: <ImageView android:id="@+id/contact_image" android:layout_width="60dp" android:layout_height="50dp" /> and then in my activity i have: final SimpleAdapter adapter = new SimpleAdapter( this, list, R.layout.custom_row_view, new String[] {"avatar","telnumber","date","name","message","sent"}, new int[] {R.id.contact_image,R.id.text1,R.id.text2,R.id.text3,R.id.text4,R.id.isent} ); I have a hashmap HashMap temp2 = new HashMap(); where i put all the values of each line. ("list" is a list of Hashmap) But when I do: Cursor photo2 = managedQuery( Data.CONTENT_URI, new String[] {Photo.PHOTO}, // column for the blob Data._ID + "=?", // select row by id new String[]{photoid}, // filter by photoId null); Bitmap photoBitmap = null; if(photo2.moveToFirst()) { byte[] photoBlob = photo2.getBlob(photo2.getColumnIndex(Photo.PHOTO)); photoBitmap = BitmapFactory.decodeByteArray(photoBlob, 0, photoBlob.length); if (photoBitmap != null) temp2.put("avatar",photoBitmap); else temp2.put("avatar",R.drawable.unknowncontact); } photo2.close(); Nothing is displayed! "temp2.put("avatar",photoBitmap);" does not display anything but when I try to display something from the drawable folder it works!!! Please help me, i have been locked on this problem for several days! Thanks a lot!

    Read the article

  • ListView exception for Images + Text

    - by drozzy
    I am trying to create a simple Icon+Text ListView but it does not work. I am using 2.1 Android SDK. My main class is very small slightly modified from the tutorial: public class Stuffs extends ListActivity { static final String[] COUNTRIES = new String[] {"A", "B","C"}; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setListAdapter(new ArrayAdapter<String>(this, R.layout.list_item, R.id.title, COUNTRIES)); } } and my list_item.xml file is this: <?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" android:orientation = "horizontal"> <ImageView android:id = "@+id/icon" android:src="@drawable/icon" /> <TextView android:id = "@+id/title" android:padding="10dp" android:textSize="16sp" > </TextView> </LinearLayout> I have also created a "drawable" directory in my res directory and copied a "icon.png" into it. But any time I try to run this the application hangs up unexpected in my android emulator. Am I missing something?

    Read the article

  • 2D Rendering with OpenGL ES 2.0 on Android (matrices not working)

    - by TranquilMarmot
    So I'm trying to render two moving quads, each at different locations. My shaders are as simple as possible (vertices are only transformed by the modelview-projection matrix, there's only one color). Whenever I try and render something, I only end up with slivers of color! I've only done work with 3D rendering in OpenGL before so I'm having issues with 2D stuff. Here's my basic rendering loop, simplified a bit (I'm using the Matrix manipulation methods provided by android.opengl.Matrix and program is a custom class I created that just calls GLES20.glUniformMatrix4fv()): Matrix.orthoM(projection, 0, 0, windowWidth, 0, windowHeight, -1, 1); program.setUniformMatrix4f("Projection", projection); At this point, I render the quads (this is repeated for each quad): Matrix.setIdentityM(modelview, 0); Matrix.translateM(modelview, 0, quadX, quadY, 0); program.setUniformMatrix4f("ModelView", modelview); quad.render(); // calls glDrawArrays and all I see is a sliver of the color each quad is! I'm at my wits end here, I've tried everything I can think of and I'm at the point where I'm screaming at my computer and tossing phones across the room. Anybody got any pointers? Am I using ortho wrong? I'm 100% sure I'm rendering everything at a Z value of 0. I tried using frustumM instead of orthoM, which made it so that I could see the quads but they would get totally skewed whenever they got moved, which makes sense if I correctly understand the way frustum works (it's more for 3D rendering, anyway). If it makes any difference, I defined my viewport with GLES20.glViewport(0, 0, windowWidth, windowHeight); Where windowWidth and windowHeight are the same values that are pased to orthoM It might be worth noting that the android.opengl.Matrix methods take in an offset as the second parameter so that multiple matrices can be shoved into one array, so that'w what the first 0 is for For reference, here's my vertex shader code: uniform mat4 ModelView; uniform mat4 Projection; attribute vec4 vPosition; void main() { mat4 mvp = Projection * ModelView; gl_Position = vPosition * mvp; } I tried swapping Projection * ModelView with ModelView * Projection but now I just get some really funky looking shapes... EDIT Okay, I finally figured it out! (Note: Since I'm new here (longtime lurker!) I can't answer my own question for a few hours, so as soon as I can I'll move this into an actual answer to the question) I changed Matrix.orthoM(projection, 0, 0, windowWidth, 0, windowHeight, -1, 1); to float ratio = windowWwidth / windowHeight; Matrix.orthoM(projection, 0, 0, ratio, 0, 1, -1, 1); I then had to scale my projection matrix to make it a lot smaller with Matrix.scaleM(projection, 0, 0.05f, 0.05f, 1.0f);. I then added an offset to the modelview translations to simulate a camera so that I could center on my action (so Matrix.translateM(modelview, 0, quadX, quadY, 0); was changed to Matrix.translateM(modelview, 0, quadX + camX, quadY + camY, 0);) Thanks for the help, all!

    Read the article

  • Streaming Audio over UDP to Android

    - by Mr. Pig
    Is it possible to have Android (perhaps via MediaPlayer or a different existing class) accept media streams over UDP? I've successfully had MediaPlayer connect to an HTTP stream (as well as static files hosted on an HTTP server) but I'm wondering how one would go about accepting a stream from a UDP source. I've seen this and suppose a solution similar to that (where I download the stream via an independent UDP socket and then move the data to a MemoryBuffer that I then pass to MediaPlayer) is an option but I'm curious if a method already exists in the SDK, and if it does not, what other options do I have? Thanks

    Read the article

  • Android GLSurfaceView glTexImage2D glDrawTexiOES

    - by Cinar
    I'm trying to render a 640x480 RGB565 image using OpenGL ES on Android using GLSurfaceView and Native C code. Initially I had a 0x0501 error with glTexImage2D, which I was able to resolve by changing the image dimensions. But now, in the "drawFrame" call, when I do glDrawTexiOES to resnder the texture, I'm getting the following error on the Logs: drawtex.c:89: DrawTexture: No textures enabled I'm already doing glEnable(GL_TEXTURE_2D), is there anything else I should do? Is there a complete example showing GLSurfaceView with native code using textures? Thanks in advance!

    Read the article

  • Android File Picker

    - by GuyNoir
    Is there a good solution for picking a file in an android application? I need the user to be able to browse their SD card for a file they would like to load. However, it cannot use an outside application (like andExplorer). It must stay contained inside my application. I saw one a while ago that's hosted on google code and used by the Gameboid, SNESoid and other similar emulators to pick roms. If any one can point me to that one that'd be just as great. Thanks!

    Read the article

  • How To debug Android app on Emulator using NetBeans IDE

    - by tobrien
    I recently downloaded the latest NetBeans IDE (for MACOSX) and imported/migrated a project over from the ECLIPSE environment. Everything looks, and works well... except that EMULATOR gets stuck "waiting for the debugger to attach." I tried "Attaching Debugger..." and set the PORT value to every case I've ever read about (8200, 8700, 5555, etc.) but the connection is refused. I am of the opinion that this is not the preferred way to start a debugging session in NetBeans for Android. What am I missing?

    Read the article

  • Android 2.2 deprecates restartPackage but adds another headache...

    - by mob1lejunkie
    Android 2.2 release notes have just been released. ActivityManager.restartPackage method has been deprecated and the description is: the previous behavior here is no longer available to applications because it allows them to break other applications by removing their alarms, stopping their services, etc. Instead 2.2 has given another tool for pesky "task killer" apps by introducing new ActivityManager.killBackgroundProcesses method. More Info Can someone explain whether ActivityManager.killBackgroundProcesses will kill our scheduled alarms? If so, deprecating ActivityManager.restartPackage was pointless as "task killer" will now abuse ActivityManager.killBackgroundProcesses.

    Read the article

  • Android - phone number contact format

    - by Daniel Benedykt
    Hi In Android I can get phone numbers of all the contacts without any problem. Tha problem is that for most users some numbers are stored as 'local' numbers, meaning that they dont have the country code included. For example, if the user lives in US and he has 2 contacts: 1) John - 555-123-1234 (local) (starting 1 not showing) 2) Jane - 44-123456787 (england phone number) The question is: How do I get all the numbers in an international format, when some of the numbers doesnt include the country code? Any way to figure that out? Thanks

    Read the article

  • Android ConnectivityManager information

    - by Mike
    I am trying to get a better grip on Android's ConnectivityManager and how it really works under the hood. Using the API is simple enough but I am looking for something lower level such as when it starts and the dirty details of what its doing in the background. I can't seem to find a good resource about it. Everything is just about using the API. Does anyone understand this or have any resources that they could point me to, website, book, white paper, or otherwise? I would really appreciate it. Thanks

    Read the article

  • Bug Running Android Tutorial HelloTabWidget under SDK 1.5: "setCurrentTag(getIntent())"

    - by Matt J.
    does not compile. Indeed: even in 1.5, this api, getIntent(), is already listed as deprecated. The error message I get complains that getIntent() does not return a String, but setCurrentTab() expects a string. If I guess and change the line to read: "tabHost.setCurrentTab(1); // was setCurrentTab(getIntent())", then it compiles, builds, but does not run. I get the "stopped unexpectedly" error message from the emulator. I cannot even get Log.d to output, so it seems that it stops 'unexpectedly' very early. So the first and main question is: what is the correct fix to "tabHost.setCurrentTab(getIntent())" in the final line of OnCreate() in http://developer.android.com/resources/tutorials/views/hello-tabwidget.html? The second and simpler question is: did I guess right in replacing 'mTabHost' with tabHost in the one place where that occurs?

    Read the article

  • Newbie Android question

    - by DanyW
    Hi folks, I have just started with Android with the usual Hello World project template in Eclipse. I modified the layout XML and removed the label that says "Hello World, !", and added a couple of other controls. However, these are not reflected in the app, within the emulator. When I run this app from Eclipse again it is still showing the Hello World label! I'm sure it's something terribly simple that I have completely missed. Can someone please point me in the right direction? Many thanks, Dany.

    Read the article

  • Android AVD error after update to 2.3

    - by outcast
    (ubuntu8.0.4+eclipse3.6.1+ADT8.0.1) I update android from(1.5+1.6+2.1+2.2) to 2.3,but I got 1:/home/workaccount/Android/android-sdk-linux_86//tools/emulator: /lib/tls/i686/cmov/libc.so.6: version GLIBC_2.8' not found (required by /home/workaccount/Android/android-sdk-linux_86//tools/emulator) 2:/home/workaccount/Android/android-sdk-linux_86//tools/emulator: /lib/tls/i686/cmov/libc.so.6: versionGLIBC_2.11' not found (required by /home/workaccount/Android/android-sdk-linux_86//tools/emulator) when I start an AVD. All versions can't work now. I delete everything expect eclipse,download adt, AndroidSDK, platform2.3/2.2 ,still error. Heeeelp!!!

    Read the article

  • remove notification bar shadow in android app

    - by defrex
    In android, the notification bar at the top has a shadow most of the time. However, sometimes, such as when an app has it's title-bar showing, or in some other cases (such as in the twitter app or the market) that shadow effect is gone. My guess is that the shadow is supposed to be there when the content underneath can scroll. In my app, however, the content underneath can't scroll, and I think the shadow looks bad on the top part of my logo. Does anyone know how to disable it?

    Read the article

  • How to delete a contact in android 2.1

    - by Rishabh
    Hi, I have added one contact to android by following code. ContentValues values = new ContentValues(); Uri rawContactUri = getContentResolver().insert(RawContacts.CONTENT_URI, values); long rawContactId = ContentUris.parseId(rawContactUri); values.clear(); values.put(Data.RAW_CONTACT_ID, rawContactId); values.put(Data.MIMETYPE, StructuredName.CONTENT_ITEM_TYPE); values.put(StructuredName.DISPLAY_NAME, "Mike Sullivan"); getContentResolver().insert(Data.CONTENT_URI, values); It shows up on emulator 2.1, but when i am going to delete it manually by "delete contact" option, its not deleteing from emulator. If I edit some thing on it then only it deletes. How can i directly delete it from menu ? Thanks in advance...

    Read the article

  • Displaying Calendar in an Android App

    - by Rony
    Hi experts, I would be obliged if someone could provide me a solution as to which component to be used so that, I can display a fairly good looking calender in my android application. I kept browsing for a solution for the past two days, but unfortunately could not find a solution. Since, this is a very basic requisite, I am sure that, there will be a perfect solution for this. Please help with suggestions, comments and solutions. ANy help in this regard is well appreciated. Looking forward, Regards, Rony

    Read the article

  • Does android support playlists for video files?

    - by DanJ
    I'm and android beginner, so go easy on me ;-) I'm trying to play a sequence of video files which I'm downloading from a server. The challenge is that I want to have a smooth transition from one file to another. My thought is to have two MediaPlayer instances each preparing and then playing in turn. It is not clear to me if they can both share the same SurfaceView? Or maybe, I should be using different views and swapping between them? Or, the idea is a bad idea all together? When I try to run configure the MediaPlayer instance with a view that isn't visible it seems to crash my emulator.

    Read the article

  • Android Keep Activity from Dieing

    - by GuyNoir
    The main Activity I use in my Android application uses a fair amount of memory, meaning that on a less powerful phone, it is susceptible to being killed off when not at the front. Normally this is fine, but it also happens when I am still inside my application, but have a different activity at the top of the stack (such as a preference activity). Obviously it's a problem if my application is killed while the user is still running it. Is there any way to disable the OS's ability to kill off the application for low memory problems? Thanks.

    Read the article

< Previous Page | 65 66 67 68 69 70 71 72 73 74 75 76  | Next Page >