Search Results

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

Page 91/1032 | < Previous Page | 87 88 89 90 91 92 93 94 95 96 97 98  | Next Page >

  • Is it possible to set an android icon from a drawable in a separate jar?

    - by Rpond
    I want to set a menu option icon for a drawable that is in another jar inside an xml file. <item android:id="@+id/my_location" android:title="My Location" android:icon="@+drawable/my_location"> Instead of drawable/my_location have something like com.somelib.R.drawable.someDrawable. I can set this in onCreateOptionsMenu but was just wondering if it could be done via the xml file.

    Read the article

  • Having trouble parsing XML with jQuery

    - by Jack
    Hi Guys, I'm trying to parse some XML data using jQuery, and as it stands I have extracted the 'ID' attribute of the required nodes and stored them in an array, and now I want to run a loop for each array member and eventually grab more attributes from the notes specific to each ID. The problem currently is that once I get to the 'for' loop, it isn't looping, and I think I may have written the xml path data incorrectly. It runs once and I recieve the 'alert(arrayIds.length);' only once, and it only loops the correct amount of times if I remove the subsequent xml path code. Here is my function: var arrayIds = new Array(); $(document).ready(function(){ $.ajax({ type: "GET", url: "question.xml", dataType: "xml", success: function(xml) { $(xml).find("C").each(function(){ $("#attr2").append($(this).attr('ID') + "<br />"); arrayIds.push($(this).attr('ID')); }); for (i=0; i<arrayIds.length; i++) { alert(arrayIds.length); $(xml).find("C[ID='arrayIds[i]']").(function(){ // pass values alert('test'); }); } } }); }); Any ideas?

    Read the article

  • How can I tell if the screen is on in android?

    - by user297020
    In Android 2.2 (Level 7) the function PowerManager.IsScreenOn() returns a boolean that is true if the screen is turned on and false if the screen is turned off. I am developing code for Android 1.5 (Level 3). How do I accomplish the same task in older versions of Android? I do not want to turn the screen on or off in my code. I just want to know what it is.

    Read the article

  • How big can I make an Android application's canvas in terms of pixels?

    - by user279112
    I've determined an estimate of the size of my Android emulator's screen in pixels, although I think its resolution can be changed to other numbers. Quite frankly though that doesn't eliminate the general problem of not knowing how many pixels on each axis I have to work with on my Android applications in general. The main problem I'm trying to solve is this: How do I make sure I don't use a faulty resolution on Android applications if I want to keep things' sizes constant (so that if the application screen shrinks, for instances, objects will still show up just as big - there just won't be as many of them being shown) if I wish to do this with a single universal resolution for each program? Failing that, how do I make sure everything's alright if I try to do everything the same way with maybe a few different pre-set resolutions? Mainly it seems like a relevant question that must be answered before I can come across a complete answer for the general problem is how big can I always make my application in pixels, NOT regarding if and when a user resizes the application's screen to something smaller than the maximum size permitted by the phone and its operating system. I really want to try to keep this simple. If I were doing this for a modern desktop, for instance, I know that if I design the application with a 800x600 canvas, the user can still shrink the application to the point they're not doing themselves any favors, but at least I can basically count on it working right and not being too big for the monitor or something. Is there such a magic resolution for Android, assuming that I'm designing for API levels 3+ (Android 1.5+)? Thanks

    Read the article

  • Multiple XML/XSLT files in PHP, transform one with XSLT and add others but process it first with PHP

    - by ipalaus
    I am processing XML files transformations with XSLT in PHP correctly. Actually I use this code: $xml = new DOMDocument; $xml->LoadXML($xml_contents); $xsl = new DOMDocument; $xsl->load($xsl_file); $proc = new XSLTProcesoor; $proc->importStyleSheet($xsl); echo $proc->transformToXml($xml); $xml_contents is the XML processed with PHP, this is done by including the XML file first and then assigning $xml_contents = ob_get_contents(); ob_end_clean();. This forces to process the PHP code on the XML, and it works perfectly. My problem is that I use more than one XML file and this XML files has PHP code on it that need to be processed AND have a XSLT file associated to process the data. Actually I'm including this files in XSLT with the next code: <!-- First I add the XML file --> <xsl:param name="menu" select="document('menu.xml')" /> <!-- Next I add the transformations for menu.xml file --> <xsl:include href="menu.xsl" /> <!-- Finally, I process it on the actual ("parent") XML --> <xsl:apply-templates select="$menu/menu" /> My questiion is how I can handle this. I need to add mutiple XML(+XSLT) files to my first XML file that will containt PHP so it needs to be processed. Thank you in advance!

    Read the article

  • How to refresh a fragment in a viewpager?

    - by aut_silvia
    I know there are already some questions to this problem. But I am really new in Android and ecspecially to Fragments and Viewpager. Pls have passion with me. I didn't found a answer which fits to my code. I dont know how to refresh a fragment or reload it when it's "active" again. TabsPagerAdapter.java: public class TabsPagerAdapter extends FragmentPagerAdapter{ public TabsPagerAdapter(FragmentManager fm){ super(fm); } @Override public Fragment getItem(int index) { switch (index) { case 0: return new KFZFragment(); case 1: return new LogFragment(); case 2: return new TrackFragment(); } return null; } @Override public int getCount() { // get item count - equal to number of tabs return 3; } } I have this 3 Fragments (KFZFragment,LogFragment,TrackFragment) and on the TrackFragment I calculate some data and this data should be display in a ListView in LogFragment. But when I change to LogFragment it's not the latest data. So it doesnt refresh. Now how should I modify my code to refresh the fragments when it's "active"? MainActivityFragment.java: public class MainActivityFragment extends FragmentActivity implements ActionBar.TabListener{ private ViewPager viewPager; private TabsPagerAdapter mAdapter; private ActionBar actionBar; List<Fragment> fragments; private String[] tabs = { "KFZ", "Fahrten Log", "Kosten Track" }; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main_fragment); // Initilization viewPager = (ViewPager) findViewById(R.id.pager); actionBar = getActionBar(); mAdapter = new TabsPagerAdapter(getSupportFragmentManager()); fragments = new Vector<Fragment>(); fragments.add(Fragment.instantiate(this, KFZFragment.class.getName(),savedInstanceState)); fragments.add(Fragment.instantiate(this, LogFragment.class.getName(),savedInstanceState)); viewPager.setAdapter(mAdapter); actionBar.setHomeButtonEnabled(false); actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); // Adding Tabs for (String tab_name : tabs) { actionBar.addTab(actionBar.newTab().setText(tab_name) .setTabListener(this)); } viewPager.setOnPageChangeListener(new ViewPager.OnPageChangeListener() { @Override public void onPageSelected(int position) { // on changing the page // make respected tab selected actionBar.setSelectedNavigationItem(position); } @Override public void onPageScrolled(int arg0, float arg1, int arg2) { } @Override public void onPageScrollStateChanged(int arg0) { } }); } @Override public void onTabReselected(Tab tab, FragmentTransaction ft) { // TODO Auto-generated method stub } @Override public void onTabSelected(Tab tab, FragmentTransaction ft) { viewPager.setCurrentItem(tab.getPosition()); } @Override public void onTabUnselected(Tab tab, FragmentTransaction ft) { // TODO Auto-generated method stub } @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK) { } return super.onKeyDown(keyCode, event); } } Pls help me out.

    Read the article

  • "Unable to get system library for project" after I upgraded to Android SDK 2.3 and ADT 8.0

    - by Jonas
    Today I upgraded to Android SDK 2.3 and I also upgraded the Eclipse Plugin Androi Developer Tools 8.0 (from 0.9.9). I also upgraded my Java Development Kit to 1.6_22. Now in Eclipse I get many errors in all my Android projects. The error messages are like: The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files. How can I fix this so I can use my Android projects again? In the Build Path for these projects, I don't have any references to an android.jar but a message: Unable to get system library for project

    Read the article

  • Force close while calling mainactivity from widget (android)

    - by Shaji Thorn Blue
    Iam creating a simple widget, by this widget i want to open my mainactivity. Iam sending a unique key from my widget class to check whether my mainactivity is called via widget or not. But as soon as i clicked on my widget my mainactivity get force close. here is code of my widget class... @Override public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] widgets) { // TODO Auto-generated method stub int numofWidgets = widgets.length; for(int i=0;i<numofWidgets;i++){ int widget = widgets[i]; Intent in = new Intent(context, EmergencyButton.class); in.putExtra("uniquevalue", "widget"); PendingIntent pendingintent = PendingIntent.getActivity(context, 0, in, 0); RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widgetlayout); views.setOnClickPendingIntent(R.id.button, pendingintent); appWidgetManager.updateAppWidget(widget, views); } } And Here is my code of mainactivity where iam checking whether called came from widget or not @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.mainactivity); Intent intentwidget = this.getIntent(); if(intentwidget !=null) { String widgetdata = "nothing"; widgetdata = intentwidget.getExtras().getString("uniquevalue"); if(widgetdata.equals("widget")) { et1.setText(widgetdata); } } } And here is my logcat 11-04 14:57:14.361: E/AndroidRuntime(1701): FATAL EXCEPTION: main 11-04 14:57:14.361: E/AndroidRuntime(1701): java.lang.RuntimeException: Unable to start activityComponentInfo{com.appsionlabs.googlemapv2/com.appsionlabs.googlemapv2.EmergencyButton}: java.lang.NullPointerException 11-04 14:57:14.361: E/AndroidRuntime(1701): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647) 11-04 14:57:14.361: E/AndroidRuntime(1701): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663) 11-04 14:57:14.361: E/AndroidRuntime(1701): at android.app.ActivityThread.access$1500(ActivityThread.java:117) 11-04 14:57:14.361: E/AndroidRuntime(1701): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931) 11-04 14:57:14.361: E/AndroidRuntime(1701): at android.os.Handler.dispatchMessage(Handler.java:99) 11-04 14:57:14.361: E/AndroidRuntime(1701): at android.os.Looper.loop(Looper.java:123) 11-04 14:57:14.361: E/AndroidRuntime(1701): at android.app.ActivityThread.main(ActivityThread.java:3683) 11-04 14:57:14.361: E/AndroidRuntime(1701): at java.lang.reflect.Method.invokeNative(Native Method) 11-04 14:57:14.361: E/AndroidRuntime(1701): at java.lang.reflect.Method.invoke(Method.java:507) 11-04 14:57:14.361: E/AndroidRuntime(1701): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 11-04 14:57:14.361: E/AndroidRuntime(1701): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 11-04 14:57:14.361: E/AndroidRuntime(1701): at dalvik.system.NativeStart.main(Native Method) 11-04 14:57:14.361: E/AndroidRuntime(1701): Caused by: java.lang.NullPointerException 11-04 14:57:14.361: E/AndroidRuntime(1701): at com.appsionlabs.googlemapv2.EmergencyButton.onCreate(EmergencyButton.java:29) 11-04 14:57:14.361: E/AndroidRuntime(1701): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 11-04 14:57:14.361: E/AndroidRuntime(1701): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)

    Read the article

  • What can't the NDK be used for?

    - by Android Eve
    From the official NDK site: The Android NDK... provides headers and libraries that allow you to build activities, handle user input, use hardware sensors, access application resources, and more, when programming in C or C++. If you write native code, your applications are still packaged into an .apk file and they still run inside of a virtual machine on the device. The fundamental Android application model does not change. Yet, it is always described as a companion tool to the Android SDK and as a toolset that allows to "implement parts of your applications using native-code languages such as C and C++". My understanding from this is that, unlike the Java based SDK, the NDK is not designed to implement certain parts of an Android application. Is this correct? If so, what parts doesn't the NDK allow implementing?

    Read the article

  • Again: Android Stock browser vs. WebView?

    - by user2281606
    maybe a very easy question, but this drives me crazy... I work in company where we develope apps based on webviews. Everytime something went wrong, my boss tells me: "Hey look, the page runs nicely in the android browser, so it has to run that way in the app. Make it happen." I know that every manufacturer has his own implementation, discussed here: Android WebView VS Phone Browser But i want to keep my question simple: Is the android stock browser a pimped webview or in other words, extends the android browser from webview-class ? Thanks for any response?

    Read the article

  • How to make restrictions on XML Schema Complex type?

    - by chobo2
    Hi I am reading the tutorials on w3cschools ( http://www.w3schools.com/schema/schema_complex.asp ) but they don't seem to mention how you could add restrictions on complex types. Like for instance I have this schema. <xs:element name="employee"> <xs:complexType> <xs:sequence> <xs:element name="firstname" type="xs:string"/> <xs:element name="lastname" type="xs:string"/> </xs:sequence> </xs:complexType> </xs:element> now I want to make sure the firstname is no more then 10 characters long. How do I do this? I tried to put in the simple type for the firstname but it says I can't do that since I am using a complex type. So how do I put restrictions like that on the file so the people who I give the schema to don't try to make the firstname 100 characters.

    Read the article

  • Possible to add hook as android fetches XML-strings?

    - by user247245
    I'm on my first week with android and would appreciate any insight if it's possible to hook or override the default behaviour when an android application reads their values from the resource-files to the shown layouts. What I want is to over time be able to add new/updated strings OTA and store locally and then on launch of application load new values instead of the ones in the default /res. Ideally i guess, would be an override of setContentView. Files holding updates will be in same xml-format as those in /res. (Please, no advices in other ways to do this. Just need to know if it's at all possible, without hacking the SDK) regards, /t

    Read the article

  • Webserver directory index: index.xml?

    - by Marius
    Hello there, I am making my first RSS-Feed, and I want to host it like this: www.example.com/rss/ I tried to name the xml-file "index.xml" and place it inside the directory, however, when I type http://www.example.com/rss/ i arrive at "Index of /rss" where the file is listed as being part of the directory, but it is not loaded automatically. What can be done about this? Thank you for your time. Kind regards, Marius

    Read the article

  • Displaying XML in Chrome Browser

    - by Josh
    I love the Chrome browser but I use XML quite a lot in my development work and when I view it in Chrome I just get the rendered text. I know that the source view is slightly better but I'd really like to see the layout and functionality that IE adds to XML namely: Highlighting Open/close nodes Any ideas how I can get this on Chrome? Thanks, Josh UPDATE: The XMLTree Extension is available on Google Chrome Extension Beta Site. Thanks again for your help.

    Read the article

  • Retrieve MS SQL database or table struture in XML

    - by clutch
    Is there a way to export the database schema in well formed XML of a MS 2000 SQL Server. I'm looking for just the structure not the data and the more detailed the better. The XML may be used in a migration processes. I'm more familiar with MySQL then with SQL Server so please be detailed if you hav time. Thanks

    Read the article

  • Search in multiple xml files

    - by Ram
    I have a windows Xp Sp2 system where the windows explorer search is not able to find the text in xml files. Is there some setting that enable the search in xml files? It finds in text in text / doc files in the same folder.

    Read the article

  • Notepad++ Reindent XML breaks lines.

    - by C. Ross
    I'm attempting to use Notepad++ TextFX HTMLTidy - Tidy: Reindent XML. This works well with the following exception. Lines longer than 70 character are wrapped, breaking the validity of my xml. This: <RevieweeDepartmentName>BB AAAAAAAAAA AAAAAAAAAA AAAA</RevieweeDepartmentName> Becomes this: <RevieweeDepartmentName>BB AAAAAAAAAA AAAAAAAAAA AAAA</RevieweeDepartmentName> How can I get it to stop this behavior?

    Read the article

  • Retrieve MS SQL database or table structure in XML

    - by clutch
    Is there a way to export the database schema in well formed XML of a MS 2000 SQL Server. I'm looking for just the structure not the data and the more detailed the better. The XML may be used in a migration processes. I'm more familiar with MySQL then with SQL Server so please be detailed if you have time. Thanks

    Read the article

  • Live wallpaper settings not applying

    - by Steve
    I have added settings to my live wallpaper but they are not being applied when changed. I would greatly appreciate it if someone could tell me why my settings are not being applied when changed. Here is my code: settings.xml <PreferenceCategory android:title="@string/more"> <PreferenceScreen android:title="@string/more"> <intent android:action="android.intent.action.VIEW" android:data="market://search?q=pub:PSP Demo Center" /> </PreferenceScreen> <ListPreference android:persistent="true" android:enabled="true" android:entries="@array/settings_light_number_options" android:title="@string/settings_light_number" android:key="light_power" android:summary="@string/settings_light_number_summary" android:defaultValue="3" android:entryValues="@array/settings_light_number_optionvalues" /> <ListPreference android:persistent="true" android:enabled="false" android:entries="@array/settings_speed_number_options" android:title="@string/settings_speed_number" android:key="speed" android:summary="@string/settings_speed_number_summary" android:defaultValue="10" android:entryValues="@array/settings_speed_number_optionvalues" /> <ListPreference android:persistent="true" android:enabled="false" android:entries="@array/settings_rotate_number_options" android:title="@string/settings_rotate_number" android:key="rotate" android:summary="@string/settings_rotate_number_summary" android:defaultValue="8000" android:entryValues="@array/settings_rotate_number_optionvalues" /> </PreferenceCategory> </PreferenceScreen> Settings.java public class GraffitiLWPSettings extends PreferenceActivity implements SharedPreferences .OnSharedPreferenceChangeListener { public static final String SHARED_PREFS_NAME = "wallpaper_settings"; protected void onCreate(Bundle icicle) { super.onCreate(icicle); getPreferenceManager(). setSharedPreferencesName(GraffitiLWP.SHARED_PREFS_NAME); addPreferencesFromResource(R.xml.settings); getPreferenceManager().getSharedPreferences(). registerOnSharedPreferenceChangeListener(this); } protected void onResume() { super.onResume(); } protected void onDestroy() { getPreferenceManager().getSharedPreferences() .unregisterOnSharedPreferenceChangeListener(this); super.onDestroy(); } public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { } } wallpaper.java public class GraffitiLWP extends Wallpaper { private GraffitiLWPRenderer mRenderer; public static final String SHARED_PREFS_NAME = "wallpaper_settings"; public Engine onCreateEngine() { mRenderer = new GraffitiLWPRenderer(this); return new WallpaperEngine( this.getSharedPreferences(SHARED_PREFS_NAME, Context.MODE_PRIVATE), getBaseContext(), mRenderer); } } renderer.java public class GraffitiLWPRenderer extends RajawaliRenderer { private Animation3D mAnim; private BaseObject3D mCan; private SettingsUpdater settingsUpdater; //private SharedPreferences preferences; public GraffitiLWPRenderer(Context context) { super(context); setFrameRate(20); } public class SettingsUpdater implements SharedPreferences .OnSharedPreferenceChangeListener { private GraffitiLWPRenderer renderer; public SettingsUpdater(GraffitiLWPRenderer renderer) { this.renderer = renderer; } public void onSharedPreferenceChanged( SharedPreferences sharedPreferences, String key) { preferences.getInt("wallpaper_settings", 0); renderer.setSharedPreferences(preferences); } } public void initScene() { System.gc(); ALight light = new DirectionalLight(); light.setPower(this.preferences.getLong("light_power", 3)); light.setPosition(0, 0, -10); mCamera.setPosition(0, -1, -7); mCamera.setLookAt(0, 2, 0); mCamera.setFarPlane(1000); ObjParser parser = new ObjParser(mContext .getResources(), mTextureManager, R.raw.spraycan_obj); parser.parse(); mCan = parser.getParsedObject(); mCan.addLight(light); mCan.setScale(1.2f); addChild(mCan); Number3D axis = new Number3D(0, this.preferences.getLong("speed", 10), 0); axis.normalize(); mAnim = new RotateAnimation3D(axis, 360); mAnim.setDuration(this.preferences.getLong("rotate", 8000)); mAnim.setRepeatCount(Animation3D.INFINITE); mAnim.setInterpolator(new AccelerateDecelerateInterpolator()); mAnim.setTransformable3D(mCan); setSkybox(R.drawable.posz, R.drawable.posx, R.drawable.negz, R.drawable.negx, R.drawable.posy, R.drawable.negy); } public void onSurfaceCreated(GL10 gl, EGLConfig config) { settingsUpdater = new SettingsUpdater(this); this.preferences.registerOnSharedPreferenceChangeListener( settingsUpdater); settingsUpdater.onSharedPreferenceChanged(preferences, null); super.onSurfaceCreated(gl, config); mAnim.start(); } public void onDrawFrame(GL10 glUnused) { super.onDrawFrame(glUnused); mSkybox.setRotY(mSkybox.getRotY() + .5f); } } I know the code is long but I would greatly appreciate any help that someone could give me. Thank you.

    Read the article

  • Should all new web projects build their backend based on xml/json result sets?

    - by Blankman
    If you were building a new Saas project, would it make sense to start with all of the backend services returning xml/json? Because these days you need to build for both the web and mobile devices, and having a backend that is build from the start to return xml and json, you are ready to go mobile (all services have the business logic, so you won't be repeating anything). Now the web would be MVC, so the controller would just be routing the request to your service backend, and converting the json or xml to html. The obviousl downside is that you have to build a backend, and then another web project that calls your backend. But this also goes to you favor as it forces you to seperate your concerns, and not leak business logic in your controller/view layer. Thoughts?

    Read the article

  • Android ADT Eclipse plugin, parseSDKContent failed

    - by Sebastian Ganslandt
    I've just set up my first Android development environment consisting of Eclipse 3.5 Mac OSX 10.5 Android SDK for x86 macs ADT Eclipse plugin 0.9.6 I've set set $PATH to my SDK/tools directory (which shouldn't matter if I only use Eclipse right?) and started Eclipse, but when I try to set the path to the SDK in Eclipse, i get the error "parseSdkContent failed". The stack trace of from the thrown exception is java.lang.IllegalArgumentException: http://www.w3.org/2001/XMLSchema at javax.xml.validation.SchemaFactory.newInstance(SchemaFactory.java:181) at com.android.ide.eclipse.adt.internal.sdk.LayoutDevicesXsd.getValidator(Unknown Source) at com.android.ide.eclipse.adt.internal.sdk.LayoutDeviceManager.parseLayoutDevices(Unknown Source) at com.android.ide.eclipse.adt.internal.sdk.LayoutDeviceManager.loadDefaultLayoutDevices(Unknown Source) at com.android.ide.eclipse.adt.internal.sdk.LayoutDeviceManager.loadDefaultAndUserDevices(Unknown Source) at com.android.ide.eclipse.adt.internal.sdk.Sdk.<init>(Unknown Source) at com.android.ide.eclipse.adt.internal.sdk.Sdk.loadSdk(Unknown Source) at com.android.ide.eclipse.adt.AdtPlugin$13.run(Unknown Source) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55) I can't see that I've missed anything in the setup process, according to the instructions it should basically just work out of the box. Any ideas as to why this might fail?

    Read the article

< Previous Page | 87 88 89 90 91 92 93 94 95 96 97 98  | Next Page >