Search Results

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

Page 62/1032 | < Previous Page | 58 59 60 61 62 63 64 65 66 67 68 69  | Next Page >

  • android, find the nearest location without going through all the locations

    - by Marwan
    I am building a taxi dispatching app first: I need the passenger app to show the nearest taxis, now I know how to do that in code but in my way I have to go through all the taxis locations(in database on server) and calculate the distance from the passenger location and get the lowest ones - I don't want to do this because there will be a lot of taxis and going through all of them and making some math is kind of pain on the server- is there a way to get the nearest ones without going through all of them? second: what the best database to use - first, should it be sql or non-sql - I need a very robust database, because there will be a lot of updates (I mean the passengers locations added then deleted when arriving to destination && the taxis location changes frequently) finally: I will use RubyOnRails to do the server side and json as data transfer format, do you have a recommendation to me on something better? Thanks

    Read the article

  • Android remote code loading

    - by sehugg
    I am developing a library for Android that requires frequent updates from a central server. I was thinking how nice it would be if my library could update itself -- or if I could just release a bootstrap library that downloads the target library when the app is installed. I see this class in 1.5 called "DexClassLoader" but there seems to be precious little on the web besides the API docs. Has anyone used this successfully for the scenario which I described? Also, do the terms of the Android Market permit such a thing?

    Read the article

  • Gen folder disappearing in Eclipse Android project

    - by Adam Haile
    I'm just getting started developing for Android and I'm running into a weird problem. First off, I'm running Eclipse for Java devs v3.5.2 with the Android 2.1 SDK installed. Basically, whenever I do just about anything the "gen" (R.java, etc.) folder will just disappear from the project. I'm seen some people online say that it was still on the drive, just gone from the project listing in Eclipse, but in my case it is literally and completely gone. The only fix I've found is that if I refresh, then try to build, it gives an error and "gen" shows up in the project view (though it's not on the disk), then delete it from within the project, then Rebuild All and it will say that it cannot find it and is recreating it. Problem is, I have to do this every single time I want to build. There's got to be a fix for this.

    Read the article

  • image on top of button android

    - by N-AccessDev
    Is it possible to add an image(view) on top of a button (which as a background image)? I'm porting an iOS app to Android and it wasn't a problem on iOS, but I'm wondering if it is the right approach on Android because of layouts. Edit : To clarify, check this screen shot : http://a4.mzstatic.com/us/r1000/062/Purple/v4/7c/4b/cd/7c4bcd53-ba55-94d7-a26c-ce1bfe040003/mza_2736801523527387264.320x480-75.jpg I need to do the bottom left button "carte" (card in french) I need : a button with a background image an image displayed on top of the button which is loaded from internet (a card , there is a lot of different and news cards are added daily, in the screnshot it s "MIDI PASS" ) a text localised on the button , so I cant use Imagebutton class.

    Read the article

  • Android how to display and image from URL

    - by Patrick
    Hi all! I'm having trouble displaying SOME images on my android app. Just normal display image from certain URL. Some images works, some just doesn't work. For instance try displaying this image from URL: http://img191.imageshack.us/img191/7379/tronlegacys7i7wsjf.jpg It doesn't work. Doesn't even work in emulator. Could it be the EXIF info for the image is problematic? Can anyone try to see they are able to display that image on android app, and share the code/method to display that image on screen? Thank you!

    Read the article

  • Application not showing up in Google Play for 4.x devices

    - by Zargle
    I recently posted about the Play store not letting me publish my app without a minSdkVersion, but whenever I set it to anything above "1" my app just doesn't work (minSdkVersion breaking program). So this guy suggested to just set my minSdkVersion to 1, which worked. But now when I submitted my app even though the developer site says: API level: 1-16+ Supported screens: normal-xlarge OpenGL textures: all But the app only shows it supports Android under 4.x, I developed it on my 4.0.4 device. I tried searching around and I found that some people have problems with services messing up the phones it supports, so I deleted all of my services, because I don't really need any for this version of the app to submit. And it still didn't work. So I don't know what else to do, here is my AndroidManifest.xml if it helps... I've been trying to figure out why my application isn't working for a week now, still nothing. I have tried setting a targetSdkVersion to something like 14, my application still breaks. I cleaned out my code, taking everything out of the already short, 200 lines, application, and it still isn't working. Is there something I can't use in an android application 4.0 that I am using in my application? or is it just my AndroidManifest? Thank you so much! <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.unparalleledsoftware.app.list" android:versionCode="5" android:versionName="2.02" > <uses-sdk android:minSdkVersion="1" /> <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name=".MainActivity" android:label="@string/title_activity_main" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> I should note,I am using the Theme.Holo.Light, but even if I change it to DeviceDefault it doesn't work. Edit: I googled the app on my friends Samsung Galaxy S3 (it didn't show up in the Play Store on his phone), when I installed by googling the app and hitting the "install" button on google and it opened in the Google Play store and was able to install. When I did the same on my phone, Galaxy Note, it opened in the Google Play Store, but then said "Not compatible." Why? They are both on the same version of OS. Why is mine not compatible, nor the One X compatible, but the Samsung Galaxy S3 worked...? Edit: I get these errors/problems when compiling with a targetSdkVersion, http://pastebin.com/mxgWNLdM

    Read the article

  • android - Caused by: android.view.ViewRootImpl$CalledFromWrongThreadException

    - by chinna_82
    Im trying to get image from my URL and display in application but it throw error Caused by: android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views. Below is my code Code package com.smartag.bird.dev; public class MainActivity extends Activity { static String ndefMsg = null; static String ndefMsg1 = null; NfcAdapter mNfcAdapter; PendingIntent mNfcPendingIntent; IntentFilter[] mNdefExchangeFilters; static final String TAG = "Read Tag"; TextView mTitle; private static ImageView imageView; static String url = "http://sposter.smartag.my/images/chicken_soup.jpg"; private static Bitmap downloadBitmap; private static BitmapDrawable bitmapDrawable; private static boolean largerImg = false; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //setContentView(R.layout.main); mNfcAdapter = NfcAdapter.getDefaultAdapter(this); mNfcPendingIntent = PendingIntent.getActivity(this, 0, new Intent(this, getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP), 0); IntentFilter ndefDetected = new IntentFilter(NfcAdapter.ACTION_NDEF_DISCOVERED); try { ndefDetected.addDataType("text/plain"); } catch (MalformedMimeTypeException e) { } mNdefExchangeFilters = new IntentFilter[] { ndefDetected }; if (NfcAdapter.ACTION_NDEF_DISCOVERED.equals(getIntent().getAction())) { NdefMessage[] messages = getNdefMessages(getIntent()); byte[] payload = messages[0].getRecords()[0].getPayload(); ndefMsg = new String(payload); setIntent(new Intent()); // Consume this intent. } ConnectivityManager connManager = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE); NetworkInfo mWifi = connManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI); if(ndefMsg == null || ndefMsg.length() == 0) { startActivity(new Intent(MainActivity.this, MainMenu.class)); } else { setContentView(R.layout.main); if (mWifi.isConnected()) { ndefMsg1 = ndefMsg; new DownloadFilesTask().execute(); ndefMsg = null; } else { AlertDialog.Builder dialog = new AlertDialog.Builder(this); dialog.setTitle("Attention"); dialog.setMessage("No Internet Connection. Please enable the wifi."); dialog.setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { } }); dialog.show(); } } } private class DownloadFilesTask extends AsyncTask<Void, Void, Void> { protected void onPostExecute(Void result) { } @Override protected Void doInBackground(Void... params) { try { URL myFileUrl = new URL("http://sposter.smartag.my/images/chicken_soup.jpg"); HttpURLConnection conn= (HttpURLConnection)myFileUrl.openConnection(); conn.setDoInput(true); conn.connect(); InputStream is = conn.getInputStream(); downloadBitmap = BitmapFactory.decodeStream(is); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } ImageView image = (ImageView) findViewById(R.id.imview); image.setImageBitmap(downloadBitmap); return null; } } }

    Read the article

  • Understanding MotionEvent to implement a virtual DPad and Buttons on Android (Multitouch)

    - by Fabio Gomes
    I once implemented a DPad in XNA and now I'm trying to port it to android, put, I still don't get how the touch events work in android, the more I read the more confused I get. Here is the code I wrote so far, it works, but guess that it will only handle one touch point. public boolean onTouchEvent(MotionEvent event) { if (event.getPointerCount() == 0) return true; int touchX = -1; int touchY = -1; pressedDirection = DPadDirection.None; int actionCode = event.getAction() & MotionEvent.ACTION_MASK; if (actionCode == MotionEvent.ACTION_UP) { if (event.getPointerId(0) == idDPad) { pressedDirection = DPadDirection.None; idDPad = -1; } } else if (actionCode == MotionEvent.ACTION_DOWN || actionCode == MotionEvent.ACTION_MOVE) { touchX = (int)event.getX(); touchY = (int)event.getY(); if (rightRect.contains(touchX, touchY)) pressedDirection = DPadDirection.Right; else if (leftRect.contains(touchX, touchY)) pressedDirection = DPadDirection.Left; else if (upRect.contains(touchX, touchY)) pressedDirection = DPadDirection.Up; else if (downRect.contains(touchX, touchY)) pressedDirection = DPadDirection.Down; if (pressedDirection != DPadDirection.None) idDPad = event.getPointerId(0); } return true; } The logic is: Test if there is a "DOWN" or "MOVED" event, then if one of this events collides with one of the 4 rectangles of my DPad, I set the pressedDirectin variable to the side of the touch event, then I read the DPad actual pressed direction in my Update() event on another class. The thing I'm not sure, is how do I get track of the touch points, I store the ID of the touch point which generated the diretion that is being stored (last one), so when this ID is released I set the Direction to None, but I'm really confused about how to handle this in android, here is the code I had in XNA: public override void Update(GameTime gameTime) { PressedDirection = DpadDirection.None; foreach (TouchLocation _touchLocation in TouchPanel.GetState()) { if (_touchLocation.State == TouchLocationState.Released) { if (_touchLocation.Id == _idDPad) { PressedDirection = DpadDirection.None; _idDPad = -1; } } else if (_touchLocation.State == TouchLocationState.Pressed || _touchLocation.State == TouchLocationState.Moved) { _intersectRect.X = (int)_touchLocation.Position.X; _intersectRect.Y = (int)_touchLocation.Position.Y; _intersectRect.Width = 1; _intersectRect.Height = 1; if (_intersectRect.Intersects(_rightRect)) PressedDirection = DpadDirection.Right; else if (_intersectRect.Intersects(_leftRect)) PressedDirection = DpadDirection.Left; else if (_intersectRect.Intersects(_upRect)) PressedDirection = DpadDirection.Up; else if (_intersectRect.Intersects(_downRect)) PressedDirection = DpadDirection.Down; if (PressedDirection != DpadDirection.None) { _idDPad = _touchLocation.Id; continue; } } } base.Update(gameTime); } So, first of all: Am I doing this correctly? if not, why? I don't want my DPad to handle multiple directions, but I still didn't get how to handle the multiple touch points, is the event called for every touch point, or all touch points comes in a single call? I still don't get it.

    Read the article

  • SQLAuthority News – Android Efficiency Tips and Tricks – Personal Technology Tip #003

    - by pinaldave
    I use my phone for lots of things.  I use it mainly to replace my tablet – I can e-mail, take and edit photos, and do almost everything I can do on a laptop with this phone.  And I am sure that there are many of you out there just like me.  I personally have a Galaxy S3, which uses the Android operating system, and I have decided to feature it as the third installment of my Technology Tips and Tricks series. 1) Shortcut to your favorite contacts on home screen Access your most-called contacts easily from your home screen by holding your finger on any empty spot on the home screen.  A menu will pop up that allows you to choose Shortcuts, and Contact.  You can scroll through your contact list and then just tap on the name of the person you want to be able to dial with a single click. 2) Keep track of your data usage Yes, we all should keep a close eye on our data usage, because it is very easy to go over our limits and then end up with a giant bill at the end of the month.  Never get surprised when you open that mobile phone envelope again.  Go to Settings, then Data Usage, and you can find a quick rundown of your usage, how much data each app uses, and you can even set alarms to let you know when you are nearing the limits.   Better yet, you can set the phone to stop using data when it reaches a certain limit. 3) Bring back Good Grammar We often hear proclamations about the downfall of written language, and how texting abbreviations, misspellings, and lack of punctuation are the root of all evil.  Well, we can show all those doomsdayers that all is not lost by bringing punctuation back to texting.  Usually we leave it off when we text because it takes too long to get to the screen with all the punctuation options.  But now you can hold down the period (or “full stop”) button and a list of all the commonly-used punctuation marks will pop right up. 4) Apps, Apps, Apps and Apps And finally, I cannot end an article about smart phones without including a list of my favorite apps.  Here are a list of my Top 10 Applications on my Android (not counting social media apps). Advanced Task Killer – Keeps my phone snappy by closing un-necessary apps WhatsApp - my favorite alternate to Text SMS Flipboard - my ‘timepass’ moments Skype – keeps me close to friends and family GoogleMaps - I am never lost because of this one thing Amazon Kindle – Books my best friends DropBox - My data always safe Pluralsight Player – Learning never stops for me Samsung Kies Air – Connecting Phone to Computer Chrome – Replacing default browser I have not included any social media applications in the above list, but you can be sure that I am linked to Twitter, Facebook, Google+, LinkedIn, and YouTube. Reference: Pinal Dave (http://blog.SQLAuthority.com)   Filed under: Best Practices, PostADay, SQL, SQL Authority, SQL Query, SQL Server, SQL Tips and Tricks, SQLAuthority News, T SQL, Technology Tagged: Android, Personal Technology

    Read the article

  • SQLAuthority News – Android Efficiency Tips and Tricks – Personal Technology Tip

    - by pinaldave
    I use my phone for lots of things.  I use it mainly to replace my tablet – I can e-mail, take and edit photos, and do almost everything I can do on a laptop with this phone.  And I am sure that there are many of you out there just like me.  I personally have a Galaxy S3, which uses the Android operating system, and I have decided to feature it as the third installment of my Technology Tips and Tricks series. 1) Shortcut to your favorite contacts on home screen Access your most-called contacts easily from your home screen by holding your finger on any empty spot on the home screen.  A menu will pop up that allows you to choose Shortcuts, and Contact.  You can scroll through your contact list and then just tap on the name of the person you want to be able to dial with a single click. 2) Keep track of your data usage Yes, we all should keep a close eye on our data usage, because it is very easy to go over our limits and then end up with a giant bill at the end of the month.  Never get surprised when you open that mobile phone envelope again.  Go to Settings, then Data Usage, and you can find a quick rundown of your usage, how much data each app uses, and you can even set alarms to let you know when you are nearing the limits.   Better yet, you can set the phone to stop using data when it reaches a certain limit. 3) Bring back Good Grammar We often hear proclamations about the downfall of written language, and how texting abbreviations, misspellings, and lack of punctuation are the root of all evil.  Well, we can show all those doomsdayers that all is not lost by bringing punctuation back to texting.  Usually we leave it off when we text because it takes too long to get to the screen with all the punctuation options.  But now you can hold down the period (or “full stop”) button and a list of all the commonly-used punctuation marks will pop right up. 4) Apps, Apps, Apps and Apps And finally, I cannot end an article about smart phones without including a list of my favorite apps.  Here are a list of my Top 10 Applications on my Android (not counting social media apps). Advanced Task Killer – Keeps my phone snappy by closing un-necessary apps WhatsApp - my favorite alternate to Text SMS Flipboard - my ‘timepass’ moments Skype – keeps me close to friends and family GoogleMaps - I am never lost because of this one thing Amazon Kindle – Books my best friends DropBox - My data always safe Pluralsight Player – Learning never stops for me Samsung Kies Air – Connecting Phone to Computer Chrome – Replacing default browser I have not included any social media applications in the above list, but you can be sure that I am linked to Twitter, Facebook, Google+, LinkedIn, and YouTube. Reference: Pinal Dave (http://blog.SQLAuthority.com)   Filed under: Best Practices, PostADay, SQL, SQL Authority, SQL Query, SQL Server, SQL Tips and Tricks, SQLAuthority News, T SQL, Technology Tagged: Android, Personal Technology

    Read the article

  • can anyone help me through the preparation of Eclipse IDE for android developer in ubuntu 12.04?

    - by csbl
    I'm new to to Linux, in this particular case, to Ubuntu. I have a small android project I have to finnish until this Friday and I'm still stuck with the install and preparing of the development envrironment. The only thing I did was install the Eclipse IDE. I'm still missing the SDK, JAVA and anything else that might be needed. Can someone help me through this? It's only because I'm running out of time to develop, or else I would embarc on a deeper investigation of this OS. I tried the step to install android platforms, through Eclispe-Help-Install New Software, and I got the follwoing error messages, at the end of the process: [2012-06-06 17:35:56 - adb] /home/catia/android-sdks/platform-tools/adb: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory [2012-06-06 17:35:56 - adb] 'adb version' failed! /home/catia/android-sdks/platform-tools/adb: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory [2012-06-06 17:35:56 - adb] Failed to parse the output of 'adb version': Standard Output was: Error Output was: /home/catia/android-sdks/platform-tools/adb: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory [2012-06-06 17:35:56 - adb] /home/catia/android-sdks/platform-tools/adb: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory [2012-06-06 17:35:56 - adb] 'adb version' failed! /home/catia/android-sdks/platform-tools/adb: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory [2012-06-06 17:35:56 - adb] Failed to parse the output of 'adb version': Standard Output was: Error Output was: /home/catia/android-sdks/platform-tools/adb: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory Can anyone help, please??

    Read the article

  • Implementing a listview inside a sliding drawer with a listview already present

    - by Parker
    I have an app whose main class extends ListActivity: public class GUIPrototype extends ListActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); final Cursor c = managedQuery(People.CONTENT_URI, null, null, null, null); String[] from = new String[] {People.NAME}; int[] to = new int[] { R.id.row_entry }; SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,R.layout.drawer,c,from,to); setListAdapter(adapter); getListView().setTextFilterEnabled(true); } } I have a sliding drawer included in my XML, and I'm trying to get a separate listview to appear in the sliding drawer. I'm trying to populate the second listview using an inflater: View inflatedView = View.inflate(this, R.layout.main, null); ListView namesLV = (ListView) inflatedView.findViewById(R.id.content); String[] names2 = new String[] { "CS 345", "New Tag", "Untagged" }; ArrayAdapter<String> bb = new ArrayAdapter<String>(this, R.layout.main, R.id.row_entry, names2); namesLV.setAdapter(bb); This compiles, and runs, but the slidingdrawer is completely blank. My XML follows: <SlidingDrawer android:id="@+id/drawer" android:handle="@+id/handle" android:content="@+id/content" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" android:layout_gravity="bottom"> <ImageView android:id="@id/handle" android:layout_width="48px" android:layout_height="48px" android:background="@drawable/icon"/> <ListView android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@id/content"/> </SlidingDrawer> I feel like I'm missing a vital step. I haven't found any resources on my problem by Googling, so any help would be greatly appreciated.

    Read the article

  • How does Linq-to-Xml convert objects to strings?

    - by Eamon Nerbonne
    Linq-to-Xml contains lots of methods that allow you to add arbitrary objects to an xml tree. These objects are converted to strings by some means, but I can't seem to find the specification of how this occurs. The conversion I'm referring to is mentioned (but not specified) in MSDN. I happen to need this for javascript interop, but that doesn't much matter to the question. Linq to Xml isn't just calling .ToString(). Firstly, it'll accept null elements, and secondly, it's doing things no .ToString() implementation does: For example: new XElement("elem",true).ToString() == "<elem>true</elem>" //but... true.ToString() == "True" //IIRC, this is culture invariant, but in any case... true.ToString(CultureInfo.InvariantCulture) == "True" Other basic data types are similarly specially treated. So, does anybody know what it's doing and where that's described?

    Read the article

  • How to read nested XML using xDocument in Silver light?

    - by Subhen
    Hi currently I have a nested XMl , having the following Structure : <?xml version="1.0" encoding="utf-8" ?> <Response><Result><item id="something" /><price na="something" /> <?xml version="1.0" encoding="UTF-8" ?><DIDL-Lite xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/"></Result><NumberReturned>10</NumberReturned><TotalMatches>10</TotalMatches></Response> Any help on how to read this using Xdocument or XMLReader will be really helpfull. Thanks, Subhendu

    Read the article

  • How to I tell my own custom Spinner Layout to use my Theme?

    - by jax
    How to I tell my own custom Spinner Layout to use my Theme? Style: <style name="SpinnerText" parent="@android:style/Widget.TextView.SpinnerItem"> <item name="android:textAppearance">@style/AnswerTextElement</item> <item name="android:gravity">center_vertical|center_horizontal</item> </style> Theme: <style name="ApplicationTheme" parent="android:style/Theme.NoTitleBar"> <item name="android:buttonStyle">@style/Button</item> <item name="android:spinnerStyle">@style/Spinner</item> <item name="android:spinnerItemStyle">@style/SpinnerText</item> </style> This works for default Spinners, however does not work with my custom layout: <RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"> <TextView android:layout_height="wrap_content" android:id="@+id/text1" android:text="label name" android:layout_width="fill_parent" android:layout_toLeftOf="@+id/check1"></TextView> <CheckBox android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/check1" android:layout_alignParentRight="true" android:clickable="false" android:focusable="false" android:focusableInTouchMode="false" style="@style/CheckBoxPlainBackground"></CheckBox> </RelativeLayout>

    Read the article

  • Subclassing ViewPager Breaks Animation

    - by Ryan Thomas
    In my Android application I have an activity which uses a view pager to display 4+ pages (Fragments). I implemented buttons on each screen that move between pages by calling: pager.setCurrentItem(position, true); The view pager and fragments are all working as I desired. I then began looking for a solution to disable user swiping between pages so that the transition between pages in handled by the buttons only. The solution I found was mentioned in a few stackoverflow articles as well as This Blog that suggest subclassing the view pager to intercept touch events to disable swiping. I followed those examples by subclassing the view pager class as follows: public class ViewPager extends android.support.v4.view.ViewPager { private boolean enabled; public ViewPager(Context context, AttributeSet attrs) { super(context, attrs); this.enabled = true; } @Override public boolean onTouchEvent(MotionEvent event) { if (this.enabled) { return super.onTouchEvent(event); } return false; } @Override public boolean onInterceptTouchEvent(MotionEvent event) { if (this.enabled) { return super.onInterceptTouchEvent(event); } return false; } public void setSwipingEnabled(boolean enabled) { this.enabled = enabled; } } Using the subclassed view pager and calling setSwipingEnabled(false) works as was desired. The user can no longer move between pages with swipe gestures and I can still move between pages via button clicks by calling setCurrentItem(int position, boolean smoothScroll). However using the subclass breaks the animation between pages. When I call setCurrentItem(position, true) with android.support.v4.view.ViewPager I get very clean scrolling animations between pages. When I make the same call using the subclass the screen has a very brief 'flash' and then automatically draws the new page. I would like to know how to fix the animation while retaining the ability to disable user swiping between pages. I greatly appreciate any help with this. Let me know if you need any additional information. So far I have tested using a Samsung device running 2.3.5 and an AVD emulator targeting Android 2.3.3.

    Read the article

  • How to make dialog to look like ICS theme

    - by Naruto
    from service i'm creating a dialog via a dummy activity. Here i'm able to see black background, overall the theme of dialog looks like Android V 2.2. My application minimum API level is 8, if i use holo theme it says i need min api level as 14. Here is the code i used to create dialog. How to get ICS theme dialog. public class PreviewDialog extends Activity{ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Show the popup dialog showDialog(0); } @Override protected Dialog onCreateDialog(int id) { super.onCreateDialog(id); // Build the dialog AlertDialog.Builder alert = new AlertDialog.Builder(this); alert.setTitle("ALARM REMINDER"); alert.setMessage("Its time for the alarm "); alert.setCancelable(false); alert.setPositiveButton("Dismiss", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { GoogleTaskPreviewDialog.this.finish(); } }); // Create and return the dialog AlertDialog dlg = alert.create(); return dlg; } } MY manifest file entry <activity android:name="PreviewDialog" android:theme="@android:style/Theme.Translucent.NoTitleBar"></activity>

    Read the article

  • Validate a subset of or only certain elements of an XML document?

    - by Gaurav Dadhania
    I have this XML file (some of them are HUGE - thousands of elements) and I'm trying to validate certain elements of this XML file using an XSD schema. For eg. dates, etc. Now, the problem is that XSD won't let me validate just certain sections of the document. It wants definitions for EVERYTHING - and that would be quite painful. What I would like to know is that is there a way to XSD work with only certain elements of the document? I've tried any and anyAttribute to no avail. If not, how would you do this? Is there a library/script that produces a schema corresponding to an XML document which I can then modify according to my needs? Thanks,

    Read the article

  • Cinema4D XML scene not rendering texture

    - by George Profenza
    I exported a basic Cinema4D scene as XML (File Export Cinema 4D XML) then opened up the xml in Cinema4D and it looses the reference to the texture applied. If I open up the original c4d file and render it I can see my texture applied. If I open up the exported xml file and render it the texture is missing. Any way to get around that ?

    Read the article

  • jQuery and XML (with CDATA)

    - by P..
    I've seen the post that deal with this issue but I still can't solve my issue: I've got XML with CDATA and when I parse the XML, it includes the CDATA (which I don't want). XML sample: <mainnav> <nav path="/" xmlpath="home.xml" key="footer" navigator=""> <display><![CDATA[Home]]></display> <title><![CDATA[Home]]></title> </nav> <nav path="/nav1/" xmlpath="nav1.xml" key="primary" navigator="primary" iconid="0"> <display><![CDATA[Nav 1]]></display> <title><![CDATA[Nav 1]]></title> <overdesc><![CDATA[test nav 1]]></overdesc> <sub path="/nav1/sub1/" xmlpath="nav1/sub1.xml" key="sub"> <display><![CDATA[sub 1<br />of nav 1]]></display> <title><![CDATA[sub 1<br />of nav 1]]></title> </sub> </nav> <nav path="/nav1/" xmlpath="nav2.xml" key="primary" navigator="primary" iconid="1"> <display><![CDATA[Nav 2]]></display> <title><![CDATA[Nav 2]]></title> <overdesc><![CDATA[test nav 2]]></overdesc> <sub path="/nav2/sub1/" xmlpath="nabv2/sub1.xml" key="sub"> <display><![CDATA[sub 1<br />of nav 2]]></display> <title><![CDATA[sub 1<br />of nav2]]></title> </sub> </nav> </mainnav> jQuery: $(document).ready(function(){ $.ajax({ type: "GET", url: "site_xml/config.xml", //contentType: "text/xml", dataType: ($.browser.msie) ? "xml" : "text/xml", success: parseXML, error: function(XMLHttpRequest, textStatus, errorThrown) { alert(errorThrown); } });}); function parseXML(xml) { $(xml).find('nav').each(function(){ if ($(this).attr("key")=="primary") { // this is a primary nav item; var title = $.trim( $(this).find('title').text() ); alert(title); $("#output").append(title); //nothing showing up in my output DIV, presumably due to the CDATA tags? } }); }

    Read the article

  • nokogiri xml unescape

    - by user296507
    hi, i'm just trying out nokogiri xml builder, but am having some problem tying to unescape the content. have been spending a bit of time googgling but so far can't find the answer. any help would be greatly appreciated. #build xml docoument builder = Nokogiri::XML::Builder.new do |xml| xml.root{ xml.node { xml.value "text1 & text2" } } end puts builder.to_xml output i'm get is "text1 &amp text2" but i want it to be "text1 & text2"

    Read the article

  • Getting XML data from a external page and parsing it with PHP

    - by James P
    I'm trying to create a database of World of Warcraft gems. If I go to this page: http://www.wowarmory.com/search.xml?fl[source]=all&fl[type]=gems&fl[subTp]=purple&searchType=items And go to View Source in Firefox, I see a tonne of XML data which is exactly what I want. I wrote up this quick script to try and parse some of it: <?php $gemUrls = array( 'Blue' => 'http://www.wowarmory.com/search.xml?fl[source]=all&fl[type]=gems&fl[subTp]=blue&searchType=items', 'Red' => 'http://www.wowarmory.com/search.xml?fl[source]=all&fl[type]=gems&fl[subTp]=red&searchType=items', 'Yellow' => 'http://www.wowarmory.com/search.xml?fl[source]=all&fl[type]=gems&fl[subTp]=yellow&searchType=items', 'Meta' => 'http://www.wowarmory.com/search.xml?fl[source]=all&fl[type]=gems&fl[subTp]=meta&searchType=items', 'Green' => 'http://www.wowarmory.com/search.xml?fl[source]=all&fl[type]=gems&fl[subTp]=green&searchType=items', 'Orange' => 'http://www.wowarmory.com/search.xml?fl[source]=all&fl[type]=gems&fl[subTp]=orange&searchType=items', 'Purple' => 'http://www.wowarmory.com/search.xml?fl[source]=all&fl[type]=gems&fl[subTp]=purple&searchType=items', 'Prismatic' => 'http://www.wowarmory.com/search.xml?fl[source]=all&fl[type]=gems&fl[subTp]=purple&searchType=items' ); // Get blue gems $blueGems = file_get_contents($gemUrls['Blue']); $xml = new SimpleXMLElement($blueGems); echo $xml->items[0]->item; ?> But I get a load of errors like this: Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: Entity: line 20: parser error : xmlParseEntityRef: no name in C:\xampp\htdocs\WoW\index.php on line 19 Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: if(Browser.iphone && Number(getcookie2("mobIntPageVisits")) < 3 && getcookie2( in C:\xampp\htdocs\WoW\index.php on line 19 I'm not sure what's wrong. I think file_get_contents() is bringing back data that isn't XML, maybe some Javascript files judging by the iPhone parts in the errors. Is there any way to just get back the XML from that page? Without any HTML or anything? Thanks :)

    Read the article

  • Android passing an arraylist back to parent activity

    - by Nicklas O
    Hi there. I've been searching for a simple example of this with no luck. In my android application I have two activities: 1. The main activity which is launched at startup 2. A second activity which is launched by pressing a button on the main activty. When the second activity is finished (by pressing a button) I want it to send back an ArrayList of type MyObject to the main activity and close itself, which the main activity can then do whatever with it. How would I go about achieving this? I have been trying a few things but it is crashing my application when I start the second activity. When the user presses button to launch second activity: Intent i = new Intent(MainActivity.this, secondactivity.class); startActivityForResult(i, 1); The array which is bundled back after pressing a button on the second activity: Intent intent= getIntent(); Bundle b = new Bundle(); b.putParcelableArrayList("myarraylist", mylist); intent.putExtras(b); setResult(RESULT_OK, intent); finish(); And finally a listener on the main activity (although I'm not sure of 100% when this code launches...) protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if(resultCode==RESULT_OK && requestCode==1){ Bundle extras = data.getExtras(); final ArrayList<MyObject> mylist = extras.getParcelableArrayList("myarraylist"); Toast.makeText(MainActivity.this, mylist.get(0).getName(), Toast.LENGTH_SHORT).show(); } } Any ideas where I am going wrong? The onActivityResult() seems to be crashing my application. EDIT: This is my class MyObject, its called plan and has a name and an id import android.os.Parcel; import android.os.Parcelable; public class Plan implements Parcelable{ private String name; private String id; public Plan(){ } public Plan(String name, String id){ this.name = name; this.id = id; } public String getName(){ return name; } public void setName(String name){ this.name = name; } public String getId(){ return id; } public void setId(String id){ this.id = id; } public String toString(){ return "Plan ID: " + id + " Plan Name: " + name; } @Override public int describeContents() { // TODO Auto-generated method stub return 0; } @Override public void writeToParcel(Parcel dest, int flags) { dest.writeString(id); dest.writeString(name); } public static final Parcelable.Creator<Plan> CREATOR = new Parcelable.Creator<Plan>() { public Plan createFromParcel(Parcel in) { return new Plan(); } @Override public Plan[] newArray(int size) { // TODO Auto-generated method stub return new Plan[size]; } }; } This is my logcat E/AndroidRuntime( 293): java.lang.RuntimeException: Unable to instantiate activ ity ComponentInfo{com.daniel.android.groupproject/com.me.android.projec t.secondactivity}: java.lang.NullPointerException E/AndroidRuntime( 293): at android.app.ActivityThread.performLaunchActiv ity(ActivityThread.java:2417) E/AndroidRuntime( 293): at android.app.ActivityThread.handleLaunchActivi ty(ActivityThread.java:2512) E/AndroidRuntime( 293): at android.app.ActivityThread.access$2200(Activi tyThread.java:119) E/AndroidRuntime( 293): at android.app.ActivityThread$H.handleMessage(Ac tivityThread.java:1863) E/AndroidRuntime( 293): at android.os.Handler.dispatchMessage(Handler.ja va:99) E/AndroidRuntime( 293): at android.os.Looper.loop(Looper.java:123) E/AndroidRuntime( 293): at android.app.ActivityThread.main(ActivityThrea d.java:4363) E/AndroidRuntime( 293): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime( 293): at java.lang.reflect.Method.invoke(Method.java:5 21) E/AndroidRuntime( 293): at com.android.internal.os.ZygoteInit$MethodAndA rgsCaller.run(ZygoteInit.java:860) E/AndroidRuntime( 293): at com.android.internal.os.ZygoteInit.main(Zygot eInit.java:618) E/AndroidRuntime( 293): at dalvik.system.NativeStart.main(Native Method) E/AndroidRuntime( 293): Caused by: java.lang.NullPointerException E/AndroidRuntime( 293): at com.daniel.android.groupproject.login.<init>( login.java:51) E/AndroidRuntime( 293): at java.lang.Class.newInstanceImpl(Native Method ) E/AndroidRuntime( 293): at java.lang.Class.newInstance(Class.java:1479) E/AndroidRuntime( 293): at android.app.Instrumentation.newActivity(Instr umentation.java:1021) E/AndroidRuntime( 293): at android.app.ActivityThread.performLaunchActiv ity(ActivityThread.java:2409) E/AndroidRuntime( 293): ... 11 more

    Read the article

  • OpenGL 2 on Android: native window

    - by ThreaderSlash
    According to OGLES specification, we have the following definition: EGLSurface eglCreateWindowSurface(EGLDisplay display, EGLConfig config, NativeWindowType native_window, EGLint const * attrib_list) More details, here: http://www.khronos.org/opengles/documentation/opengles1_0/html/eglCreateWindowSurface.html And also by definition: int32_t ANativeWindow_setBuffersGeometry(ANativeWindow* window, int32_t width, int32_t height, int32_t format); More details, here: http://mobilepearls.com/labs/native-android-api I am running Android Native App on OGLES 2 and debugging it in a Samsung Nexus device. For setting up the 3D scene graph environment, the following variables are defined: struct android_app { ... ANativeWindow* window; }; android_app* mApplication; ... mApplication=&pApplication; And to initialize the App, we run the commands in the code: ANativeWindow_setBuffersGeometry(mApplication->window, 0, 0, lFormat); mSurface = eglCreateWindowSurface(mDisplay, lConfig, mApplication->window, NULL); Funny to say is that, the command ANativeWindow_setBuffersGeometry behaves as expected and works fine according to its definition, accepting all the parameters sent to it. But the eglCreateWindowSurface does no accept the parameter mApplication-window, as it should accept according to its definition. Instead, it looks for the following input: EGLNativeWindowType hWnd; mSurface = eglCreateWindowSurface(mDisplay,lConfig,hWnd,NULL); As an alternative, I considered to use instead: NativeWindowType hWnd=android_createDisplaySurface(); But debugger says: Function 'android_createDisplaySurface' could not be resolved Can someone tell if there is a way to convert mApplication-window? In a way that the data from the android_app get accepted to the window surface?

    Read the article

< Previous Page | 58 59 60 61 62 63 64 65 66 67 68 69  | Next Page >