Search Results

Search found 1238 results on 50 pages for 'emulator'.

Page 17/50 | < Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >

  • how to Set already running activity, when user clicks on app icon on home screen

    - by Praveenb
    I have Two activities One splash screen, Player screen. When user clicks on my app icon first splash screen is displayed and then player screen When player activity is running, if user returns to the home screen and then again clicks on app icon, the application is starting from the splash screen again. can any one please help me out how to do any one of below 1) I need to close current running activity and reload application. or 2) I need to resume to the player screen directly. Please give me an example or reference to follow, Im beginner in android programing Thanks In advance

    Read the article

  • AudioRecord problems with non-HTC devices

    - by Marc
    I'm having troubles using AudioRecord. An example using some of the code derived from the splmeter project: private static final int FREQUENCY = 8000; private static final int CHANNEL = AudioFormat.CHANNEL_CONFIGURATION_MONO; private static final int ENCODING = AudioFormat.ENCODING_PCM_16BIT; private int BUFFSIZE = 50; private AudioRecord recordInstance = null; ... android.os.Process.setThreadPriority(android.os.Process.THREAD_PRIORITY_URGENT_AUDIO); recordInstance = new AudioRecord(MediaRecorder.AudioSource.MIC, FREQUENCY, CHANNEL, ENCODING, 8000); recordInstance.startRecording(); short[] tempBuffer = new short[BUFFSIZE]; int retval = 0; while (this.isRunning) { for (int i = 0; i < BUFFSIZE - 1; i++) { tempBuffer[i] = 0; } retval = recordInstance.read(tempBuffer, 0, BUFFSIZE); ... // process the data } This works on the HTC Dream and the HTC Magic perfectly without any log warnings/errors, but causes problems on the emulators and Nexus One device. On the Nexus one, it simply never returns useful data. I cannot provide any other useful information as I'm having a remote friend do the testing. On the emulators (Android 1.5, 2.1 and 2.2), I get weird errors from the AudioFlinger and Buffer overflows with the AudioRecordThread. I also get a major slowdown in UI responsiveness (even though the recording takes place in a separate thread than the UI). Is there something apparent that I'm doing incorrectly? Do I have to do anything special for the Nexus One hardware?

    Read the article

  • AVD properties for Motorola Flipout?

    - by kefs
    I'm looking to create AVDs to test my apps on, and i'm trying to figure out the correct settings for a square screen such as the new Motorola Flip Out. I don't see a wikipedia article for it, or many specs... On a related note, what about tablets? Actually.. Why aren't there a set of AVD instances with params from popular devices.. or at least a site that lists them for each of the 60+ devices. Thanks in advance :)

    Read the article

  • Application icon not transferred to Android device

    - by Praveenb
    I want to deploy my application with Android 2.1 features. I placed an application icon in PNG format in the drawable-ldpi,and drawable-hdpi folders. When I installed to the device, it is not showing the application icon on the home screen of the device. Please help me how to solve this issue?

    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

  • Why doesn't my text be bold when displaying on device screen

    - by john123
    My string.xml: <!--I try to bold my argument %s, like below:--> <string name="hello">Hello to: <b>%s</b> !</string> My layout main.xml: <LinearLayout ...> <TextView android:id="@+id/hello_txt" ... .../> </LinearLayout> My Fragment class: public class MyFragment extends Fragment{ TextView helloTxt; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { super.onCreateView(inflater, container, savedInstanceState); helloTxt = (TextView) findViewById(R.id.hello_txt); } @Override public void onStart() { super.onStart(); //pass "Monday" as the argument to my string helloTxt.setText(String.format(getString(R.string.hello), "Monday")); } } When I run my app on my device, I got "Hello to: Monday !" displaying on screen, but the "Monday" is not bold, but I used <b> in my string.xml. Why it is not bold??

    Read the article

  • callback in android?

    - by androidbase Praveen
    in android application development, i frequently go through the word "CALLBACK" in many places. i want to know want it means to tell us technically. and how i can manage the callback of the applications. i would need a guidance to understand about it....

    Read the article

  • Get address using Geocoder in android

    - by user264953
    Hi, I tried to get the address of a particular location by giving static geocordinates. I was not able to fetch the address. Can someone please help. I just need to check whether this function works for me. Here is my snippet. Geocoder geocoder = new Geocoder(AddressSimulator.this, Locale.getDefault()); List<Address> addresses = geocoder.getFromLocation(1.352566007, 103.78921587, 1); System.out.println("Addresses size"+addresses.size()); Address size is obtained as zero. I tried with few other geocordinates also, but address size is always returned as 0. Experts, kindly help me resolve this. Looking forward for your valuable help/suggestions, Best Regards, Rony

    Read the article

  • How to receive sms from a special phone number?

    - by Pariya
    I wrote a send and receive sms in android successfully. I want my program to be able to receive sms from a special number("+9856874236"). But, if the SMS is from any other number, it should go to the phone's message inbox and not to my application. import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.telephony.SmsMessage; import android.util.Log; public class SmsReceiver extends BroadcastReceiver { public String str = ""; @Override public void onReceive(Context context, Intent intent) { Bundle bundle = intent.getExtras(); Object messages[] = (Object[]) bundle.get("pdus"); SmsMessage[] msgs = null; if (bundle != null) { Object[] pdus = (Object[]) bundle.get("pdus"); SmsMessage smsMessage[] = new SmsMessage[messages.length]; String msg_from=""; for (int n = 0; n < messages.length; n++) { smsMessage[n] = SmsMessage.createFromPdu((byte[]) messages[n]); msg_from += msgs[n].getOriginatingAddress(); } String receivedMessage = smsMessage[0].getMessageBody().toString().toUpperCase(); if(msg_from .equals("+989124236870")) { for (int n = 0; n < messages.length; n++) { smsMessage[n] = SmsMessage.createFromPdu((byte[]) pdus[n]); str += "SMS from " + msgs[n].getOriginatingAddress(); str += " :"; //str += "sms az shomare makhsus"; str += msgs[n].getMessageBody().toString(); str += "\n"; abortBroadcast(); } Intent act = new Intent(context, MainActivity.class); act.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); act.putExtra("message", str); context.startActivity(act); } } } }

    Read the article

  • Can we use preferences accress multiple different acvtivities in android?

    - by Maneesh
    I save preferences in one activities but not able to get saved preferences in other activity. I can access saved preferences in the same activity but not in other one. It is not giving me any error but always gibing null values in second activity. Below is the code: First Activity: SharedPreferences.Editor editor; editor.putString("token", access_token); editor.commit(); Second Activity: SharedPreferences prefs = getSharedPreferences(PREFS_NAME, 0);//getPreferences(0); String restoredtoken = prefs.getString("token", null); if (restoredtoken== null) { ///doing some task; }

    Read the article

  • How to clear all activity in android?

    - by Sushant
    I have one main activity "Dashboard" with a action bar containing home screen icon and exit button , i go to activity A -activity B -activity C from dashboard screen . Now on C, i click on action bar dashboard icon which bring to me on Dashboard screen . Now i go to activity E -activity G-activity H from dashboard screen . From H i press exit button , it come to C screen . When again click on exit i go through me out of application. Why there is need to press 2 times exit button for exit application . On Home Screen Icon :- public void onClickHome(View view){ final Intent intent = new Intent(getBaseContext(), Dashboard.class); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); getBaseContext().startActivity(intent); //goDashboard(); } ON exit button :- AlertDialog.Builder alert = new AlertDialog.Builder(this); alert.setTitle(getString(R.string.logoutDialogTitle)); alert.setMessage(getString(R.string.logoutDialogMessage)); final OnlineBookApp app = (OnlineBookApp) getApplicationContext(); alert.setPositiveButton(getString(R.string.logoutDialogCancel), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { } }); alert.setNegativeButton(getString(R.string.logoutDialogOk), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { //finish(); //stopService(new Intent(getBaseContext(), DatabaseSyncService.class)); // // moveTaskToBack(true); //// stopService(new Intent(getBaseContext(), DatabaseSyncService.class)); // System.runFinalizersOnExit(true); // android.os.Process.killProcess(android.os.Process.myPid()); //moveTaskToBack(true); // finish(); // app.SetIsExit(true); Intent intent = new Intent(getApplicationContext(), Dashboard.class); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); intent.putExtra("EXIT", true); startActivity(intent); } }); alert.setNeutralButton(getString(R.string.logoutDialogLogout), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { //finish(); //stopService(new Intent(getBaseContext(), DatabaseSyncService.class)); //finish(); //app.SetIsExit(true); //stopService(new Intent(getBaseContext(), DatabaseSyncService.class)); app.logout(); Intent intent = new Intent(getApplicationContext(), Dashboard.class); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); intent.putExtra("EXIT", true); startActivity(intent); } }); alert.show();

    Read the article

  • The application has stopped unexpectedly: How to Debug?

    - by Android Eve
    Please note, unlike many other questions having the subject title "application has stopped unexpectedly", I am not asking for troubleshooting a particular problem. Rather, I am asking for an outline of the best strategy for an Android/Eclipse/Java rookie to tackle this formidable task of digesting huge amounts of information in order to develop (and debug!) a simple Android application. In my case, I took the sample skeleton app from the SDK, modified it slightly and what did I get the moment I try to run it? The application (process.com.example.android.skeletonapp) has stopped unexpectedly. Please try again. OK, so I know that I have to look LogCat. It's full of timestamped lines staring at me... What do I do now? What do I need to look for? Is there a way to single-step the program, to find the statement that makes the app crash? (I thought Java programs never crash, but apparently I was mistaken) How do I place a breakpoint? Can you recommend an Android debug tutorial online, other than this one?

    Read the article

  • Error in Android's clearCheck() for RadioGroup?

    - by Manuel R. Ciosici
    I'm having an issue with RadioGroup's clearChecked(). I'm displaying a multiple choice question to the user and after the user selects an answer I check the answer, give him some feedback and then move to the next question. In the process of moving to the next question I clearCheck on the RadioGroup. Can anyone explain to me why the onCheckedChanged method is called 3 times? Once when the change actually occurs (with the user changes), once when I clearCheck(with -1 as the selected id) and once in between (with the user changes again)? As far as I could tell the second trigger is provoked by clearCheck. Code below: private void checkAnswer(RadioGroup group, int checkedId){ // this makes sure it doesn't blow up when the check is cleared // also we don't check the answer when there is no answer if (checkedId == -1) return; if (group.getCheckedRadioButtonId() == -1) return; // check if correct answer if (checkedId == validAnswerId){ score++; this.giveFeedBack(feedBackType.GOOD); } else { this.giveFeedBack(feedBackType.BAD); } // allow for user to see feedback and move to next question h.postDelayed(this, 800); } private void changeToQuestion(int questionNumber){ if (questionNumber >= this.questionSet.size()){ // means we are past the question set // we're going to the score activity this.goToScoreActivity(); return; } //clearing the check gr.clearCheck(); // give change the feedback back to question imgFeedback.setImageResource(R.drawable.question_mark); //OTHER CODE HERE } and the run method looks like this public void run() { questionNumber++; changeToQuestion(questionNumber); }

    Read the article

  • Placing the where condition

    - by user182944
    I came up with the below query: SELECT ROOMNO,BUILDINGNO FROM MRM_ROOM_DETAILS WHERE ROOMID IN ( SELECT distinct roomid FROM MRM_BOOKING_DETAILS WHERE (CHECKIN NOT BETWEEN '2012-04-13 09:50:00' AND '2012-04-13 10:20:00') AND (CHECKOUT NOT BETWEEN '2012-04-13 09:50:00' AND '2012-04-13 10:20:00')) AND CAPACITY > 15 AND PROJECTIONSTATUS = 'NO'; I need to place this query in the method SQLiteDatabase.query() and fetch the rows accordingly. I am not able to understand how to place this big where condition (which contains a sub-query as well) in place of the "String selection" i.e. 3rd parameter of the method. Shall i simple write the entire where part(including the sub-query) as a string in the 3rd parameter or else there is some other better way for doing the same? Please suggest me the best way to do the same. Regards,

    Read the article

  • Why would you use the ternary operator without assigning a value for the "true" condition?

    - by RickNotFred
    In the Android open-source qemu code I ran across this line of code: machine->max_cpus = machine->max_cpus ?: 1; /* Default to UP */ It this just a confusing way of saying: if (machine->max_cpus) { ; //do nothing } else { machine->max_cpus = 1; } If so, wouldn't it be clearer as: if (machine->max_cpus == 0) machine->max_cpus = 1; Interestingly, this compiles and works fine with gcc, but doesn't compile on http://www.comeaucomputing.com/tryitout/ .

    Read the article

  • Windows Phone 7 development: first impressions

    - by DigiMortal
    After hard week in work I got some free time to play with Windows Phone 7 CTP developer tools. Although my first test application is still unfinished I think it is good moment to share my first experiences to you. In this posting I will give you quick overview of Windows Phone 7 developer tools from developer perspective. If you are familiar with Visual Studio 2010 then you will feel comfortable because Windows Phone 7 CTP developer tools base on Visual Studio 2010 Express. Project templates There are five project templates available. Three of them are based on Silverlight and two on XNA Game Studio: Windows Phone Application (Silverlight) Windows Phone List Application (Silverlight) Windows Phone Class Library (Silverlight) Windows Phone Game (XNA Game Studio) Windows Phone Game Library (XNA Game Studio) Currently I am writing to test applications. One of them is based on Windows Phone Application and the other on Windows Phone List Application project template. After creating these projects you see the following views in Visual Studio. Windows Phone Application. Click on image to enlarge. Windows Phone List Application. Click on image to enlarge.  I suggest you to use some of these templates to get started more easily. Windows Phone 7 emulator You can run your Windows Phone 7 applications on Windows Phone 7 emulator that comes with developer tools CTP. If you run your application then emulator is started automatically and you can try out how your application works in phone-like emulator. You can see screenshot of emulator on right. Currently there is opened Windows Phone List Application as it is created by default. Click on image to enlarge it. Emulator is a little bit slow and uncomfortable but it works pretty well. This far I have caused only couple of crashes during my experiments. In these cases emulator works but Visual Studio gets stuck because it cannot communicate with emulator. One important note. Emulator is based on virtual machine although you can see only phone screen and options toolbar. If you want to run emulator you must close all virtual machines running on your machine and run Visual Studio 2010 as administrator. Once you run emulator you can keep it open because you can stop your application in Visual Studio, modify, compile and re-deploy it without restarting emulator. Designing user interfaces You can design user interface of your application in Visual Studio. When you open XAML-files it is displayed in window with two panels. Left panel shows you device screen and works as visual design environment while right panel shows you XAML mark-up and let’s you modify XML if you need it. As it is one of my very first Silverlight applications I felt more comfortable with XAML editor because property names in property boxes of visual designer confused me a little bit. Designer panel is not very good because it is visually hard to follow. It has black background that makes dark borders of controls very hard to see. If you have monitor with very high contrast then it is may be not a real problem. I have usual monitor and I have problem. :) Putting controls on design surface, dragging and resizing them is also pretty painful. Some controls are drawn correctly but for some controls you have to set width and height in XML so they can be resized. After some practicing it is not so annoying anymore. On the right you can see toolbox with some controllers. This is all you get out of the box. But it is sufficient to get started. After getting some experiences you can create your own controls or use existing ones from other vendors or developers. If it is your first time to do stuff with Silverlight then keep Google open – you need it hard. After getting over the first shock you get the point very quickly and start developing at normal speed. :) Writing source code Writing source code is the most familiar part of this action. Good old Visual Studio code editor with all nice features it has. But here you get also some surprises: The anatomy of Silverlight controls is a little bit different than the one of user controls in web and forms projects. Windows Phone 7 doesn’t run on full version of Windows (I bet it is some version of Windows CE or something like this) then there is less system classes you can use. Some familiar classes have less methods that in full version of .NET Framework and in these cases you have to write all the code by yourself or find libraries or source code from somewhere. These problems are really not so much problems than limitations and you get easily over them. Conclusion Windows Phone 7 CTP developer tools help you do a lot of things on Windows Phone 7. Although I expected better performance from tools I think that current performance is not a problem. This far my first test project is going very well and Google has answer for almost every question. Windows Phone 7 is mobile device and therefore it has less hardware resources than desktop computers. This is why toolset is so limited. The more you need memory the more slower is device and as you may guess it needs the more battery. If you are writing apps for mobile devices then make your best to get your application use as few resources as possible and act as fast as possible.

    Read the article

  • Try out Windows Phone 7 on your PC today

    - by Matthew Guay
    Anticipation has been building for the new Windows Phone 7 Series ever since Microsoft unveiled it at the Mobile World Congress in February.  Now, thanks to free developer tools, you can get a first-hand experience of the basic Windows Phone 7 Series devices on your PC. Windows Phone 7 Series represents a huge change in the mobile field for Microsoft, bringing the acclaimed Zune HD UI to an innovative phone platform.  Windows Mobile has often been criticized for being behind other Smartphone platforms, but Microsoft seeks to regain the lead with this new upcoming release.  A platform must have developers behind it to be useful, so they have released a full set of free development tools so anyone can make apps for it today.  Or, if you simply want to play with Windows Phone 7, you can use the included emulator to try out the new Metro UI.  Here’s how to do this today on your Vista or 7 computer. Please note: These tools are a Customer Technology Preview release, so only install them if you’re comfortable using pre-release software. Getting Started First, download the Windows Phone Developer Tools CTP (link below), and run the installer.  This will install the Customer Technology Preview (CTP) versions of Visual Studio 2010 Express for Windows Phone, Windows Phone Emulator, Silverlight for Windows Phone, and XNA 4.0 Game Studio on your computer, all of which are required and cannot be installed individually. Accept the license agreement when prompted. Click “Install Now” to install the tools you need.  The only setup customization option is where to save the files, so choose Customize if you need to do so. Setup will now automatically download and install the components you need, and will additionally download either 32 or 64 bit programs depending on your operating system. About halfway thorough the installation, you’ll be prompted to reboot your system.  Once your computer is rebooted, setup will automatically resume without further input.   When setup is finished, click “Run the Product Now” to get started. Running Windows Phone 7 on your PC Now that you’ve got the Windows Phone Developer tools installed, it’s time to get the Windows Phone emulator running.  If you clicked “Run the Product Now” when the setup finished, Visual Studio 2010 Express for Windows Phone should have already started.   If not, simply enter “visual studio” in your start menu search and select “Microsoft Visual Studio 2010 Express for Windows Phone”. Now, to run the Windows Phone 7 emulator, we have to test an application.  So, even if you don’t know how to program, we can open a phone application template, and then test it to run the emulator.  First, click New Project on the left hand side of the front page. Any of the application templates would work for this, but here let’s select “Windows Phone Application”, and then click Ok. Here’s your new application template, which already contains the basic phone application framework.  This is where you’d start if you want to develop a Windows Phone app, but for now we just want to see Windows Phone 7 in action. So, to run the emulator, click Debug in the menu and then select Start Debugging. Your new application will launch inside the Windows Phone 7 Series emulator.  The default template doesn’t give us much, but it does show an example application running in Windows Phone 7.   Exploring Windows Phone 7 Click the Windows button on the emulator to go to the home screen.  Notice the Zune HD-like transition animation.  The emulator only includes Internet Explorer, your test application, and a few settings. Click the arrow on the right to see the available applications in a list. Settings lets you change the theme, regional settings, and the date and time in your emulator.  It also has an applications settings pane, but this currently isn’t populated. The Time settings shows a unique Windows Phone UI. You can return to the home screen by pressing the Windows button.  Here’s the Internet Explorer app running, with the virtual keyboard open to enter an address.  Please note that this emulator can also accept input from your keyboard, so you can enter addresses without clicking on the virtual keyboard. And here’s Google running in Internet Explorer on Windows Phone 7. Windows Phone 7 supports accelerometers, and you can simulate this in the emulator.  Click one of the rotate buttons to rotate the screen in that direction. Here’s our favorite website in Internet Explorer on Windows Phone 7 in landscape mode. All this, running right inside your Windows 7 desktop… Developer tools for Windows Phone 7 Although it may be fun to play with the Windows Phone 7 emulator, developers will be more excited to actually be able to create new and exciting apps for it.  The Windows Phone Developer Tools download includes Visual Studio Express and XNA Game Studio 4.0 which lets you create enticing games and apps for Windows Phones.  All development for Windows Phones will be in C#, Silverlight, and the XNA game framework.  Visual Studio Express for Windows Phone includes templates for these, and additionally has code samples to help you get started with development. Conclusion Many features are still not functional in this preview version, such as the search button and most of the included applications.  However, this still gives you a great way to experience firsthand the future of the Windows Phone platform.  And, for developers, this is your chance to set your mark on the Windows Phone 7 Series even before it is released to the public.  Happy playing and developing! Links Download Windows Phone Developer Tools CTP Windows Phone Developer Site Similar Articles Productive Geek Tips Keep Track of Homework Assignments with SoshikuWeekend Fun: Watch Television On Your PC With TVUPlayerEasily Manage Your Downloads with Download StatusbarCreate a Shortcut or Hotkey to Mute the System Volume in WindowsHow-To Geek on Lifehacker: How to Make Windows Vista Less Annoying TouchFreeze Alternative in AutoHotkey The Icy Undertow Desktop Windows Home Server – Backup to LAN The Clear & Clean Desktop Use This Bookmarklet to Easily Get Albums Use AutoHotkey to Assign a Hotkey to a Specific Window Latest Software Reviews Tinyhacker Random Tips Revo Uninstaller Pro Registry Mechanic 9 for Windows PC Tools Internet Security Suite 2010 PCmover Professional Convert the Quick Launch Bar into a Super Application Launcher Automate Tasks in Linux with Crontab Discover New Bundled Feeds in Google Reader Play Music in Chrome by Simply Dragging a File 15 Great Illustrations by Chow Hon Lam Easily Sync Files & Folders with Friends & Family

    Read the article

< Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >