Notes

This is where I plan to put notes (quickly) before I put the information in better places around this site. This is bascially a scratchpad page ...

Random Notes

Sites

  • http://anddev.org/

http://www.anddev.org/viewtopic.php?t=81 -life cycle
http://code.google.com/android/reference/android/net/package-summary.html
http://code.google.com/android/reference/android/app/Activity.html
http://dl.google.com/android/android_sdk_linux_m3-rc22a.zip


map1 try { Intent myIntent = new Intent(android.content.Intent.VIEW_ACTION, new ContentURI("geo:38.899533,-77.036476")); startActivity(myIntent); } catch (URISyntaxException e) { }
startSubActivity(new Intent(this, MySecondActivity.class), 0);
simulate incoming call: http://www.anddev.org/viewtopic.php?t=135
telnet localhost 5554 gsm call 12345
Hi There, I don't know about the phone number off the top of my head, but here's what I've learnt from my experience with getting GPS location: *** Get GPS Location of Device *** 1. The first thing you need to do is get a handler to the LocationManager system service: //Get handler to system location manager LocationManager locMan = (LocationManager) getSystemService(Context.LOCATION_SERVICE); 2. Then you need to get a LocationProvider (an object that provides periodic reports on the geographical location of the device): // Get the first provider available List providers = locMan.getProviders(); LocationProvider provider = providers.get(0); This will get the first provider available, which should be the default gps provider that comes with the emulator (and isn't too useful - you'll be better off creating your own mock provider - which I'll happily explain how to do on request). Note: instead of working this way you can request a LocationProvider based on a minimum Criteria it must meet using the method: getBestProvider(Criteria criteria). 3a. You can then either simply query the current location using: //Returns a new location fix from the given provider Location curLoc = locMan.getCurrentLocation(provider.getName()); 3b. Or register for periodic location updates using the method of the LocationMananger: requestUpdates(LocationProvider provider, long minTime, float minDistance, Intent intent) Which receives updates by you creating a IntentReceiver that listens for intents of the type passed into the method. The current location data can then be retrieved from the fired Intent as a Location object by calling intent.getExtra("location"). I won't explain this in great detail right now, but if you do want to know more just ask. 4. If you're going to use the Location with a MapView you'll then need to 'wrap' it in a Point by using: Point curLocAsPoint = new Point((int)(curLoc.getLatitude() * 1000000), (int)(curLoc.getLongitude() * 1000000)); But that's optional depending on what you're doing. *** End *** Some good pages to look at are: http://code.google.com/android/toolbox/apis/lbs.html http://code.google.com/android/reference/android/location/package-summary.html And there's a good example of a location based map application at http://anddev.org/ in the Map Applications section. If you need any more help, please feel free to ask. Regards, Steve
Try the WebView class. See http://code.google.com/android/reference/android/webkit/WebView.html I think you can open a website with loadUrl("http://www.yahoo.com") . If you just want to launch the browser to a URL you can create an launch an intent similar to: Intent myIntent = new Intent(Intent.VIEW_ACTION,ContentURI.create("http://www.yahoo.com")); startActivity(myIntent);
http://www.anddev.org/viewtopic.php?t=99 to do user input
http://code.google.com/android/devel/ui/hierarchy.html http://code.google.com/android/reference/view-gallery.html http://code.google.com/android/reference/available-intents.html http://code.google.com/android/devel/ui/layout.html - common layout objects, view groups http://code.google.com/android/devel/ui/xml.html - designing screen in xml http://code.google.com/android/devel/building-blocks.html application building blocks: http://code.google.com/android/devel/bblocks-manifest.html - AndroidManifest.xml http://code.google.com/android/reference/android/app/Activity.html http://code.google.com/android/reference/android/view/View.html http://code.google.com/android/reference/android/content/Intent.html http://code.google.com/android/reference/android/app/Service.html http://code.google.com/android/reference/android/app/NotificationManager.html http://code.google.com/android/reference/android/content/ContentProvider.html http://code.google.com/android/toolbox/performance.html http://code.google.com/android/toolbox/responsiveness.html - Developing Responsive Applications http://code.google.com/android/toolbox/seamlessness.html That is, don't spawn Activities from IntentReceivers or Services running in the background. Doing so will interrupt whatever application is currently running, and result in an annoyed user. Perhaps even worse, your Activity may become a "keystroke bandit" and receive some of the input the user was in the middle of providing to the previous Activity. Depending on what your application does, this could be bad news. nstead of spawning Activities directly from the background, you should instead use the NotificationManager to set Notifications. These will appear in the status bar, and the user can then click on them at his leisure, to see what your application has to show him. (Note that all this doesn't apply to cases where your own Activity is already in the foreground: in that case, the user expects to see your next Activity in response to input.) http://code.google.com/android/toolbox/custom-components.html http://code.google.com/android/toolbox/apis/media.html http://www.droiddraw.org/