Search Results

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

Page 81/1032 | < Previous Page | 77 78 79 80 81 82 83 84 85 86 87 88  | Next Page >

  • Android multiple screen sizes with same density

    - by droidy
    I'm confused regarding the densities. I see that with medium density, the screen resolution could be either 320x480, 480x800, or 480x854. So if I have an image thats 300px wide in the mdpi folder, how is it going to look the same size on all 3 different screen sizes (mainly 320x480 vs the other 2)? And by look the same size, I mean scale to be bigger or smaller depending upon the screen size. Thanks.

    Read the article

  • Use trackball for scrolling in Android ListView

    - by gartenkralleb
    hi, i have a ListView, whose content should not be selectable. i set the ListView to choiceMode="none" and set a transparent listSelector. for touch mode it acts as desired. a problem is the use of the trackball. if i try to use it for scrolling, the scroll starts after the 10th push to "down". this is caused by the invisible listSelector, which scrolls down the list until the 10th list item is "invisibily" selected. i try to override dispatchTrackballEvent and do the scrolling with scrollBy, but i did not finished this approach yet, to have a look on alternative suggestions. is there a simple solution for my problem?

    Read the article

  • Set Android Gallery widget to show specific starting image

    - by Dalmazio Brisinda
    Hi all, I have a task where the user can select an image from a GridView representing a photo album, and from this I start a new activity which displays a Gallery widget to show the images of the photo album. However, I can't seem to get the Gallery widget to show the contents of the photo album with a given image as the starting point. Ideally I would like a Gallery#setStartingImage(int position) or something similar. Any ideas would be greatly appreciated. Best, Dalmazio

    Read the article

  • How do I utilize REST to post GPS data from an Android device into a Ruby on Rails application?

    - by joecan
    I am a student in the process a building an Android app that can post a GPS track into a Rails application. I would like to do things the "Rails" way and take advantage of the REST. My rails application basically has 3 models at this point: users, tracks, and points. A user has_many tracks and a track has_many points. A track also has a total distance. Points have a latitude and longitude. I have successfully been able to create an empty track with: curl -i -X POST -H 'Content-Type: application/xml' -d '<track><distance>100</distance></track>' http://localhost:3000/users/1/tracks Whoo hoo! That is pretty cool. I am really impressed that rails do this. Just to see what would happen I tried the following: curl -i -X POST -H 'Content-Type: application/xml -d '<track><distance>100</distance><points><point><lat>3</lat><lng>2</lng></point></points></track>' http://localhost:3000/users/1/tracks Fail! The server spits back: Processing TracksController#create (for 127.0.0.1 at 2010-04-14 00:03:25) [POST] Parameters: {"track"={"points"={"point"={"lng"="2", "lat"="3"}}, "distance"="100"}, "user_id"="1"} User Load (0.6ms) SELECT * FROM "users" WHERE ("users"."id" = 1) ActiveRecord::AssociationTypeMismatch (Point(#-620976268) expected, got Array(#-607740138)): app/controllers/tracks_controller.rb:47:in `create' It seems my tracks_controller doesn't like or understand what it's getting from the params object in my tracks_controller.rb: def create @track = @user.tracks.build(params[:track]) My xml might be wrong, but at least Rails seems to be expecting a Point from it. Is there anyway I can fix TracksController.create so that it will be able to parse xml of a track with nested multiple points? Or is there another way I should be doing this entirely?

    Read the article

  • Android WebView Authentication

    - by bobthemac
    I am having issues with authentication for my webview I have a https address that requires authentication but it isn't basic authentication. When I access chrome on my phone and go to this site I get a dialogue box that asks me for a username and password I want to do something similar but all the attempts at authentication I have made have failed using the what I have found as they all seem to be for basic authentication and I don't think this is what it is. any help is appreciated, sorry if this is duplicate but I have looked and found nothing similar .

    Read the article

  • Android PixelFormat per device

    - by Tobias Domhan
    analogous to this thread: stackoverflow.com/questions/2093594/opengl-extensions-available-on-different-android-devices I would like to collect the different PixelFormats the android devices use. To find out you must do the following: Parameters camParams = camera.getParameters(); int format = camParams.getPreviewFormat(); Now you got to find the number in the following list: developer.android.com/reference/android/graphics/PixelFormat.html#A_8 How to generally open the camera is described here: developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/CameraPreview.html I'll have a start: device: T-mobile G1 / HTC Dream android: 1.6 (cyanogen mod) format: YCbCr_420_SP so what formats do your android phones use? thanks in advance :D

    Read the article

  • android get contact phone number

    - by ng93
    hi, im trying to get a contacts name and phone number from the contacts list. im using: contactname = Curser.getString(Curser.getColumnIndex(Contacts.DISPLAY_NAME)); to get their name and it works fine. But using: contactphone = Curser.getString(Curser.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER)); causes no warnings or errors and builds fine, yet force closes in both the emulator (2.1) and my htc desire (nexus one 2.2 rom/htc desire 2.1 rom). Any ideas how to fix it? oh and contactname and contactphone are both strings thanks, ng93

    Read the article

  • How to get a list of installed android applications and pick one to run

    - by Jon
    I asked a similar question to this earlier this week but I'm still not understanding how to get a list of all installed applications and then pick one to run. I've tried: Intent intent = new Intent(ACTION_MAIN); intent.addCategory(CATEGORY_LAUNCHER); and this only shows application that are preinstalled or can run the ACTION_MAIN Intent type. I also know I can use PackageManager to get all the installed applications, but how do I use this to run a specific application? Thanks

    Read the article

  • Android Facebook SDK : post message without showing facebook page

    - by someone_ smiley
    I am trying to integrate Facebook to my Android app for social post. I have downloaded latest Facebook sdk from here and apply all setup require to post to facebook. Now i can post to facebook. But problem is that, when i run sample program from facebook sdk, a browser like page is open and user have to enter message himself there. but i dont want this page to showed up. i want a fixed message to post directly without opening facebook dialog box. But if there is noway to avoid this, please tell me how can i fixed certain part of message so that user can't modified it. Thanks in Advance Edit: this is message i got after using this project 04-10 11:44:34.691: I/dalvikvm(719): Failed resolving Lnet/xeomax/TestRocket/TestRocket; interface 22 'Lnet/xeomax/FBRocket/LoginListener;' 04-10 11:44:34.691: W/dalvikvm(719): Link of class 'Lnet/xeomax/TestRocket/TestRocket;' failed 04-10 11:44:34.691: D/AndroidRuntime(719): Shutting down VM 04-10 11:44:34.701: W/dalvikvm(719): threadid=1: thread exiting with uncaught exception (group=0x40015560) 04-10 11:44:34.781: E/AndroidRuntime(719): FATAL EXCEPTION: main 04-10 11:44:34.781: E/AndroidRuntime(719): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{net.xeomax.TestRocket/net.xeomax.TestRocket.TestRocket}: java.lang.ClassNotFoundException: net.xeomax.TestRocket.TestRocket in loader dalvik.system.PathClassLoader[/data/app/net.xeomax.TestRocket-1.apk] 04-10 11:44:34.781: E/AndroidRuntime(719): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1569) 04-10 11:44:34.781: E/AndroidRuntime(719): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663) 04-10 11:44:34.781: E/AndroidRuntime(719): at android.app.ActivityThread.access$1500(ActivityThread.java:117) 04-10 11:44:34.781: E/AndroidRuntime(719): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931) 04-10 11:44:34.781: E/AndroidRuntime(719): at android.os.Handler.dispatchMessage(Handler.java:99) 04-10 11:44:34.781: E/AndroidRuntime(719): at android.os.Looper.loop(Looper.java:130) 04-10 11:44:34.781: E/AndroidRuntime(719): at android.app.ActivityThread.main(ActivityThread.java:3683) 04-10 11:44:34.781: E/AndroidRuntime(719): at java.lang.reflect.Method.invokeNative(Native Method) 04-10 11:44:34.781: E/AndroidRuntime(719): at java.lang.reflect.Method.invoke(Method.java:507) 04-10 11:44:34.781: E/AndroidRuntime(719): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 04-10 11:44:34.781: E/AndroidRuntime(719): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 04-10 11:44:34.781: E/AndroidRuntime(719): at dalvik.system.NativeStart.main(Native Method) 04-10 11:44:34.781: E/AndroidRuntime(719): Caused by: java.lang.ClassNotFoundException: net.xeomax.TestRocket.TestRocket in loader dalvik.system.PathClassLoader[/data/app/net.xeomax.TestRocket-1.apk] 04-10 11:44:34.781: E/AndroidRuntime(719): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240) 04-10 11:44:34.781: E/AndroidRuntime(719): at java.lang.ClassLoader.loadClass(ClassLoader.java:551) 04-10 11:44:34.781: E/AndroidRuntime(719): at java.lang.ClassLoader.loadClass(ClassLoader.java:511) 04-10 11:44:34.781: E/AndroidRuntime(719): at android.app.Instrumentation.newActivity(Instrumentation.java:1021) 04-10 11:44:34.781: E/AndroidRuntime(719): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1561) 04-10 11:44:34.781: E/AndroidRuntime(719): ... 11 more

    Read the article

  • Resize image while rotating image in android

    - by dhams
    Hi every one ,,m working with android project in which i want to rotate image along with touch to some fix pivot point ,,,i have completed all the things but i have facing one problem ,,,while m trying to rotate image the image bitmap is resize....i dont have any idea why it occur ....if somebody have den please give me idea to come over this problem.... my code is below ..... package com.demo.rotation; import android.app.Activity; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Matrix; import android.os.Bundle; import android.util.Log; import android.view.MotionEvent; import android.view.View; import android.view.View.OnTouchListener; import android.widget.ImageView; import android.widget.ImageView.ScaleType; public class temp extends Activity{ ImageView img1; float startX; float startX2 ; Bitmap source; Bitmap bitmap1 = null; double r; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); img1 = (ImageView) findViewById(R.id.img1); img1.setOnTouchListener(img1TouchListener); bitmap1 = BitmapFactory.decodeResource(getResources(), R.drawable.orsl_circle_transparent); } private OnTouchListener img1TouchListener = new OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { switch (event.getAction()) { case MotionEvent.ACTION_MOVE: Log.d("MOVE", "1"); if(source!=null) r = Math.atan2(event.getX() - source.getWidth(), (source.getHeight() / 2) - event.getY()); Log.i("startX" + event.getX(), "startY" + event.getY()); rotate(r,bitmap1, img1); img1.setScaleType(ScaleType.CENTER); break; case MotionEvent.ACTION_DOWN: break; case MotionEvent.ACTION_UP: break; default : break; } return true; } }; private void rotate(double r , Bitmap currentBitmap ,ImageView imageView ) { int rotation = (int) Math.toDegrees(r); Matrix matrix = new Matrix(); matrix.setRotate(rotation, currentBitmap.getWidth()/2, currentBitmap.getHeight()/2); source = Bitmap.createBitmap(currentBitmap, 0, 0, currentBitmap.getWidth(), currentBitmap.getHeight(), matrix, false); imageView.setImageBitmap(source); Log.i("HIGHT OF CURRENT BITMAP", ""+source.getHeight()); } }

    Read the article

  • Phonegap/Cordova geolocation not working on Android

    - by Kreeki
    I'm having a trouble to get Geolocation working on Android in both emulator (even when I geo fix over telnet) and on device. Works on iOS, WP8 and in the browser. When I ask device for location using the following code, I always get an error (in my case custom Retrieving your position failed for unknown reason. with null both error code and error message). Related code: successHandler = (position) -> resolve App.Location.create lat: position.coords.latitude lng: position.coords.longitude errorHandler = (error) -> error = switch error.code when 1 App.LocationError.create message: 'You haven\'t shared your location.' when 2 App.LocationError.create message: 'Couldn\'t detect your current location.' when 3 App.LocationError.create message: 'Retrieving your position timeouted.' else App.LocationError.create message: 'Retrieving your position failed for unknown reason. Error code: ' + error.code + '. Error message: ' + error.message reject(error) options = maximumAge: Infinity # I also tried with 0 timeout: 60000 enableHighAccuracy: true navigator.geolocation.getCurrentPosition(successHandler, errorHandler, options) platforms/android/AndroidManifest.xml <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" /> www/config.xml (just in case) <feature name="Geolocation"> <param name="android-package" value="org.apache.cordova.GeoBroker" /> </feature> Using Cordova 3.1.0. Testing on Android 4.2. Plugin installed. Cordova.js included in index.html (other plugins like InAppBrowser are working fine). $ cordova plugins ls [ 'org.apache.cordova.console', 'org.apache.cordova.device', 'org.apache.cordova.dialogs', 'org.apache.cordova.geolocation', 'org.apache.cordova.inappbrowser', 'org.apache.cordova.vibration' ] I'm clueless. Am I missing something?

    Read the article

  • Targeting Android with Scala 2.8 Trunk builds

    - by Kevin Wright
    The definitive reference for using Scala on android seems to be here: http://www.scala-lang.org/node/160 Unfortunately, all the references on using scala with android are based around Scala 2.7 and refer to a custom build android-library.jar, with a couple of cryptic references suggesting that this custom build isn't needed for later versions of android (I'm using 2.1 / API v7) So... What are the steps needed to use Scala 2.8 in an android project? Preferably using eclipse and the Android tools that Google supplies for that IDE.

    Read the article

  • Android: Displaying Video on VideoView

    - by AndroidDev93
    I'm trying to display a video in my sdcard on the video view. Here is my code: String name = Environment.getExternalStorageDirectory() + "/test.mp4"; final VideoView videoView = (VideoView)findViewById(R.id.videoView1); videoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() { public void onPrepared(MediaPlayer arg0) { videoView.start(); } }); videoView.setVideoPath(name); The file I am trying to open is called test.mp4 and its located within the sdcard folder. I get an error saying the application has unfortunately stopped. I would appreciate it if someone could help me. Thanks. EDIT : I used the debugger and found out that I get an InvocationTargetException. The detailed message says that : Failure delivering result ResultInfo{who=null, request=1001, result=-1, data=Intent { dat=file:///mnt/sdcard/test.mp4 }} to activity : java.lang.NullPointerException EDIT : I looked at the logcat again and it seems to give the error at videoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() { I'm guessing either videoView or MediaPlayer is null.

    Read the article

  • passing int into android activities

    - by Dawood Abbasi
    i pass int to next activity using this code Intent intent = new Intent(A.this, B.class); intent.putExtra("selectedType", i); startActivity(intent); and then receive this in activity B Intent intent = new Intent(); int i = intent.getIntExtra("selectedType", 0); Toast.makeText(getApplicationContext(), String.valueOf(i), Toast.LENGTH_LONG).show(); but when in this activity, it always display 0.

    Read the article

  • Android Asyncronous calls

    - by Josemalive
    Hi, Im making an asyncronous call from a client class to a server class. From this client class i call the method "execute", and in background the server class call the "doInBackground" method. How could i know from the client class when the "doInBackground" is finished? Should i implement an event on the server class and suscribe to it from the client one? Thanks in advance. Best Regards. Josema.

    Read the article

  • jQuery XML loading and then innerfade effect

    - by Ryan Max
    Hello, I think I can explain myself without code, so for brevity's sake here we go: I am using jquery to pull data from an xml and put it into a ul on the page with each xml entry as a li. This is working great! However, what I am trying to do afterwards is use the innerfade plugin to make a simple animation between each of the li's. It's not working though, as it is still just loading the static list with each item visible (whereas if innerfade was working it would only display the first....then fade into the second, etc) It's not an innerfade problem however, because if I add the list in manually to the page (not injecting it with jquery) then the innerfade works fine. I'm relatively new to DOM scripting, so I think I am missing something here. I'm not quite sure how jQuery sequences everything, and I'm having trouble phrasing my question in a search engine friendly manner so here I am. Is it possible to have jquery pull the data from xml, then inject it into the page, then have innerfade work it's magic? Or am I thinking about this the wrong way? xml code: $.ajax({ type: "GET", url: "xml/playlist.xml", dataType: "xml", success: function(xml) { $(xml).find('song').each(function(){ var name = $(this).attr('title'); var date = $(this).attr('artist'); var message = $(this).attr('path'); $('<li></li>').html('<span id="an_name">'+name+'</span><span id="an_date">'+date+'</span><span id="an_message">'+message+'</span>').appendTo('#anniversary'); }); } }); innerfade code: <script type="text/javascript"> jQuery.noConflict(); jQuery(document).ready( function(){ jQuery('#anniversary').innerfade({ speed: 1000, timeout: 5000, type: 'sequence', }); });

    Read the article

  • Android - Having a service run every day at 4AM

    - by Bara
    Hello everyone, I would like to know the best practices for running a Service every day at 4AM. The way I think I should be doing it is to create a new repeating alarm using AlarmManager and having it run the service at 4AM. Problem is, I'm not sure where to put the code to set the alarm. Do I do it in my main activity as one of the first tasks in the OnCreate method? Do I do some funky stuff with BroadcastReceivers and intents? What happens when a user updates my app? What happens when a user restarts? Any help with these questions would be much appreciated :) Sample code would be helpful as well! Bara

    Read the article

  • Android adding HTML content on a webview without space

    - by Rahul
    I am trying to add an HTML content to a web view. If the words in the HTML content are without spaces then webview keeps that particular word on the same line.I want that content to be wrapped and be on the next line.Is it possible to do that.I am attaching a sample code that can reproduce the issue. String temp="<p>WebViewallowsyoutocreateyourownwindowforviewingwebpages(orevendevelopacompletebrowser).Inthistutorial,youcreateasimpleActivitythatcanviewandnavigatewebpages.1.CreateanewprojectnamedHelloWebView.</p>"; WebView wb=new WebView(this); wb.loadDataWithBaseURL("", temp, "text/html", Encoding.UTF_8.toString(),""); setContentView(wb);

    Read the article

  • Button selection in Android

    - by dreamhigh
    I have to create button options where each button performs specific task. So how to do the button selection. The code I tried is here. Button b1 b1.setOnClickListener(new Button.OnClickListener(){ public void onClick(View v) { if(v.getId()==R.id.button1) { //do something } if(v.getId()==R.id.button2) { //do something } }); For single button function its working fine with this code. Button b1= (Button)findViewById(R.id.button1); b1.setOnClickListener(new Button.OnClickListener(){ public void onClick(View v) { if(v.getId()==R.id.button1) { //do something } }});

    Read the article

  • Is my fragment usage correct, seems to be slow on adnroid

    - by Robertoq
    My app structure is that i have a menu with 5 menu-point om the left side, and the content on the right side. MainActivity.xml <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" > <fragment android:id="@+id/fragmentMenu" android:name="com.example.FragmentMenu" android:layout_width="@dimen/MenuWidth" android:layout_height="match_parent" /> <LinearLayout android:id="@+id/content" android:layout_width="match_parent" android:layout_height="match_parent" android_layout_toRightOf="@+id/fragmentMenu" android:orientation="vertical"/> </RelativeLayout> MainActivity.java public class FragmentActivityMain extends FragmentActivity { @Override protected void onCreate(final Bundle arg0) { super.onCreate(arg0); setContentView(R.layout.fragment_activity_main); FragmentManager fm = getSupportFragmentManager(); FragmentMenu fragmentMenu = (FragmentMenu) fm.findFragmentById(R.id.fragmentMenu); fragmentMenu.init(); } } And certainly I have a FragmenMenu class, public class FragmentMenu extends ListFragment { @Override public View onCreateView(final LayoutInflater inflater, final ViewGroup container, final Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_menu, container, false); return view; } public init() { FragmentManager fm = getFragmentManager(); FragmentTransaction ft = fm.beginTransaction(); FragmentNowListView lw = new FragmentCarListView(); ft.add(R.id.content, lw); ft.commit(); } } The FragmentCarList is a simple list, now with static test data, only five items in a List My Problem: Slow. I tested the app on my phone (Galaxy S3) and I see white screen when app starting, around 0,5 second and this is the log: 10-29 11:43:44.093: D/dalvikvm(29710): GC_CONCURRENT freed 267K, 5% free 13903K/14535K, paused 10ms+2ms 10-29 11:43:44.133: D/dalvikvm(29710): GC_FOR_ALLOC freed 215K, 6% free 13896K/14663K, paused 12ms 10-29 11:43:44.233: D/dalvikvm(29710): GC_FOR_ALLOC freed 262K, 6% free 13901K/14663K, paused 12ms 10-29 11:43:44.258: D/dalvikvm(29710): GC_FOR_ALLOC freed 212K, 6% free 13897K/14663K, paused 13ms 10-29 11:43:44.278: D/dalvikvm(29710): GC_FOR_ALLOC freed 208K, 6% free 13897K/14663K, paused 12ms 10-29 11:43:44.328: D/dalvikvm(29710): GC_FOR_ALLOC freed 131K, 4% free 14098K/14663K, paused 12ms 10-29 11:43:44.398: D/dalvikvm(29710): GC_CONCURRENT freed 20K, 3% free 14559K/14919K, paused 1ms+4ms And when I tested on Xperia Ray, the whit screen appear longer time. How can I optimize my fragments? Thx

    Read the article

  • Android Layout: Why don't the TextView and a ToggleButton align

    - by Ally
    I'm trying to put a TextView and a ToggleButton in a table row, however, they don't seem to align (The top of the button starts about 10px below the top of the textview even though the height each element is the same. Can anyone tell me why? <TableLayout android:layout_width="fill_parent" android:layout_height="wrap_content" > <TableRow> <AutoCompleteTextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" android:layout_weight="1" /> <ToggleButton android:layout_width="wrap_content" android:layout_height="wrap_content" /> </TableRow> </TableLayout>

    Read the article

< Previous Page | 77 78 79 80 81 82 83 84 85 86 87 88  | Next Page >