Search Results

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

Page 25/703 | < Previous Page | 21 22 23 24 25 26 27 28 29 30 31 32  | Next Page >

  • help animating player in corona sdk

    - by andrew McCutchan
    working on a game in the corona sdk with lua and I need help so the player animates on the line drawn. Right now he animates at the beggining and the end but not on the line. here is the player code function spawnPlayerObject(xPlayerSpawn,yPlayerSpawn,richTurn) --spawns Rich where we need him. -- riches sprite sheet and all his inital spirites. We need to adjust this so that animations 3-6 are the only ones that animate when moving horizontally local richPlayer = sprite.newSpriteSet(richSheet1,1,6) sprite.add(richPlayer, "rich", 1,6,500,1) rich = sprite.newSprite(richPlayer) rich.x = xPlayerSpawn rich.y = yPlayerSpawn rich:scale(_W*0.0009, _W*0.0009) -- scale is used to adjust the size of the object. richDir = richTurn rich.rotation = richDir rich:prepare("rich") rich:play() physics.addBody( rich, "static", { friction=1, radius = 15 } ) -- needs a better physics body for collision detection. end and here is the code for the line function movePlayerOnLine(event) --for the original image replace all rich with player. if posCount ~= linePart then richDir = math.atan2(ractgangle_hit[posCount].y-rich.y,ractgangle_hit[posCount].x-rich.x)*180/math.pi playerSpeed = 5 rich.x = rich.x + math.cos(richDir*math.pi/180)*playerSpeed rich.y = rich.y + math.sin(richDir*math.pi/180)*playerSpeed if rich.x < ractgangle_hit[posCount].x+playerSpeed*10 and rich.x > ractgangle_hit[posCount].x-playerSpeed*10 then if rich.y < ractgangle_hit[posCount].y+playerSpeed*10 and rich.y > ractgangle_hit[posCount].y-playerSpeed*10 then posCount = posCount + 1 end end I don't think anything has changed recently but I have been getting an error when testing of " attempt to upvalue "rich" a nil value" on the second line, richDir = etc.

    Read the article

  • help animating a player in Corona SDK

    - by andrew McCutchan
    Working on a game in the Corona SDK with Lua and I need help so the player animates on the line drawn. Right now he animates at the beggining and the end but not on the line. Here is the player code: function spawnPlayerObject(xPlayerSpawn,yPlayerSpawn,richTurn) --spawns Rich where we need him. -- riches sprite sheet and all his inital spirites. We need to adjust this so that animations 3-6 are the only ones that animate when moving horizontally local richPlayer = sprite.newSpriteSet(richSheet1,1,6) sprite.add(richPlayer, "rich", 1,6,500,1) rich = sprite.newSprite(richPlayer) rich.x = xPlayerSpawn rich.y = yPlayerSpawn rich:scale(_W*0.0009, _W*0.0009) -- scale is used to adjust the size of the object. richDir = richTurn rich.rotation = richDir rich:prepare("rich") rich:play() physics.addBody( rich, "static", { friction=1, radius = 15 } ) -- needs a better physics body for collision detection. end And here is the code for the line: function movePlayerOnLine(event) --for the original image replace all rich with player. if posCount ~= linePart then richDir = math.atan2(ractgangle_hit[posCount].y-rich.y,ractgangle_hit[posCount].x-rich.x)*180/math.pi playerSpeed = 5 rich.x = rich.x + math.cos(richDir*math.pi/180)*playerSpeed rich.y = rich.y + math.sin(richDir*math.pi/180)*playerSpeed if rich.x < ractgangle_hit[posCount].x+playerSpeed*10 and rich.x > ractgangle_hit[posCount].x-playerSpeed*10 then if rich.y < ractgangle_hit[posCount].y+playerSpeed*10 and rich.y > ractgangle_hit[posCount].y-playerSpeed*10 then posCount = posCount + 1 end end I don't think anything has changed recently but I have been getting an error when testing of "attempt to upvalue "rich" a nil value" on the second line, richDir = etc.

    Read the article

  • ASP.NET MVC WebService - Security for Industrial Android Clients

    - by Chris Nevill
    I'm trying to design a system that will allow a bunch of Android devices to securely log into an ASP.NET MVC REST Web service. At present neither side are implemented. However there is an ASP.NET MVC website which the web service will site along side. This is currently using forms authentication. The idea will be that the Android devices will download data from the web service and then be able to work offline storing data in their own local databases, where users will be able to make updates to that data, and then syncing updates back to the main server where possible. The web service will be using HTTPS to prevent calls being intercepted and reduce the risk of calls being intercepted. The system is an industrial system and will not be in used by the general Android population. Instead only authorized Android devices will be authorized by the Web Service to make calls. As such I was thinking of using the Android devices serial number as a username and then a generated long password which the device will be able to pick up - once the device has been authorized server side. The device will also have user logins - but these will not be to log into the web service - just the device itself - since the device and user must be able to work offline. So usernames and passwords will be downloaded and stored on the devices themselves. My question is... what form of security is best setup on the web service? Should it use forms Authentication? Should the username and password just be passed in with each GET/POST call or should it start a session as I have with the website? The Android side causes more confusion. There seems to be a number of options here Spring-Android, Volley, Retrofit, LoopJ, Robo Spice which seems to use the aforementioned Spring, Retrofit or Google HttpClient. I'm struggling to find a simple example which authenticates with a forms based authentication system. Is this because I'm going about this wrong? Is there another option that would better suite this?

    Read the article

  • Android mapView ItemizedOverlay setFocus does not work properly

    - by Gaks
    Calling setFocus(null) on the ItemizedOverlay does not 'unfocus' current marker. According to the documentation: ... If the Item is not found, this is a no-op. You can also pass null to remove focus. Here's my code: MapItemizedOverlay public class MapItemizedOverlay extends ItemizedOverlay<OverlayItem> { private ArrayList<OverlayItem> items = new ArrayList<OverlayItem>(); public MapItemizedOverlay(Drawable defaultMarker) { super(defaultMarker); } public void addOverlay(OverlayItem overlay) { items.add(overlay); populate(); } @Override protected OverlayItem createItem(int i) { return items.get(i); } @Override public int size() { return items.size(); } } Creating map overlay and one marker: StateListDrawable youIcon = (StateListDrawable)getResources().getDrawable(R.drawable.marker_icon); int width = youIcon.getIntrinsicWidth(); int height = youIcon.getIntrinsicHeight(); youIcon.setBounds(-13, 0-height, -13+width, 0); GeoPoint location = new GeoPoint(40800816,-74122009); MapItemizedOverlay overlay = new MapItemizedOverlay(youIcon); OverlayItem item = new OverlayItem(location, "title", "snippet"); overlay.addOverlay(item); mapView.getOverlays().add(overlay); The R.drawable.marker_icon is defined as follows: <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_focused="true" android:drawable="@drawable/marker_selected" /> <item android:state_selected="true" android:drawable="@drawable/marker_selected" /> <item android:drawable="@drawable/marker_normal" /> </selector> Now, to test the setFocus() behavior I put the button on the activity window, with the following onClick listener: Button focusBtn = (Button)findViewById(R.id.focusbtn); focusBtn.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { for(Overlay ov : mapView.getOverlays()) { if(ov.getClass().getSimpleName().equals("MapItemizedOverlay") == true) { MapItemizedOverlay miv = (MapItemizedOverlay)ov; if(miv.getFocus() == null) miv.setFocus(miv.getItem(0)); else miv.setFocus(null); break; } } mapView.invalidate(); } }); The expected behavior is: clicking on the button toggles marker selection. It works only once - clicking it for the first time selects the marker, clicking it again does not de-select the marker. The most weird thing about it is that after calling setFocus(null), getFocus() also returns null - like the overlay has no focused item (I debugged it). But even after calling mapView.invalidate() the marker is still drawn in 'selected'(focused) state.

    Read the article

  • How get an Android ListPreference defined in Xml whose values are integers?

    - by Rob Kent
    Is it possible to define a ListPreference in Xml and retrieve the value from SharedPreferences using getInt? Here is my Xml: <ListPreference android:key="@string/prefGestureAccuracyKey" android:title="@string/prefGestureAccuracyTitle" android:summary="@string/prefGestureAccuracyDesc" android:entries="@array/prefNumberAccuracyLabels" android:entryValues="@array/prefNumberAccuracyValues" android:dialogTitle="@string/prefGestureAccuracyDialog" android:persistent="true" android:defaultValue="2" android:shouldDisableView="false" /> And I want to get the value with something like: int val = sharedPrefs.getInt(key, defaultValue). At the moment I have to use getString and parse the result.

    Read the article

  • How to response to full screen button in websites that has videos

    - by Pinhassi
    I use webview to play videos from varios sites, some of them have a full screen button I would like the webview to respond to the full screen button. If I set webSettings.setUseWideViewPort(false); then video get stuck when clicking the full screen button and I can see the following error on the logcat: 10-09 08:32:27.970: D/gralloc(31814): unmmap pid(1876), vaddr(0x589dc000) 10-09 08:32:27.970: E/gralloc(31814): [GR_MD] unmapping from 0x5786c000, size=33427456 10-09 08:32:27.970: D/gralloc(31814): unmmap pid(1876), vaddr(0x5a9fb000) 10-09 08:32:27.970: E/gralloc(31814): [GR_MD] unmapping from 0x5984d000, size=33427456 10-09 08:32:27.975: D/gralloc(31814): unmmap pid(1876), vaddr(0x5e616000) 10-09 08:32:27.975: E/gralloc(31814): [GR_MD] unmapping from 0x5d42a000, size=33427456 I'm using Android 4.0.1, here is my code: setWebViewSettings(mVideoWebView); String data_html = "<!DOCTYPE HTML> <html xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:og=\"http://opengraphprotocol.org/schema/\" xmlns:fb=\"http://www.facebook.com/2008/fbml\"> <head></head> <body style=\"margin:0 0 0 0; padding:0 0 0 0;\"> <iframe src=\"http://www.dailymotion.com/embed/video/xu4vre\" width=\"300\" height=\"162"\" frameborder=\"0\"></iframe> </body> </html> "; mVideoWebView.loadData(data_html, "text/html", null); public static void setWebViewSettings(WebView webview) { WebSettings webSettings = webview.getSettings(); webSettings.setPluginState(PluginState.ON); webSettings.setJavaScriptEnabled(true); webSettings.setAllowFileAccess(true); webSettings.setLoadWithOverviewMode(false); // zoom y/n webSettings.setUseWideViewPort(true); // true = like desktop webSettings.setPluginsEnabled(true); //webSettings.setAllowContentAccess(true); webSettings.setAllowFileAccess(true); //webSettings.setAllowFileAccessFromFileURLs(true); //webSettings.setAllowUniversalAccessFromFileURLs(true); webSettings.setDatabaseEnabled(true); webSettings.setGeolocationEnabled(true); webSettings.setJavaScriptCanOpenWindowsAutomatically(true); webSettings.setDomStorageEnabled(true); }

    Read the article

  • Cannot access android.R.drawable.timepicker_input

    - by Andrea
    Hello there i'm trying to write a layout similar to the timepicker widget layout. So i decided to use the android framework layouts but i can't use them It seems that if i write android.R.drawable.timepicker_input or other timepicker related drawables i get them this Eclipse error: android.R.drawable.timepicker_up_btn cannot be resolved So i tried to import all the pngs and xml from the android source but eclipse says there is an error in the manifest regarding the icon. Ideas?

    Read the article

  • Android Drawable question.

    - by Tarmon
    Hey Everyone, I am trying to create a drawable in code and change the color based on some criteria. I can get it to work but it doesn't want to let me set the padding on the view. Any help would be appreciated. <?xml version="1.0" encoding="utf-8"?> <ImageView android:id="@+id/icon" android:layout_width="50px" android:layout_height="fill_parent" /> <TextView android:id="@+id/label" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingLeft="17px" android:textSize="28sp" /> ImageView icon = (ImageView) row.findViewById(R.id.icon); ShapeDrawable mDrawable; int x = 0; int y = 0; int width = 50; int height = 50; float[] outerR = new float[] { 12, 12, 12, 12, 12, 12, 12, 12 }; mDrawable = new ShapeDrawable(new RoundRectShape(outerR, null, null)); mDrawable.setBounds(x, y+height, x + width, y); switch(position){ case 0: mDrawable.getPaint().setColor(0xffff0000); //Red break; case 1: mDrawable.getPaint().setColor(0xffff0000); //Red break; case 2: mDrawable.getPaint().setColor(0xff00c000); //Green break; case 3: mDrawable.getPaint().setColor(0xff00c000); //Green break; case 4: mDrawable.getPaint().setColor(0xff0000ff); //Blue break; case 5: mDrawable.getPaint().setColor(0xff0000ff); //Blue break; case 6: mDrawable.getPaint().setColor(0xff696969); //Gray break; case 7: mDrawable.getPaint().setColor(0xff696969); //Gray break; case 8: mDrawable.getPaint().setColor(0xffffff00); //Yellow break; case 9: mDrawable.getPaint().setColor(0xff8b4513); //Brown break; case 10: mDrawable.getPaint().setColor(0xff8b4513); //Brown break; case 11: mDrawable.getPaint().setColor(0xff8b4513); //Brown break; case 12: mDrawable.getPaint().setColor(0xffa020f0); //Purple break; case 13: mDrawable.getPaint().setColor(0xffff0000); //Red break; case 14: mDrawable.getPaint().setColor(0xffffd700); //Gold break; case 15: mDrawable.getPaint().setColor(0xffff6600); //Orange break; } icon.setBackgroundDrawable(mDrawable); icon.setPadding(5, 5, 5, 5); If I set the padding in XML it just ignores it. Thanks, Rob

    Read the article

  • How to display a two column ListView in Android?

    - by Josemalive
    Hi, I have an android application that shows a grid view that shows: 1 2 3 4 GridView gridview=(GridView)findViewById(R.id.GridView_test); DataBaseHelper dbhelper=new DataBaseHelper(this); ArrayList<String> test=new ArrayList<String>(5); backlinksadapter.add("1"); backlinksadapter.add("2"); backlinksadapter.add("3"); backlinksadapter.add("4"); ArrayAdapter mAdapter=new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, test); gridview.setAdapter(mAdapter); By the moment is working, but i would like to show foreach line of the grid, 2 columns with the values of a 2 dimensional array (something like the GridView in ASP.Net - as datasource -). I would like to show: 1 | Person 1 2 | Person 2 3 | Person 3 4 | Person 4 Any idea?

    Read the article

  • Android - Start service on boot

    - by Gady
    From everything I've seen on Stack Exchange and elsewhere, I have everything set up correctly to start an IntentService when Android OS boots. Unfortunately it is not starting on boot, and I'm not getting any errors. Maybe the experts can help... Manifest: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.phx.batterylogger" android:versionCode="1" android:versionName="1.0" android:installLocation="internalOnly"> <uses-sdk android:minSdkVersion="8" /> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.BATTERY_STATS" /> <application android:icon="@drawable/icon" android:label="@string/app_name"> <service android:name=".BatteryLogger"/> <receiver android:name=".StartupIntentReceiver"> <intent-filter> <action android:name="android.intent.action.BOOT_COMPLETED" /> </intent-filter> </receiver> </application> </manifest> BroadcastReceiver for Startup: package com.phx.batterylogger; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; public class StartupIntentReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { Intent serviceIntent = new Intent(context, BatteryLogger.class); context.startService(serviceIntent); } } UPDATE: I tried just about all of the suggestions below, and I added logging such as Log.v("BatteryLogger", "Got to onReceive, about to start service"); to the onReceive handler of the StartupIntentReceiver, and nothing is ever logged. So it isn't even making it to the BroadcastReceiver. I think I'm deploying the APK and testing correctly, just running Debug in Eclipse and the console says it successfully installs it to my Xoom tablet at \BatteryLogger\bin\BatteryLogger.apk. Then to test, I reboot the tablet and then look at the logs in DDMS and check the Running Services in the OS settings. Does this all sound correct, or am I missing something? Again, any help is much appreciated.

    Read the article

  • Different positions in ViewPager

    - by Kalai Selvan.G
    In my Application am using ViewPager to swipe the images,which comes through webservice as URL. Everything goes smoothly,the problem is while swiping myself getting the position as collapsed one.. Swipe left-right: positions are 1,2,3,4,5,etc.. if i stops swiping at 5th pos and started to Swipe from right-left: positions are 2,1...why this happens? I need to catch the position of the imageURL to find out the ID of the specific image and so i need to download and set it as wallpaper.. Normally while we swipe from right-left,the positions should decrease like 4,3,2,1. Also in debugger mode i got some start position,end position,last position with different values.. Any Clue about ViewPager. Here is my code: public class ImagePagerActivity extends BaseActivity { private ViewPager pager; private DisplayImageOptions options; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.ac_image_pager); Bundle bundle = getIntent().getExtras(); String[] imageUrls = bundle.getStringArray(Extra.IMAGES); int pagerPosition = bundle.getInt(Extra.IMAGE_POSITION, 0); options = new DisplayImageOptions.Builder() .showImageForEmptyUrl(R.drawable.image_for_empty_url) .cacheOnDisc() .decodingType(DecodingType.MEMORY_SAVING) .build(); pager = (ViewPager) findViewById(R.id.pager); pager.setAdapter(new ImagePagerAdapter(imageUrls)); pager.setCurrentItem(pagerPosition); } private class ImagePagerAdapter extends PagerAdapter { private String[] images; private LayoutInflater inflater; ImagePagerAdapter(String[] images) { this.images = images; inflater = getLayoutInflater(); } @Override public void destroyItem(View container, int position, Object object) { ((ViewPager) container).removeView((View) object); } @Override public void finishUpdate(View container) { } @Override public int getCount() { return images.length; } @Override public Object instantiateItem(View view, int position) { final FrameLayout imageLayout = (FrameLayout) inflater.inflate(R.layout.item_pager_image, null); final ImageView imageView = (ImageView) imageLayout.findViewById(R.id.image); final ProgressBar spinner = (ProgressBar) imageLayout.findViewById(R.id.loading); imageLoader.displayImage(images[position], imageView, options, new ImageLoadingListener() { public void onLoadingStarted() { spinner.setVisibility(View.VISIBLE); } public void onLoadingFailed() { spinner.setVisibility(View.GONE); imageView.setImageResource(android.R.drawable.ic_delete); } public void onLoadingComplete() { spinner.setVisibility(View.GONE); } }); ((ViewPager) view).addView(imageLayout, 0); return imageLayout; } @Override public boolean isViewFromObject(View view, Object object) { return view.equals(object); } @Override public void restoreState(Parcelable state, ClassLoader loader) { } @Override public Parcelable saveState() { return null; } @Override public void startUpdate(View container) { } } }

    Read the article

  • facebook connect for android

    - by Daniel Benedykt
    Hi I am looking for a solution for facebook connect for Android. Before I used an open source solution from codecarpet: http://code.google.com/p/fbconnect-android/ but now it doesnt work anymore. Now the Official facebook connect for Android is out, but there are about 11 big time issues and it fails almost all the time, so its not a real solution. http://github.com/facebook/facebook-android-sdk/ Any idea how to resolve this issue? Thanks

    Read the article

  • Help with listView in Android

    - by jul
    Hi, I'm just starting with Android and can't find how to display a list in my activity. I get some restaurant data from a web service and I'd like to show the results in a list. The activity, the restaurant class and the layout main.xml are shown below. How can I display, for instance, the list of the restaurant names in the ListView 'list' of my layout? thank you Jul public class Atable extends ListActivity { RestaurantList restaurantList; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); //Here I set restaurantList //Now how can I display, for example, the list of the names of the restaurants } main.xml <LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/search" /> <EditText android:id="@+id/search" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1"/> </LinearLayout> <LinearLayout android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="wrap_content"> <ListView android:id="@+id/android:list" android:layout_width="wrap_content" android:layout_height="wrap_content"/> <TextView android:id="@+id/android:empty" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/noresults"/> </LinearLayout> </LinearLayout> Restaurant list class package org.digitalfarm.atable; import java.util.List; public class RestaurantList { private List<Restaurant> restaurants; public List<Restaurant> getRestaurants() { return restaurants; } public void setRestaurants(List<Restaurant> restaurants) { this.restaurants = restaurants; } } Restaurant class package org.digitalfarm.atable; public class Restaurant { private String name; private float latitude; private float longitude; public String getName() { return name; } public void setName(String name) { this.name = name; } public float getLatitude() { return latitude; } public void setLatitude(float latitude) { this.latitude = latitude; } public float getLongitude() { return longitude; } public void setLongitude(float longitude) { this.longitude = longitude; } }

    Read the article

  • Android: onListItemClick not getting called in ListActivity

    - by user521469
    I'm having problems with my first Android app. I have subclassed ListActivity, and I'm having no luck getting the overridden onListItemClick() to respond to click events. I've read focus can be a problem, but changing focus in the XML files does not seem to work. Here's the relevant bits of code. Anyone see what's I've buggered up? public class Notepadv1 extends ListActivity { private int mNoteNumber = 1; private NotesDbAdapter mDbHelper; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.notepad_list); mDbHelper = new NotesDbAdapter(this); mDbHelper.open(); fillData(); } private void fillData() { // Get all of the notes from the database and create the item list Cursor c = mDbHelper.fetchAllNotes(); startManagingCursor(c); String[] from = new String[] { NotesDbAdapter.KEY_TITLE }; int[] to = new int[] { R.id.text1 }; SimpleCursorAdapter notes = new SimpleCursorAdapter(this, R.layout.notes_row, c, from, to); setListAdapter(notes); } @Override public void onListItemClick (ListView l, View v, int position, long id){ super.onListItemClick(l, v, position, id); AlertDialog alert = new AlertDialog.Builder(this).create(); String message = "row clicked!"; alert.setMessage(message); alert.show(); } notepad_list.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content"> <ListView android:id="@android:id/list" android:layout_width="wrap_content" android:layout_height="wrap_content" android:dividerHeight="6dp"/> <TextView android:id="@android:id/empty" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/no_notes" /> </LinearLayout> And notes_row.xml <?xml version="1.0" encoding="utf-8"?> <TextView android:id="@+id/text1" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="60dp" android:focusable="false"/>

    Read the article

  • how to set the tabs in the bottom of the screen in android?

    - by androidbase
    hi all, i am working on tabactivity. i wanna show my tabwidget below the tabcontent(framelayout). i done it by setting the tabwiget tab attribute as android:gravity="bottom" but the framelayout cant align with those tabs. that is the tabs are shown at the bottom of the screen and overlap the framelayout how to do that? if set some height value to the framelayout it not optimized for all screens of android. what can i do? any idea???

    Read the article

  • Intent filter for browsing XML (specifically rss) in android

    - by Leif Andersen
    I have an activity that I want to run every time the user goes to an xml (specifically rss) page in the browser (at least assuming the user get's it from the list of apps that can support it). I currently already have the current intent filter: <activity android:name=".activities.EpisodesListActivity" android:theme="@android:style/Theme.NoTitleBar"> <intent-filter> <category android:name="android.intent.category.BROWSABLE"></category> <category android:name="android.intent.category.DEFAULT"></category> <action android:name="android.intent.action.VIEW"></action> <data android:scheme="http"></data> </intent-filter> </activity> Now as you can guess, this is an evil intent, as it wants to open whenever a page is requested via http. However, when I ad the line: <data android:mimeType="application/rss+xml"></data> to make it: <activity android:name=".activities.EpisodesListActivity" android:theme="@android:style/Theme.NoTitleBar"> <intent-filter> <category android:name="android.intent.category.BROWSABLE"></category> <category android:name="android.intent.category.DEFAULT"></category> <action android:name="android.intent.action.VIEW"></action> <data android:scheme="http"></data> <data android:mimeType="application/rss+xml"></data> </intent-filter> </activity> The application no longer claims to be able to run rss files. Also, if I change the line to: <data android:mimeType="application/xml"></data> It also won't work (for generic xml file even). So what intent filter do I need to make in order to claim that the activity supports rss. (Also, bonus points if you can tell me how I know what URL it was the user opened. So far, I've always sent that information from one activity to the other using extras). Thank you for your help

    Read the article

  • Fingertip drawing applications on Android?

    - by STD
    Hi, I'm a new user to this interesting forum! I want start developing an application for android and before starting i want learn about some android features... The first android feature is how to correlate finger motion on the screen with java... Are there any source code examples that show how to draw with your finger on an android screen? Can you suggest a good place for me to download an example? thanks

    Read the article

  • Android: ProgressDialog.show() crashes with getApplicationContext

    - by Felix
    I can't seem to grasp why this is happening. This code: mProgressDialog = ProgressDialog.show(this, "", getString(R.string.loading), true); works just fine. However, this code: mProgressDialog = ProgressDialog.show(getApplicationContext(), "", getString(R.string.loading), true); throws the following exception: W/WindowManager( 569): Attempted to add window with non-application token WindowToken{438bee58 token=null}. Aborting. D/AndroidRuntime( 2049): Shutting down VM W/dalvikvm( 2049): threadid=3: thread exiting with uncaught exception (group=0x4001aa28) E/AndroidRuntime( 2049): Uncaught handler: thread main exiting due to uncaught exception E/AndroidRuntime( 2049): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.tastekid.TasteKid/com.tastekid.TasteKid.YouTube}: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application E/AndroidRuntime( 2049): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2401) E/AndroidRuntime( 2049): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417) E/AndroidRuntime( 2049): at android.app.ActivityThread.access$2100(ActivityThread.java:116) E/AndroidRuntime( 2049): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794) E/AndroidRuntime( 2049): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime( 2049): at android.os.Looper.loop(Looper.java:123) E/AndroidRuntime( 2049): at android.app.ActivityThread.main(ActivityThread.java:4203) E/AndroidRuntime( 2049): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime( 2049): at java.lang.reflect.Method.invoke(Method.java:521) E/AndroidRuntime( 2049): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791) E/AndroidRuntime( 2049): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549) E/AndroidRuntime( 2049): at dalvik.system.NativeStart.main(Native Method) E/AndroidRuntime( 2049): Caused by: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application E/AndroidRuntime( 2049): at android.view.ViewRoot.setView(ViewRoot.java:460) E/AndroidRuntime( 2049): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:177) E/AndroidRuntime( 2049): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91) E/AndroidRuntime( 2049): at android.app.Dialog.show(Dialog.java:238) E/AndroidRuntime( 2049): at android.app.ProgressDialog.show(ProgressDialog.java:107) E/AndroidRuntime( 2049): at android.app.ProgressDialog.show(ProgressDialog.java:90) E/AndroidRuntime( 2049): at com.tastekid.TasteKid.YouTube.onCreate(YouTube.java:45) E/AndroidRuntime( 2049): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123) E/AndroidRuntime( 2049): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364) E/AndroidRuntime( 2049): ... 11 more Any ideas why this is happening? I'm calling this from the onCreate method.

    Read the article

  • Android visibility issue with checkbox

    - by fxi
    Hi all! I´m using a checkbox in my code that when its checked it makes a textview and a editText visibles, but if I uncheck de checkbox they continue being visible instead of dissapear. Here is the code: final CheckBox save = (CheckBox) findViewById(R.id.checkbox); save.setOnClickListener(new OnClickListener() { public void onClick(View v) { // Perform action on clicks, depending on whether it's now checked if (((CheckBox) v).isChecked()) { nameText.setVisibility(1); editName.setVisibility(1); } else { nameText.setVisibility(0); editName.setVisibility(0); } } }); And part of the xml which is inside an Relative Layout: <LinearLayout android:id="@+id/linearLayout3" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below = "@+id/linearLayout2"> <TextView android:id="@+id/text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/name" android:visibility="invisible"/> <EditText android:id="@+id/name" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:visibility="invisible"/> <CheckBox android:id="@+id/checkbox" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/save" /> </LinearLayout> What should i do to make the textView and EditText dissapear when i uncheck the checkbox? Thank you!

    Read the article

  • android throw InvocationTargetException,How to modify the error

    - by fonter
    ActivityManager am = (ActivityManager)this.getSystemService(this.ACTIVITY_SERVICE); try { clearMethod = am.getClass() .getMethod("clearApplicationUserData", String.class, IPackageDataObserver.class); } catch (Exception e) { Log.e("Error", "Android Error",e); clearMethod = null; } if(clearMethod!=null){ try { clearMethod.invoke(am,"com.android.browser",new ClearUserDataObserver()); } catch (Exception e) { Log.e("Error", "Android Exception",e); } } Exception 05-26 08:34:13.056: ERROR/Error(739): java.lang.reflect.InvocationTargetException 05-26 08:34:13.056: ERROR/Error(739): at android.app.ActivityManager.clearApplicationUserData(ActivityManager.java:475) 05-26 08:34:13.056: ERROR/Error(739): at java.lang.reflect.Method.invokeNative(Native Method) 05-26 08:34:13.056: ERROR/Error(739): at java.lang.reflect.Method.invoke(Method.java:521) 05-26 08:34:13.056: ERROR/Error(739): at com.iwidsets.clear.manager.AndClear.onCreate(AndClear.java:34) 05-26 08:34:13.056: ERROR/Error(739): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123) 05-26 08:34:13.056: ERROR/Error(739): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364) 05-26 08:34:13.056: ERROR/Error(739): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417) 05-26 08:34:13.056: ERROR/Error(739): at android.app.ActivityThread.access$2100(ActivityThread.java:116) 05-26 08:34:13.056: ERROR/Error(739): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794) 05-26 08:34:13.056: ERROR/Error(739): at android.os.Handler.dispatchMessage(Handler.java:99) 05-26 08:34:13.056: ERROR/Error(739): at android.os.Looper.loop(Looper.java:123) 05-26 08:34:13.056: ERROR/Error(739): at android.app.ActivityThread.main(ActivityThread.java:4203) 05-26 08:34:13.056: ERROR/Error(739): at java.lang.reflect.Method.invokeNative(Native Method) 05-26 08:34:13.056: ERROR/Error(739): at java.lang.reflect.Method.invoke(Method.java:521) 05-26 08:34:13.056: ERROR/Error(739): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791) 05-26 08:34:13.056: ERROR/Error(739): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549) 05-26 08:34:13.056: ERROR/Error(739): at dalvik.system.NativeStart.main(Native Method) 05-26 08:34:13.056: ERROR/Error(739): Caused by: java.lang.SecurityException: 739 does not have permission:android.permission.CLEAR_APP_USER_DATA to clear datafor process:com.android.browser 05-26 08:34:13.056: ERROR/Error(739): at android.os.Parcel.readException(Parcel.java:1218) 05-26 08:34:13.056: ERROR/Error(739): at android.os.Parcel.readException(Parcel.java:1206) 05-26 08:34:13.056: ERROR/Error(739): at android.app.ActivityManagerProxy.clearApplicationUserData(ActivityManagerNative.java:2016) 05-26 08:34:13.056: ERROR/Error(739): ... 17 more

    Read the article

  • android logging sdcard

    - by Abhi Rao
    Hello, With Android-Emulator I am not able to write/create a file on the SD Card (for logging). Here is what I have done so far - Run mksdcard 8192K C:\android-dev\emu_sdcard\emu_logFile - Create a new AVD, when assign emu_logFile to it so that when I view the AVD Details it says C:\android-dev\emu_sdcard\emu_logFile against the field "SD Card" - Here is the relevant code public class ZLogger { static PrintWriter zLogWriter = null; private static void Initialize() { try { File sdDir = Environment.getExternalStorageDirectory(); if (sdDir.canWrite()) { : File logFile = new File (sdDir, VERSION.RELEASE + "_" + ".log"); FileWriter logFileWriter = new FileWriter(logFile); zLogWriter = new PrintWriter(logFileWriter); zLogWriter.write("\n\n - " + date + " - \n"); } } catch (IOException e) { Log.e("ZLogger", "Count not write to file: " + e.getMessage()); } } sdDir.canWrite returns false - please note it not the exception from adb shell when I do ls I see sdcard as link to /mnt/sdcard. When I do ls -l /mnt here is what I see ls -l /mnt ls -l /mnt drwxr-xr-x root system 2010-12-24 03:41 asec drwx------ root root 2010-12-24 03:41 secure d--------- system system 2010-12-24 03:41 sdcard whereas if I go to the directory where I created emu_sdcard - I see a lock has been issued, as shown here C:dir android-dev\emu_sdcard Volume in drive C is Preload Volume Serial Number is A4F3-6C29 Directory of C:\android-dev\emu_sdcard 12/24/2010 03:41 AM . 12/24/2010 03:41 AM .. 12/24/2010 03:17 AM 8,388,608 emu_logFile 12/24/2010 03:41 AM emu_logFile.lock 1 File(s) 8,388,608 bytes 3 Dir(s) 50,347,704,320 bytes free I have looked at these and other SO questions Android Emulator sdcard push error: Read-only file system (2) Not able to view SDCard folder in the FileExplorer of Android Eclipse I have added the following to AndroidManifest.xml **uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" ** Please let me know your thoughts - what am I missing here? Why does canWrite return false? What should I do to add permissions to sdcard?

    Read the article

  • Why Your Android Phone Isn’t Getting Operating System Updates and What You Can Do About It

    - by Chris Hoffman
    Several times a year, Google releases a new version of Android with new features and performance improvements. Unfortunately, most Android devices in the wild will never get the update. New Android users are often disappointed to discover that their shiny new smartphone won’t get any updates – or worse, that it was running old software from the moment they bought it. Image Credit: Johan Larsson on Flickr Why Your Android Phone Isn’t Getting Operating System Updates and What You Can Do About It How To Delete, Move, or Rename Locked Files in Windows HTG Explains: Why Screen Savers Are No Longer Necessary

    Read the article

< Previous Page | 21 22 23 24 25 26 27 28 29 30 31 32  | Next Page >