It is currently Wed Jun 19, 2013 8:46 pm

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: My Random Android Web Search Notes!!!
PostPosted: Fri Jan 22, 2010 4:30 pm 
Offline

Joined: Sun Dec 27, 2009 1:59 pm
Posts: 41
Author: Yassin Matan
President
Somforce Inc.
...

##########################################################################

----THIS IS A NEW SITE.....STILL UNDER DEVELOPMENT...ANY HELP WILL BE APPRECIATED----

****** IF YOU LIKE WHAT YOU SEE, PLEASE REGISTER AND CONTRIBUTE YOUR OWN LINKS / REFERENCES / NOTES ETC.. ********

DON'T FORGET TO CHECK OUT THE REST OF THE SITE FOR MORE USEFUL INFO...

I am donating my time to develop a centralized Android Web Notes/Ideas/Tutorials/Code/Documents/References/All Android Web Sites...In ONE place etc
These are my own Android web notes I gathered for my App Developments. They are not in any order. I also attached several files that I found on the web that may help you learn more. I will add more

Enjoy.

###########################################################################

ALL TUTORIALS HOW TO

HOT HOT HOT....just weeks old tutorials
http://marakana.com/forums/android/android_examples/

Also more...
BEST ==> Source Code to _Android Programming Tutorials (Thanks to Commonsguy at... http://commonsware.com/AndTutorials/ )
You can download each tutorial on the upper right hand corner (Download Source button)
http://github.com/commonsguy/cw-andtutorials


OTHER TUTORIALS HOW TO
http://www.codebeach.com/tag/android,tu ... 70098885/2

and

http://androidcommunity.com/forums/f4/w ... -here-137/

And/or

and mixture of tutorials
http://saigeethamn.blogspot.com/2009/08 ... l-for.html

More great tutorials
http://blog.pocketjourney.com/category/tutorials/

More code and tutorials
http://www.droidnova.com/category/how-to

and more
http://www.dreamincode.net/forums/showforum129.htm


Google app - API Demos
http://d.android.com/resources/samples/ ... index.html


Android 2.1 Development with Eclipse 3.5 - Tutorial...
http://www.vogella.de/articles/Android/article.html


Android 2.0 Features Snapshot
http://www.aboutonlinetips.com/android- ... -snapshot/

Android 2.0 screenshot walkthrough
http://www.boygeniusreport.com/2009/10/ ... lkthrough/

More great tutorials...(see bottom of the site..)
http://developerlife.com/tutorials/?p=309

See This new Site...It has many screen demos...
http://vidarvestnes.blogspot.com/2010/0 ... mples.html

Also more nice sample codes/tutorials
http://www.androidpeople.com/category/android-tutorial/


Get Android 2.0 Source from here
http://source.android.com/download


All Android Phones out there now. Wow, great comparison CHART
http://www.androphones.com/all-android-phones.php

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
List of some of the Android Development Books out there

-- I have the first 8 books...

I like the first 4 books because they provide....

- In depth explanation,
- Sample code,
- Project screen shots,
- Enough projects and code,
- Code Completion in the book,
- Hints and Directions

THE BEST OUT THERE (The first 4 books are the best I have seen)
1 Professional Android Application Development (by Reto Meier, published by Wrox)
2 Beginning Android (by Mark Murphy, published by Apress)
3 The Busy Coder's Guide to Android Development (by Mark Murphy, published by CommonsWare)
4 Android Programming Tutorials (by Mark Murphy, published by CommonsWare)
-------------->
5 Android: A Programmer's Guide (by Jerome DiMarzio, published by McGraw-Hill Osborne Media)
6 Android Wireless Application Development (by Shane Condor & Lauren Darcey, published by Addison-Wesley Professional)
7 The Busy Coder's Guide to Advanced Android Development (by Mark Murphy, published by CommonsWare)
8 Unlocking Android (by Frank Ableson, Charlie Collins, and Robi Sen; published by Manning Publications)
9 Pro Android (by Sayed Hashimi, published by Apress)
10 Pro Android Games (by Vladimir Silva, published by Apress)
11 Android Essentials (by Chris Haseman, published by APress)
12 Hello, Android (by Ed Burnette, published by Pragmatic Programmers)
13 Android Application Development (by Rick Rogers, John Lombardo, Zigurd Mednieks, Blake Meike; published by O'Reilly & Associates)

FREE E-BOOK
http://commonsware.com/Android/Android-1_0-CC.pdf
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

Android Live Wallpaper tutorial for Android 2.1...
http://blog.androgames.net/58/android-l ... -tutorial/

Android Wall Papers
http://www.talkandroid.com/wallpapers/

----------------------------------------------------------------------------------------------------
For background image changes from...PORTRAIT to LANDSCAPE

http://androidcommunity.com/forums/f7/b ... fix-29408/

LANDSCAPE
Phone = 480 x 320
Image = 480 x 320


and

PORTRAIT

Phone = 320 x 480
Image = 480 x 320
-----------------

JSON TUTORIAL
http://devstream.stefanklumpp.com/2009/ ... nt-to.html

Video recording
http://groups.google.com/group/android- ... f24049c13d

Image GridView tutorial
http://developer.android.com/guide/tuto ... dview.html


Take a picture
http://stackoverflow.com/questions/4558 ... rom-camera


CAMERA TAKES IMAGE AND SEND IT TO SERVER
http://vikram.eggwall.com/computers/watchtower.html
http://www.tomgibara.com/android/camera-source

...and SEE THIS
http://www.mail-archive.com/android-dev ... 73057.html

Android transitions- slide in and slide out
USING INCLUDE TAG TO IMPORT OTHER XML FILES FROM THE SAME DIRECTORY
http://www.inter-fuser.com/2009/07/andr ... slide.html

Start different activities in separate tabs of a TabHost
http://www.androidsnippets.org/snippets/68/

Showing indeterminate progress bar in TabHost activity
http://stackoverflow.com/questions/1138 ... t-activity
----

Understanding Android Themes and Styles
http://brainflush.wordpress.com/2009/03 ... nd-styles/

ListView and ListActivity Demo
http://maohao.wordpress.com/2009/11/26/ ... vity-demo/

and
Clickable ListView Items
http://www.androidsnippets.org/snippets/125/

How to display list of images in ListView in android
http://stackoverflow.com/questions/4597 ... in-android

Android: ListView with complex data model
http://stackoverflow.com/questions/1595 ... data-model


Display images that are stored on your SD card.
http://mihaifonoage.blogspot.com/2009/1 ... rd-in.html

How to store images larger than 1 megabyte in Google App Engine
http://www.rezendi.com/pa/labels/AppEngine.html
---

DYNAMIC UI
http://www.dreamincode.net/forums/showtopic130521.htm

AND THIS
http://caguilartech.blogspot.com/2009/0 ... s-and.html

---

Ticketing System Example
http://www.linux-mag.com/cache/7463/1.html

and also see
Hands-on: Multiple Activities and Data Persistence in Android
http://www.linux-mag.com/cache/7498/1.html
Writing

--
MENUS...

Official site
Creating Menus

http://developer.android.com/guide/topics/ui/menus.html

How to create an option menu
http://www.droidnova.com/how-to-create- ... u,427.html

Dynamically change Options Menu Items in Android
http://thedevelopersinfo.com/2009/10/20 ... n-android/

Menu item creation code
http://developerlife.com/tutorials/?p=304

Creating Game Menus in Android
http://www.droidnova.com/creating-game- ... d,518.html

Getting Started in Android Game Development
http://blog.vn-dev.net/2010/01/getting- ... -game.html

Android 3D game tutorial
http://www.droidnova.com/android-3d-gam ... i,312.html


Android Animations 3D flip
http://www.inter-fuser.com/2009/08/andr ... -flip.html

and more 3d image flip
http://www.anddev.org/viewtopic.php?p=29493

more samples of this site
http://www.inter-fuser.com/

--
The Android Modeller and Code Generator

Create Android apps without programming??? (I have not tested this yet...)
http://www.lab.telin.nl/~msteen/andromate/

and also see
http://www.designerandroid.com/

and
http://googleresearch.blogspot.com/2009 ... droid.html

----------
Showing Toast in Android
http://thedevelopersinfo.com/2009/10/23 ... n-android/
----------


Databases and Menus
http://www.dreamincode.net/forums/showtopic130762.htm


VIEWFLIPPER AND TAB VIEW
http://www.androidguys.com/2008/08/14/f ... our-views/
http://www.androidguys.com/2008/08/12/a ... namically/

I THINK BEST VIEW FLIPPER IS HERE
http://www.inter-fuser.com/2009/07/andr ... slide.html

and this (test flip)
http://osdir.com/ml/Android-Developers/ ... 02457.html

MORE APPS
http://www.androidguys.com/category/ag- ... ng-droids/



#########################
TIP1:

To stop your activity from restarting when phone orientation changes do...

In manifest.xml under Activity put...
android:configChanges="orientation|keyboardHidden"


and in your app

import android.content.res.Configuration;


and implement

@Override
public void onConfigurationChanged(Configuration newConfig) {
// TODO Auto-generated method stub
super.onConfigurationChanged(newConfig);
}


TIP2:
10 User Experience Tips for Successful Android Apps
http://www.androidtapp.com/10-user-expe ... roid-apps/

#########################

TOUCH SCREEN OR GESTURE TOUCH
http://www.anddev.org/viewtopic.php?p=29945


WINDOWS UI BACKGROUNDS
http://android-developers.blogspot.com/ ... speed.html

NICE TUTORIAL
http://www.2linessoftware.com/2009/01/1 ... 1/#more-23
http://www.androidph.com/2008/11/camera-capture.html


source code
http://mobileserver.byethost2.com/?p=45


THIS TUTORIAL IS JUST BEAST. (NETWORK, GPS, CAMERA, RADAR ETC...)
http://www.androidph.com/2009/02/app-10-beer-radar.html


RADAR...STEP BY STEP
http://www.androidph.com/2009/02/app-10-beer-radar.html

SOURCE CODE
http://mobileserver.byethost2.com/?attachment_id=96


RADAR.
http://groups.google.com/group/android- ... ba87263bb5

MAPS
Best MAP TUTORIAL
http://mobiforge.com/developing/story/u ... ps-android

and
http://2009.hfoss.org/Tutorial:Hello_Mapview,_with_GPS

OPENGL ANIMATION FOR RADAR.
http://en.oreilly.com/oscon2009/public/ ... etail/8108


CHANGES TO JAVA 1.5 NOTES
http://page.mi.fu-berlin.de/oezbek/pub/ ... va_1.5.pdf


INTRO TO ANDROID
http://static.kazed.net/dist/android-pr ... andout.pdf
and
http://www.datasprings.com/Resources/Ar ... eCode.aspx


Live Camera Previews in Android
http://www.tomgibara.com/android/camera-source


SERVICE ORIENTED TUTORIAL (Backgroud services)
http://developerlife.com/tutorials/?p=300

Development and remote installation of Java service for the Android Devices (Nice)
http://www.codeproject.com/KB/mobile/an ... pment.aspx


HOW TO SIGN YOUR ANDROID APP
http://www.brighthub.com/mobile/google- ... 40857.aspx
http://www.brighthub.com/mobile/google- ... 40859.aspx

------------------
BEST...PERIOD...
ASK ANDROID DEVELOPER QUESTIONS HERE
Best forum out there...
http://www.anddev.org

and/or
http://www.stackoverflow.com

and other forums
http://androidforums.com/

more
http://www.rbgrn.net/content/187-ask-al ... tions-here
-------------------

IBM ANDROID SENSORS
http://www.ibm.com/developerworks/opens ... index.html


SENSOR
BEST SENSOR CODE

http://www.anddev.org/viewtopic.php?p=22675
AND
http://www.anddev.org/viewtopic.php?p=26929

SAMPLE SENSOR NICE AND CAMPUS SAMPLE AS WELL
http://www.anddev.org/accessing_the_acc ... 9-s45.html

AND
http://mysticlakesoftware.blogspot.com/

NICE SENSOR CODE
http://android.hlidskialf.com/post/andr ... n-listener

WORKING SENSOR CODE NICE NICE AND DETECT SHAKE
http://www.anddev.org/viewtopic.php?p=27383

OFFICIAL SITE FOR SENSOR
http://code.google.com/p/cellphone-sonar/

Nice sensors
http://stuffthathappens.com/blog/2009/0 ... d-sensors/


THIS SENSOR IS THE ONE YOU NEED FOR THE APP
http://www.codeshogun.com/blog/2009/04/ ... id-part-i/


Tutorials sensors
http://www.linuxfordevices.com/c/a/News ... -tutorial/

------------

Table Layout
http://developerlife.com/tutorials/?p=307


PASSING OBJECT FROM ONE ACTIVITY TO ANOTHER.
http://thinkandroid.wordpress.com/2009/ ... ctivities/


THIS SITE HAS MANY THINGS, INCLUDING (PHOTO GALLERY TUTORIAL, SEARCH IT THOUGH ON THE SITE)
http://www.brighthub.com/mobile/google- ... 42185.aspx
The link above is dialogs, but it mentions about photo gallery


REDRAW A VIEW
http://groups.google.com/group/android- ... d35e5e5c15
calls invalidate method...

Official
http://developer.android.com/reference/ ... /View.html
=================================================================

Game examples
http://github.com/eburke/android_game_examples


Animations
http://www.inter-fuser.com/2009/08/andr ... -flip.html
http://www.netmite.com/android/mydroid/ ... animation/


Android 3D Flip Animation
http://www.inter-fuser.com/2009/08/andr ... -flip.html

NICE ICONS, IMAGES, DRAWABLES
http://www.everaldo.com/crystal/?action=downloads

and/or
http://www.screaming-penguin.com/info/a ... ables.html

AND...MORE NICE.........DRAWABLES
http://www.small-icons.com/index.htm

--------------------------------------------
IMAGE GALLERY
http://www.netmite.com/android/mydroid/ ... llery.java

Android Tutorial: Image & Text-Only Buttons
http://blog.pocketjourney.com/2008/04/3 ... y-buttons/


INSTALL APPS ON DEV 1 PHONE
http://www.anddev.org/debugging-install ... t3236.html
USB DRIVERS WELL ARE FOUND HERE...

ROOTING YOUR G1 DEV 1 PHONE (step by step)
http://android.noisepages.com/2009/05/p ... esusfreke/

Hot to Root Video
http://theunlockr.com/2009/10/15/how-to ... droid-1-6/

How to Hack Your Android Phone (and Why You Should Bother)
http://www.readwriteweb.com/archives/ho ... _phone.php

----------
"One" of the BEST ANDROID SITE OUT THERE
http://www.androidandme.com

ANDROID DEV 1 PHONE RETURN POLICY
http://www.google.com/support/forum/p/A ... 86b3&hl=en

------------------
FILES
http://www.anddev.org/working_with_files-t115-s30.html

NICE FILE ONE
http://androidforums.com/android-develo ... droid.html
http://bestsiteinthemultiverse.com/2008 ... nt-page-1/


CHECK THIS ONE
http://www.anddev.org/viewtopic.php?p=27514


and
generic file...
http://www.daniweb.com/forums/thread123311.html


DELETING FILE IN ANDROID
http://stackoverflow.com/questions/1248 ... om-sd-card
Also this one has good and complete code
http://www.higherpass.com/java/Tutorial ... With-Java/



CHECK FILE EXISTS
http://www.higherpass.com/java/Tutorial ... With-Java/


FILE CODE SAMPLES
WRITING/READING/DELETING/MOVING/APPENDING
http://www.higherpass.com/java/Tutorial ... With-Java/


APPENDING TO A FILE
http://groups.google.com/group/android- ... cbd733bf68
sample from site
FileOutputStream out
= context.openFileOutput("test.txt", Context.MODE_APPEND);


AND
RANDOM FILE ACCESS IS WHAT YOU NEED
http://www.java-tips.org/java-se-tips/j ... -file.html
http://www.higherpass.com/java/Tutorial ... th-Java/2/


some file ideas
http://stackoverflow.com/questions/1756 ... -text-file


SD card file
http://www.blog.droidweb.com/?tag=read-files


Local File system URI
http://www.techjini.com/blog/2009/01/10 ... g-content/


FILE GUI SAMPLE..USE THE DIALOGUE BOX WITH TWO BUTTONS
http://lysesoft.com/products/andexplorer/index.html



#############################

ACCELEROMETER
http://androidforums.com/android-develo ... -code.html


SOURCE CODE SAMPES
http://examples.oreilly.com/9780596521509/

--------

ZONE LIST...
Test this code some time...
http://gitorious.org/easyweb2/packages- ... eList.java


--------

MEDIA CLASS
http://groups.google.com/group/android- ... 2adb82663a

IMAGES
http://www.developer.com/java/j2me/arti ... ndroid.htm

NICE @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
TAKE PICTURE VIA CAMERA AND PUT THEM IN GALLERY
CODE FOR IMAGE GALLERY
Tutorial:Camera and Gallery Demo
http://2009.hfoss.org/Tutorial:Camera_and_Gallery_Demo
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

and
OFFIAL
http://developer.android.com/guide/tuto ... llery.html
THE ABOVE LINK CODE MAY HAVE PROBLEM...

SOLUTION IS
http://pdf.jpedal.org/java-pdf-blog/bid ... ry-problem


OTHER image gallery
http://www.anddev.org/gallery_with_remo ... -t769.html


Applying Styles and Themes
http://developer.android.com/guide/topi ... hemes.html


DIALOGUES

NICEST TUTORIAL EVER
http://www.anddev.org/tutorial_modal_dialogs-t4325.html

TIMED DIALOGUE POPUP
http://stackoverflow.com/questions/4542 ... in-android

Complex Dialog BOX
http://www.brighthub.com/mobile/google- ... 42185.aspx

more...

http://android.ifies.org/tutorial/2009/ ... le-dialogs
http://developer.android.com/guide/topi ... stomDialog
http://bestsiteinthemultiverse.com/2009 ... n-example/
http://developmentality.net/post/229136 ... x-tutorial

AND

with STYLES
http://www.anddev.org/bosicc_custom_ale ... t7928.html


http://androidsamples.blogspot.com/2009 ... arser.html



HOW TOs MANY THINGS...INTERESTING
http://www.frickingnutz.com/files/android_pdf/FAQs.pdf
------------------

SCREEN TO SCREEN WITH BUTTON
http://www.anddev.org/screen_to_next_sc ... t5341.html


Scrolling with button
http://bestsiteinthemultiverse.com/2009 ... n-example/

SPLASH SCREEN GOOD***
http://www.droidnova.com/how-to-create- ... n,561.html

GOOD ANDROID TUTORIAL SITE
http://www.dreamincode.net/forums/index ... pic=130264

BEST...
Go Public with Your Android Application: Signing and Deployment
http://www.devx.com/wireless/Article/39972/1954

SIGNING AND PUBLISHING YOUR APP
http://www.brighthub.com/mobile/google- ... 40899.aspx
and/or
http://www.dreamincode.net/forums/showtopic131121.htm


UI WIDGET GUIDE
http://www.droiddraw.org/widgetguide.html

Layout Tricks: Using ViewStubs
http://d.android.com/resources/articles ... stubs.html

DYNAMIC UIs
http://www.dreamincode.net/forums/showtopic130521.htm

GOOD UI DESIGNS
http://mobiforge.com/designing/story/un ... -1-layouts

Layouts / over lay textview over an image
http://www.curious-creature.org/2009/02 ... -tricks-1/

and
http://www.curious-creature.org/2009/03 ... ze-part-1/

THIS IS TOO NICE OF A LAYOUT SITE PROGRAMMING
Also
http://www.netmite.com/android/mydroid/ ... ckage.html


ANDROID SEND MAIL...
http://www.vidyut.com/sunit/android/and ... dmail.html

Service Enabled Android
http://developerlife.com/tutorials/?p=289

TOUCH SCREENS
http://www.warriorpoint.com/blog/2009/0 ... ch-screen/


Just Interesting
http://www.madfellas.com/blog/index.cfm ... s--Amazing

Clickable Lists
http://www.androidsnippets.org/snippets/125/


An introduction to Text-To-Speech in Android
http://android-developers.blogspot.com/ ... ch-in.html
http://android-mobile-device.com/2009/0 ... n-android/


TAKE A PICTURE
http://www.damonkohler.com/2009/02/android-recipes.html
this above code can be used to integrate in the ARMitPro to
take a picture as the phone is flipped upside down and send it via email or sms.

ALSO, this site has many more examples

GPS LOCATIOn, etc
VIBRATE
SENSORS
SMS
SILENT RINGER...enable or disable ringer



NICE GPS WHERE ARE MY FRIENDS PROGRAMMING
http://blogoscoped.com/archive/2008-12-15-n14.html


--HERE also set ringer and some other ideas
http://gitorious.org/easyweb2/packages- ... tings.java
--------



ANDROID DEEP INSIDE PAPER
http://www.openexpo.ch/fileadmin/docume ... ntemps.pdf



SOUNDS.

OFFICIAL AUDIO API
http://docs.androidside.com/docs/refere ... nager.html

and
http://tkcodesharing.blogspot.com/2009/ ... sound.html

More sound reference
http://stackoverflow.com/questions/6286 ... ndroid-app

and
http://www.google.com/search?hl=en&q=an ... f&oq=&aqi=

Custom Audio Streaming with MediaPlayer
http://blog.pocketjourney.com/2008/04/0 ... diaplayer/


MUSIC PLAYER APPLICATION / SAMPLE CODE / PROJECT (Nice)
http://www.helloandroid.com/tutorials/m ... yer-part-i

WATCHOUT...
SOUND FIX FOR ANDROID 2.0

http://groups.google.com/group/android- ... c?lnk=raot


AUDIO STREAMING
http://blog.pocketjourney.com/2008/04/0 ... diaplayer/


GAME SOUND CODE
http://groups.google.com/group/android- ... 96bf87eb8e

Adding sound and music to an android game
http://karanar.net/?p=25

###############################################################


EXTRAS TO SEARCH
- TransitionDrawable...transsition backgrounds
http://groups.google.com/group/android- ... 2?lnk=raot

Playing with Graphics
http://www.droidnova.com/playing-with-g ... i,147.html


----------------------
SENSOR CODE
package org.android.sample;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.hardware.Sensor;
import android.os.Bundle;

import android.widget.TextView;


public class HelloAccelerometer extends Activity{

private TextView mTxtView;

private SensorManager mSensorManager;

@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);

mSensorManager = (SensorManager)getSystemService(Context.SENSOR_SERVICE);
mSensorManager.registerListener(mSensorListener, mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER),
SensorManager.SENSOR_DELAY_FASTEST);
mTxtView = new TextView(this);
setContentView(mTxtView);
}

public void updateTV(float p_x, float p_y, float p_z)
{
mTxtView.setText("x: "+p_x+", y: "+p_y+", z: "+p_z);
}

private final SensorEventListener mSensorListener = new SensorEventListener() {

public void onSensorChanged(SensorEvent se)
{
float x = se.values[0];
float y = se.values[1];
float z = se.values[2];
updateTV(x, y , z);
}

public void onAccuracyChanged(Sensor sensor, int accuracy) {}
};

@Override
protected void onResume()
{
super.onResume();
mSensorManager.registerListener(mSensorListener, mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER), SensorManager.SENSOR_DELAY_FASTEST);
}

@Override
protected void onStop()
{
mSensorManager.unregisterListener(mSensorListener);
super.onStop();
}
}

########################################
USING INCLUDE TAG TO IMPORT OTHE XML FILES FROM THE SAME DIRECTORY
http://www.inter-fuser.com/2009/07/andr ... slide.html

BELOW IS PART OF THE SITE.



Define a layout with a ViewFlipper


First of all we are going to edit the main.xml layout file in the res/layout directory of the our new android application here it is:
view sourceprint?01.<?xml version="1.0" encoding="utf-8"?>
02.<ViewFlipper xmlns:android="http://schemas.android.com/apk/res/android"
03.android:id="@+id/flipper"
04.android:layout_width="fill_parent"
05.android:layout_height="fill_parent"
06.>
07.<include android:id="@+id/first" layout="@layout/first_view" />
08.<include android:id="@+id/second" layout="@layout/second_view" />
09.</ViewFlipper>
You can see that we have defined a layout using the ViewFlipper. In the ViewFlipper we've included two views; our first view and our second view. Initially ViewFlipper will show our first child view. We haven't defined these child views yet so lets do that. First we need to create our first view. In the res/layout directory create a new file called first_view.xml. Now add this xml to the file:


========

SSH CLIENT...OPEN SOURCE
http://connectbot.googlecode.com/svn-hi ... ivity.java


##################################

STOP ACTIVITIES RESTARTING
...
http://www.anddev.org/viewtopic.php?p=31198

Thanks for helping out. It figured it out, referring to the exact same site you pointed me to.

I just added a XML:

android:configChanges="orientation"

to my main Activity in the Android Manifest and overrode the onConfigurationChanged(Configuration newConfig) in the corresponding Activity like this:
Java:

@Override
public void onConfigurationChanged(Configuration newConfig) {
// TODO Auto-generated method stub
super.onConfigurationChanged(newConfig);
}

Works neatly.
Awesome
##################################
MORE ORIENTATION ACTIVITY RESTARTING ISSUE

This one…
http://www.anddev.org/viewtopic.php?p=31198


http://stackoverflow.com/questions/5847 ... ose-values

ALSO…

You can rotate the emulator via…CTRL+F12…

Make use of LOG.d statement for the logcat ADB debugs…

read this for orientation locking…under the screen orientation.
http://android-developers.blogspot.com/ ... -apps.html


this may be some..
http://www.anddev.org/viewtopic.php?p=13371


MAY BE SOLUTION
http://www.anddev.org/detect_if_orienta ... t8689.html

########################################==========

Test Tabs and activities here with out a map…
http://www.androidsnippets.org/snippets/68/

====================
adding tabs on a click of a button
TAB BACKGROUND AS WELL
http://www.coderanch.com/t/444206/Andro ... -one-after

Changing Check Box background
http://www.designerandroid.com/?cat=3
=========


dynamic tabs… maybe
http://www.androidguys.com/2008/08/12/a ... namically/
http://www.anddev.org/solvedactivity_wi ... t9405.html

THIS ONE
http://whyandroid.com/android/162-addin ... cally.html
=======

2tabs with browser activities.
http://www.androidguys.com/2008/12/05/t ... h-intents/

================
Tab with activity to refresh activity
http://groups.google.com/group/android- ... 84bbee2040


==
CUSTOM AND NICE TABS
http://devtcg.blogspot.com/2008/03/adva ... -demo.html

===
NICE TAB…THIS ONE SEE..
http://wshaban.blogspot.com/2008/04/cre ... noird.html
==========
using
[syntax="java"]
ts1.setIndicator("Using Current Location");
ts1.setContent(new TabHost.TabContentFactory(){
public View createTabContent(String tag)
{
MapView mv=(MapView)AddNewLocationBookmark.this.findViewById(R.id.current_location_map);
return mv;
}
});

now it works
===========

This one
http://www.anddev.org/viewtopic.php?p=31151
http://vkroz.wordpress.com/2009/07/03/p ... -tab-view/


tabs/maps….and icons in tabs
http://osdir.com/ml/handhelds.android.d ... 00161.html

GPS user tracker
http://www.calvin.edu/~jpr5/android/tracker.html
###################################################################

Preferences Saving
http://thedevelopersinfo.com/2009/11/19 ... n-android/

File System
http://thedevelopersinfo.com/2009/11/26 ... n-android/

Image Savings
http://thedevelopersinfo.com/2009/12/18 ... n-android/


Boot up start applications
http://thedevelopersinfo.com/2009/12/18 ... n-android/


Hiding the title bar
http://thedevelopersinfo.com/2009/10/16 ... n-android/

Email sending in Android
http://thedevelopersinfo.com/2009/10/22 ... n-android/

--------
IMAGESVIEW
GALLERY

http://mobiforge.com/designing/story/un ... more-views


SET RINGTONE IN CODE
http://stackoverflow.com/questions/1271 ... y-activity
http://stackoverflow.com/questions/6232 ... ngs-screen

VOLUME
http://stackoverflow.com/questions/6286 ... ndroid-app

==================


SoundPool
http://www.anddev.org/using_soundpool_i ... t3115.html
http://groups.google.com/group/android- ... 7537&pli=1



MAP AND MORE FEATURES
http://www.anddev.org/viewtopic.php?p=20172


How to take picture in your code
http://www.brighthub.com/mobile/google- ... 43414.aspx


Customzing TABS
http://tholix.com/blog/2009/01/customiz ... icons.html

TO KNOW
UNDOCUMENTED BUTTON IMAGES

button background image streatch
http://www.anddev.org/tutorial_buttons_ ... t4369.html


BACKGROUND ORIENTATION CHANGE.
also handling rotation events and handging on to data
http://groups.google.com/group/android- ... 2a01bdfde5

Put the portrait one in res/layout. Put the landscape one in
res/layout-land. Name them both the same (e.g., main.xml).
And, *poof*, it works.
I have three recent blog posts up on AndroidGuys, covering how to handle
rotation events. Here's the third, which has links to the first two:
http://androidguys.com/?p=2723

Timeout screen lock code
http://stackoverflow.com/questions/5766 ... -idle-time


======================

SOUNDPOOL CLASS

###################################################################################
Yeah there's something you need to know about SoundPool: Init well
before playing - that is, you need to know way ahead of time what
sounds you will be using because it doesn't work well to play
immediately after initializing. I think they attempt to initialize
asynchronously or something because I had problems when I tried to
load and play back to back like you're trying there.

When I use SoundPool, I load everything upon creation of the instance
of the game then trigger the plays whenever I need them. Here's my
current code for SoundPoolSoundManager:


public class SoundPoolSoundManager implements SoundManager {
private static final String TAG = "SoundPoolSoundManager";


public static final int SOUND_1 = 1;


private boolean enabled = true;
private Context context;
private SoundPool soundPool;
private HashMap<Integer, Integer> soundPoolMap;


public SoundPoolSoundManager(Context context) {
this.context = context;
}


public void reInit() {
init();
}


public void init() {
if (enabled) {
Log.d(TAG, "Initializing new SoundPool");
//re-init sound pool to work around bugs
release();
soundPool = new SoundPool(SOUNDPOOL_STREAMS,
AudioManager.STREAM_MUSIC, 100);
soundPoolMap = new HashMap<Integer, Integer>();
soundPoolMap.put(SOUND_1, soundPool.load(context, R.raw.sound1,
1));
Log.d(TAG, "SoundPool initialized");
}
}


public void release() {
if (soundPool != null) {
Log.d(TAG, "Closing SoundPool");
soundPool.release();
soundPool = null;
Log.d(TAG, "SoundPool closed");
return;
}
}


public void playSound(int sound) {
if (soundPool != null) {
Log.d(TAG, "Playing Sound " + sound);
AudioManager mgr = (AudioManager)
context.getSystemService(Context.AUDIO_SERVICE);
int streamVolume = mgr.getStreamVolume(AudioManager.STREAM_MUSIC);
Integer soundId = soundPoolMap.get(sound);
if (soundId != null) {
soundPool.play(soundPoolMap.get(sound), streamVolume,
streamVolume, 1, 0, 1f);
}
}
}


public void setEnabled(boolean enabled) {
this.enabled = enabled;
}



}

###################################################################################
SET VOLUME HIGH
VOLUME SETTING SLIDER
AUDIO MANAGER

http://code.google.com/p/app-soundmanag ... olume.java

THE WHOLE PROJECT
http://code.google.com/p/app-soundmanag ... #trunk/res

----------------
SMSPOPUP
http://code.google.com/p/android-smspop ... ce/browse/
screen shots
http://code.google.com/p/android-smspopup/
-------------------


To set a message usig BUILDER....see line 429-430
http://code.google.com/p/app-soundmanag ... tings.java


PREFERENCES
The code you need for TAB2
http://thedevelopersinfo.com/2009/11/25 ... n-android/


http://stackoverflow.com/questions/5314 ... erence-sum
http://www.androidcompetencycenter.com/ ... eferences/

TEST PREF
http://www.androidsnippets.org/snippets/34/

################################################
################################################
I need to set the volume high before I sound the siren

Adjusting Audio Manager
http://www.anddev.org/viewtopic.php?p=31831
=================================================================

Google Map Navigations
http://www.anddev.org/viewtopic.php?p=26435

SATELLITE VIEW
http://www.anddev.org/viewtopic.php?p=28954

--
Code:

myMapView = (MapView) findViewById(R.id.myGMap);
geoPoint = new GeoPoint((int) (latitude * 1000000), (int) (longitude * 1000000));
myMapView.setSatellite(false);


Sample MAP ACTIVITY...
the link above..download the code...

---

CAPTURE CURRENT LOCATION BY CLICK...LONGTITUTE AND LADITUTE
http://www.anddev.org/viewtopic.php?p=28140
also see
http://www.anddev.org/viewtopic.php?p=24007



FRIEND FINDER CODE
http://www.anddev.org/the_friend_finder ... i-t93.html

======================================

CRAZY LONG LOGIN SCREEN PROCESS
http://www.anddev.org/viewtopic.php?p=20994
---------------------
Using ProgressDialog in Android Activity
http://thedevelopersinfo.com/2009/10/16 ... -activity/

and
Using Handler for long-time operations in Android
http://thedevelopersinfo.com/2009/10/19 ... n-android/

more...

PROGRESS SHOW AND DISMISS

myProgressDialog = ProgressDialog.show(YOURCLASSNAME.this,
"Please wait...", "Doing Extreme Calculations...", true);



then...after done operation...call

myProgressDialog.dismiss();



CELLID

http://www.anddev.org/poor_mans_gps_-_c ... -t257.html


=============================
KEYGUARD LOCK
http://www.androidsoftwaredeveloper.com ... -keyguard/
see the managekeyguard link

here see the enable and disable methods
http://www.google.com/codesearch/p?hl=e ... d-smspopup\.googlecode\.com



=========================


RADAR RADAR RADAR###############
http://code.google.com/p/apps-for-andro ... runk/Radar
http://www.anddev.org/panoramio_and_rad ... t2920.html

need entry in main.xml
http://code.google.com/p/apps-for-andro ... /radar.xml



people who implemented RADAR
http://groups.google.com/group/android- ... ba87263bb5

--------------------------


MAP WITH PHOTOES OF ALL OVER THE WORLD
http://www.panoramio.com/


COOL WATCH PHONE
http://www.coolest-gadgets.com/page/46/

==============

I THINK BEST PREFERENCE EXAMPLE
http://www.old.kaloer.com/android-preferences/


==============

LANDSCAPE TO PORTRAIT background image change
customize background image based on device..
http://stackoverflow.co

====================

How to send the coords of a location via URL from the phone….

In MAP code, get the lat+long
Then append them like this…
http://maps.google.com/maps?q=40.148143 ... 5588378906 between the lat and long append "+" in the middle

TRICK
How to get the coordinates (lat and long) from the browser in Maps.google.com
1) first find the location via address using google maps
2) then once the location is found and your location is in the center,
3) paste this code in the browser address bar and enter… (---> javascript:void(prompt('',gApplication.getMap().getCenter())); <-----)


source
http://www.tech-recipes.com/rx/2403/goo ... de_values/
=================================

Keyguard lock
http://www.androidsnippets.org/snippets/43/


THIS IS ALL THE LITTLE THINGS NEEDED
http://www.androidsnippets.org/


Get the phone's LAST KNOWN LOCATION
http://www.androidsnippets.org/snippets/21/

POWER MANAGER
http://www.anddev.org/viewtopic.php?p=32873


==============================

CELLID.JAVA
http://www.devx.com/wireless/Article/40524/0/page/1


BEST BEST CELL ID
ERRICSON CELLID TUTORIALS
https://labs.ericsson.com/apis/mobile-l ... on-android
https://labs.ericsson.com/apis/mobile-l ... umentation
-----------------

Image Gallery
http://www.androidsnippets.org/snippets/25/

...and
http://android-er.blogspot.com/2009/08/ ... idget.html



...and
Tutorial:Camera and Gallery Demo
http://2009.hfoss.org/Tutorial:Camera_and_Gallery_Demo
http://2009.hfoss.org/Tutorial:Camera/Gallery_Part_II

...and
http://androidsamples.blogspot.com/2009 ... mages.html


Overlaying images...Transparent images
http://stackoverflow.com/questions/9619 ... in-android

--------------


BASIC SMS SENDING
This one
http://mobiforge.com/developing/story/s ... ng-android

then
...
http://stackoverflow.com/questions/9689 ... ry-message

This sample shows how to send an SMS message to a mobile phone.
...

public void SmsMessageSend()
{
SmsMessage smsMessage = new SmsMessage();

//Set the message body and recipient.
smsMessage.Body = "Would you like to meet for lunch?";
smsMessage.To.Add(new Recipient("John Doe", "2065550199"));
smsMessage.RequestDeliveryReport = true;

//Send the SMS message.
smsMessage.Send();

return;

}

**********************

..

sms
http://thinkandroid.wordpress.com/2010/ ... plication/
--
SmsManager sm = SmsManager.getDefault();
// here is where the destination of the text should go
String number = "6508570720";
sm.sendTextMessage(number, null, "Test SMS Message", null, null);


Need manifest permission
<uses-permission android:name="android.permission.SEND_SMS"></uses-permission>


--------------------------

JAVA MAIL - ADNROID MAIL
download these jars first
http://code.google.com/p/javamail-andro ... loads/list


*******************************************
Nice Java Mail tutorial
Small Email program code
http://www.builderau.com.au/program/jav ... 936,00.htm



Sending Email on Android by SMTP (Gmail) Example Class
http://snipplr.com/view/16644/sending-e ... ple-class/

Java Mail sending mail
http://stackoverflow.com/questions/2020 ... ndroid-app

...
http://groups.google.com/group/android- ... a1b6957a9#



THIS
http://davanum.wordpress.com/2007/12/22 ... -via-smtp/

Good mail SMTP
http://k9mail.googlecode.com/issues/att ... sport.java


-----

CELLID
WOW--- CELL ID WITH MANY INFORMATION EXTRACTED.
http://gears.googlecode.com/svn/trunk/g ... vider.java

GOOD CELLID
http://svn2.assembla.com/svn/AndroidLoc ... ation.java



CELL ID..ANOTHER ONE
http://davanum.wordpress.com/2007/12/01 ... cellidlac/

GOOD CELL ID
http://mobiforge.com/developing/story/a ... ing-cellid

--------

How to get all 6 neighborhood cell ids on Android
6 Cellids
http://stackoverflow.com/questions/1693 ... on-android

##################################################################################################################################

WATCH OUT THIS ONLY WORKS WITH ERICSON PHONES

ERICSON CELLID 3.9Mil Unique Ids.
package com.ericsson;

------------------
MobileLocationDemoActivity.java



import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import org.json.JSONException;
import org.json.JSONObject;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.telephony.TelephonyManager;
import android.telephony.gsm.GsmCellLocation;
import android.util.Log;
import android.view.Gravity;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

public class MobileLocationDemoActivity extends Activity {

private final static String API_KEY = "INSERT KEY HERE";

private TelephonyManager tm;
private GsmCellLocation location;
private int cid, lac, mcc, mnc, cellPadding;

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);

/*
* Setup a listener for the UpdateCellButton. Pressing this button will fetch
* the current cell info from the phone.
*/
final Button UpdateCellButton = (Button) findViewById(R.id.UpdateCellButton);
UpdateCellButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
location = (GsmCellLocation) tm.getCellLocation();
cid = location.getCid();
lac = location.getLac();

/*
* Mcc and mnc is concatenated in the networkOperatorString. The first 3
* chars is the mcc and the last 2 is the mnc.
*/
String networkOperator = tm.getNetworkOperator();
if (networkOperator != null && networkOperator.length() > 0) {
try {
mcc = Integer.parseInt(networkOperator.substring(0, 3));
mnc = Integer.parseInt(networkOperator.substring(3));
} catch (NumberFormatException e) {
}
}

/*
* Check if the current cell is a UMTS (3G) cell. If a 3G cell the cell id
* padding will be 8 numbers, if not 4 numbers.
*/
if (tm.getNetworkType() == TelephonyManager.NETWORK_TYPE_UMTS) {
cellPadding = 8;
} else {
cellPadding = 4;
}

/*
* Update the GUI with the current cell's info
*/
((TextView) findViewById(R.id.TextView01)).setText("CellID: "
+ getPaddedHex(cid, cellPadding));
((TextView) findViewById(R.id.TextView02)).setText("Lac: "
+ getPaddedHex(lac, 4));
((TextView) findViewById(R.id.TextView03)).setText("Mcc: "
+ getPaddedInt(mcc, 3));
((TextView) findViewById(R.id.TextView04)).setText("Mnc: "
+ getPaddedInt(mnc, 2));
}
});

/*
* Setup a listener for the GetPositionButton. When pressing this button the
* cell info is sent to the server and hopefully we will get a longitude and
* latitude back.
*/
final Button GetPositionButton = (Button) findViewById(R.id.GetPositionButton);
GetPositionButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {

String strResult;

/**
* Seems that cid and lac shall be in hex. Cid should be padded with zero's
* to 8 numbers if UMTS (3G) cell, otherwise to 4 numbers. Mcc padded to 3
* numbers. Mnc padded to 2 numbers.
*/
try {
// Update the current location
updateLocation(getPaddedHex(cid, cellPadding), getPaddedHex(lac, 4),
getPaddedInt(mnc, 2), getPaddedInt(mcc, 3));
strResult = "Position updated!";
} catch (IOException e) {
strResult = "Error!\n" + e.getMessage();
}

// Show an info Toast with the results of the updateLocation
// call.
Toast t = Toast.makeText(getApplicationContext(), strResult,
Toast.LENGTH_LONG);
t.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
t.show();
}
});
}

/**
* Convert an int to an hex String and pad with 0's up to minLen.
*/
String getPaddedHex(int nr, int minLen) {
String str = Integer.toHexString(nr);
if (str != null) {
while (str.length() < minLen) {
str = "0" + str;
}
}
return str;
}

/**
* Convert an int to String and pad with 0's up to minLen.
*/
String getPaddedInt(int nr, int minLen) {
String str = Integer.toString(nr);
if (str != null) {
while (str.length() < minLen) {
str = "0" + str;
}
}
return str;
}

/**
*
*/
private void updateLocation(String cid, String lac, String mnc, String mcc)
throws IOException {
InputStream is = null;
ByteArrayOutputStream bos = null;
byte[] data = null;
try {

// Build the url
StringBuilder uri = new StringBuilder("http://cellid.labs.ericsson.net/");
// Set this param to xml to get the server response in XML instead
// of json
uri.append("json");
uri.append("/lookup?cellid=").append(cid);
uri.append("&mnc=").append(mnc);
uri.append("&mcc=").append(mcc);
uri.append("&lac=").append(lac);
uri.append("&key=").append(API_KEY);

// Create an HttpGet request
HttpGet request = new HttpGet(uri.toString());

// Send the HttpGet request
HttpClient httpClient = new DefaultHttpClient();
HttpResponse response = httpClient.execute(request);

// Check the response status
int status = response.getStatusLine().getStatusCode();
if (status != HttpURLConnection.HTTP_OK) {
switch (status) {
case HttpURLConnection.HTTP_NO_CONTENT:
throw new IOException("The cell could not be " + "found in the database");
case HttpURLConnection.HTTP_BAD_REQUEST:
throw new IOException("Check if some parameter "
+ "is missing or misspelled");
case HttpURLConnection.HTTP_UNAUTHORIZED:
throw new IOException("Make sure the API key is " + "present and valid");
case HttpURLConnection.HTTP_FORBIDDEN:
throw new IOException("You have reached the limit"
+ "for the number of requests per day. The "
+ "maximum number of requests per day is " + "currently 500.");
case HttpURLConnection.HTTP_NOT_FOUND:
throw new IOException("The cell could not be found" + "in the database");
default:
throw new IOException("HTTP response code: " + status);
}
}

// The response was ok (HTTP_OK) so lets read the data
HttpEntity entity = response.getEntity();
is = entity.getContent();
bos = new ByteArrayOutputStream();
byte buf[] = new byte[256];
while (true) {
int rd = is.read(buf, 0, 256);
if (rd == -1)
break;
bos.write(buf, 0, rd);
}
bos.flush();
data = bos.toByteArray();
if (data != null) {
try {
// Parse the Json data
JSONObject position = new JSONObject(new String(data))
.getJSONObject("position");

// update the GUI items with the received position info
((TextView) findViewById(R.id.position_longitude)).setText("Longitude: "
+ position.getDouble("longitude"));
((TextView) findViewById(R.id.position_latitude)).setText("Latitude: "
+ position.getDouble("latitude"));
((TextView) findViewById(R.id.position_name)).setText("Name: "
+ position.getString("name"));
((TextView) findViewById(R.id.position_accuracy)).setText("Accuracy: "
+ position.getDouble("accuracy"));
} catch (JSONException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
}
} catch (MalformedURLException e) {
Log.e("ERROR", e.getMessage());
} catch (IllegalArgumentException e) {
throw new IOException(
"URL was incorrect. Did you forget to set the API_KEY?");
} finally {
// make sure we clean up after us
try {
if (bos != null)
bos.close();
} catch (Exception e) {
}
try {
if (is != null)
is.close();
} catch (Exception e) {
}
}
}
}
-------------------
layout/main.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">

<TextView android:text="CellID: " android:id="@+id/TextView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>

<TextView android:text="Lac: " android:id="@+id/TextView02"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>

<TextView android:text="Mcc: " android:id="@+id/TextView03"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>

<TextView android:text="Mnc: " android:id="@+id/TextView04"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>

<Button android:text="Update cell" android:id="@+id/UpdateCellButton"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>

<TextView android:text="Latitude: " android:id="@+id/position_latitude"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>

<TextView android:text="Longitude: " android:id="@+id/position_longitude"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>

<TextView android:text="Name: " android:id="@+id/position_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>

<TextView android:text="Accuracy: " android:id="@+id/position_accuracy"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>

<Button android:text="Get position" android:id="@+id/GetPositionButton"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
</LinearLayout>

----------------------------------

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ericsson"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name" android:debuggable="true">
<activity android:name=".MobileLocationDemoActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="3" />

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"></uses-permission>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
</manifest>

--------------------------------

###################################################################################################################

LinuxJournal intro to Android
http://www.linuxjournal.com/article/10453

#####################################################################################

JAVA SMTP MAIL
http://k9mail.googlecode.com/issues/att ... sport.java

--

package com.android.email.mail.transport;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.net.SocketAddress;
import java.net.URI;
import java.net.URISyntaxException;
import java.security.GeneralSecurityException;
import java.security.SecureRandom;
import java.util.ArrayList;
import java.util.List;

import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
import javax.net.ssl.SSLException;

import android.util.Config;
import android.util.Log;

import com.android.email.Email;
import com.android.email.PeekableInputStream;
import com.android.email.codec.binary.Base64;
import com.android.email.mail.Address;
import com.android.email.mail.AuthenticationFailedException;
import com.android.email.mail.Message;
import com.android.email.mail.MessagingException;
import com.android.email.mail.Store;
import com.android.email.mail.Transport;
import com.android.email.mail.CertificateValidationException;
import com.android.email.mail.Message.RecipientType;
import com.android.email.mail.store.TrustManagerFactory;

public class SmtpTransport extends Transport {
public static final int CONNECTION_SECURITY_NONE = 0;

public static final int CONNECTION_SECURITY_TLS_OPTIONAL = 1;

public static final int CONNECTION_SECURITY_TLS_REQUIRED = 2;

public static final int CONNECTION_SECURITY_SSL_REQUIRED = 3;

public static final int CONNECTION_SECURITY_SSL_OPTIONAL = 4;

String mHost;

int mPort;

String mUsername;

String mPassword;

int mConnectionSecurity;

boolean mSecure;

Socket mSocket;

PeekableInputStream mIn;

OutputStream mOut;

/**
* smtp://user:password@server:port CONNECTION_SECURITY_NONE
* smtp+tls://user:password@server:port CONNECTION_SECURITY_TLS_OPTIONAL
* smtp+tls+://user:password@server:port CONNECTION_SECURITY_TLS_REQUIRED
* smtp+ssl+://user:password@server:port CONNECTION_SECURITY_SSL_REQUIRED
* smtp+ssl://user:password@server:port CONNECTION_SECURITY_SSL_OPTIONAL
*
* @param _uri
*/
public SmtpTransport(String _uri) throws MessagingException {
URI uri;
try {
uri = new URI(_uri);
} catch (URISyntaxException use) {
throw new MessagingException("Invalid SmtpTransport URI", use);
}

String scheme = uri.getScheme();
if (scheme.equals("smtp")) {
mConnectionSecurity = CONNECTION_SECURITY_NONE;
mPort = 25;
} else if (scheme.equals("smtp+tls")) {
mConnectionSecurity = CONNECTION_SECURITY_TLS_OPTIONAL;
mPort = 25;
} else if (scheme.equals("smtp+tls+")) {
mConnectionSecurity = CONNECTION_SECURITY_TLS_REQUIRED;
mPort = 25;
} else if (scheme.equals("smtp+ssl+")) {
mConnectionSecurity = CONNECTION_SECURITY_SSL_REQUIRED;
mPort = 465;
} else if (scheme.equals("smtp+ssl")) {
mConnectionSecurity = CONNECTION_SECURITY_SSL_OPTIONAL;
mPort = 465;
} else {
throw new MessagingException("Unsupported protocol");
}

mHost = uri.getHost();

if (uri.getPort() != -1) {
mPort = uri.getPort();
}

if (uri.getUserInfo() != null) {
String[] userInfoParts = uri.getUserInfo().split(":", 2);
mUsername = userInfoParts[0];
if (userInfoParts.length > 1) {
mPassword = userInfoParts[1];
}
}
}

public void open() throws MessagingException {
try {
SocketAddress socketAddress = new InetSocketAddress(mHost, mPort);
if (mConnectionSecurity == CONNECTION_SECURITY_SSL_REQUIRED ||
mConnectionSecurity == CONNECTION_SECURITY_SSL_OPTIONAL) {
SSLContext sslContext = SSLContext.getInstance("TLS");
boolean secure = mConnectionSecurity == CONNECTION_SECURITY_SSL_REQUIRED;
sslContext.init(null, new TrustManager[] {
TrustManagerFactory.get(mHost, secure)
}, new SecureRandom());
mSocket = sslContext.getSocketFactory().createSocket();
mSocket.connect(socketAddress, SOCKET_CONNECT_TIMEOUT);
mSecure = true;
} else {
mSocket = new Socket();
mSocket.connect(socketAddress, SOCKET_CONNECT_TIMEOUT);
}

// RFC 1047
mSocket.setSoTimeout(SOCKET_READ_TIMEOUT);

mIn = new PeekableInputStream(new BufferedInputStream(mSocket.getInputStream(), 1024));
mOut = mSocket.getOutputStream();

// Eat the banner
executeSimpleCommand(null);

String localHost = "localhost.localdomain";
try {
InetAddress localAddress = InetAddress.getLocalHost();
if (! localAddress.isLoopbackAddress()) {
// The loopback address will resolve to 'localhost'
// some mail servers only accept qualified hostnames, so make sure
// never to override "localhost.localdomain" with "localhost"
// TODO - this is a hack. but a better hack than what was there before
localHost = localAddress.getHostName();
}
} catch (Exception e) {
if (Config.LOGD) {
if (Email.DEBUG) {
Log.d(Email.LOG_TAG, "Unable to look up localhost");
}
}
}

List<String> results = executeSimpleCommand("EHLO " + localHost);

/*
* TODO may need to add code to fall back to HELO I switched it from
* using HELO on non STARTTLS connections because of AOL's mail
* server. It won't let you use AUTH without EHLO.
* We should really be paying more attention to the capabilities
* and only attempting auth if it's available, and warning the user
* if not.
*/
if (mConnectionSecurity == CONNECTION_SECURITY_TLS_OPTIONAL
|| mConnectionSecurity == CONNECTION_SECURITY_TLS_REQUIRED) {
if (results.contains("STARTTLS")) {
executeSimpleCommand("STARTTLS");

SSLContext sslContext = SSLContext.getInstance("TLS");
boolean secure = mConnectionSecurity == CONNECTION_SECURITY_TLS_REQUIRED;
sslContext.init(null, new TrustManager[] {
TrustManagerFactory.get(mHost, secure)
}, new SecureRandom());
mSocket = sslContext.getSocketFactory().createSocket(mSocket, mHost, mPort,
true);
mIn = new PeekableInputStream(new BufferedInputStream(mSocket.getInputStream(),
1024));
mOut = mSocket.getOutputStream();
mSecure = true;
/*
* Now resend the EHLO. Required by RFC2487 Sec. 5.2, and more specifically,
* Exim.
*/
results = executeSimpleCommand("EHLO " + localHost);
} else if (mConnectionSecurity == CONNECTION_SECURITY_TLS_REQUIRED) {
throw new MessagingException("TLS not supported but required");
}
}

/*
* result contains the results of the EHLO in concatenated form
*/
boolean authLoginSupported = false;
boolean authPlainSupported = false;
for (String result : results)
{
if (result.matches(".*AUTH.*LOGIN.*$") == true)
{
authLoginSupported = true;
}
if (result.matches(".*AUTH.*PLAIN.*$") == true)
{
authPlainSupported = true;
}
}

if (mUsername != null && mUsername.length() > 0 && mPassword != null
&& mPassword.length() > 0) {
if (authPlainSupported) {
saslAuthPlain(mUsername, mPassword);
}
else if (authLoginSupported) {
saslAuthLogin(mUsername, mPassword);
}
else {
throw new MessagingException("No valid authentication mechanism found.");
}
}
} catch (SSLException e) {
throw new CertificateValidationException(e.getMessage(), e);
} catch (GeneralSecurityException gse) {
throw new MessagingException(
"Unable to open connection to SMTP server due to security error.", gse);
} catch (IOException ioe) {
throw new MessagingException("Unable to open connection to SMTP server.", ioe);
}
}

public void sendMessage(Message message) throws MessagingException {
close();
open();
Address[] from = message.getFrom();
boolean possibleSend = false;
try {
executeSimpleCommand("MAIL FROM: " + "<" + from[0].getAddress() + ">");
for (Address address : message.getRecipients(RecipientType.TO)) {
executeSimpleCommand("RCPT TO: " + "<" + address.getAddress() + ">");
}
for (Address address : message.getRecipients(RecipientType.CC)) {
executeSimpleCommand("RCPT TO: " + "<" + address.getAddress() + ">");
}
for (Address address : message.getRecipients(RecipientType.BCC)) {
executeSimpleCommand("RCPT TO: " + "<" + address.getAddress() + ">");
}
message.setRecipients(RecipientType.BCC, null);
executeSimpleCommand("DATA");
// TODO byte stuffing
message.writeTo(
new EOLConvertingOutputStream(
new BufferedOutputStream(mOut, 1024)));

possibleSend = true; // After the "\r\n." is attempted, we may have sent the message
executeSimpleCommand("\r\n.");
} catch (Exception e) {
MessagingException me = new MessagingException("Unable to send message", e);
me.setPermanentFailure(possibleSend);
throw me;
}
finally
{
close();
}



}

public void close() {
try {
mIn.close();
} catch (Exception e) {

}
try {
mOut.close();
} catch (Exception e) {

}
try {
mSocket.close();
} catch (Exception e) {

}
mIn = null;
mOut = null;
mSocket = null;
}

private String readLine() throws IOException {
StringBuffer sb = new StringBuffer();
int d;
while ((d = mIn.read()) != -1) {
if (((char)d) == '\r') {
continue;
} else if (((char)d) == '\n') {
break;
} else {
sb.append((char)d);
}
}
String ret = sb.toString();
if (Email.DEBUG) {
Log.d(Email.LOG_TAG, "SMTP <<< " + ret);
}

return ret;
}

private void writeLine(String s) throws IOException {
if (Email.DEBUG) {
Log.d(Email.LOG_TAG, "SMTP >>> " + s);
}
mOut.write(s.getBytes());
mOut.write('\r');
mOut.write('\n');
mOut.flush();
}

private void checkLine(String line) throws MessagingException
{
if (line.length() < 1)
{
throw new MessagingException("SMTP response is 0 length");
}
char c = line.charAt(0);
if ((c == '4') || (c == '5')) {
throw new MessagingException(line);
}
}

private List<String> executeSimpleCommand(String command) throws IOException, MessagingException {
List<String> results = new ArrayList<String>();
if (command != null) {
writeLine(command);
}

boolean cont = false;
do
{
String line = readLine();
checkLine(line);
if (line.length() >= 4)
{
results.add(line);
if (line.charAt(3) == '-')
{
cont = true;
}
else
{
cont = false;
}
}
} while (cont);
return results;

}


// C: AUTH LOGIN
// S: 334 VXNlcm5hbWU6
// C: d2VsZG9u
// S: 334 UGFzc3dvcmQ6
// C: dzNsZDBu
// S: 235 2.0.0 OK Authenticated
//
// Lines 2-5 of the conversation contain base64-encoded information. The same conversation, with base64 strings decoded, reads:
//
//
// C: AUTH LOGIN
// S: 334 Username:
// C: weldon
// S: 334 Password:
// C: w3ld0n
// S: 235 2.0.0 OK Authenticated

private void saslAuthLogin(String username, String password) throws MessagingException,
AuthenticationFailedException, IOException {
try {
executeSimpleCommand("AUTH LOGIN");
executeSimpleCommand(new String(Base64.encodeBase64(username.getBytes())));
executeSimpleCommand(new String(Base64.encodeBase64(password.getBytes())));
}
catch (MessagingException me) {
if (me.getMessage().length() > 1 && me.getMessage().charAt(1) == '3') {
throw new AuthenticationFailedException("AUTH LOGIN failed (" + me.getMessage()
+ ")");
}
throw me;
}
}

private void saslAuthPlain(String username, String password) throws MessagingException,
AuthenticationFailedException, IOException {
byte[] data = ("\000" + username + "\000" + password).getBytes();
data = new Base64().encode(data);
try {
executeSimpleCommand("AUTH PLAIN " + new String(data));
}
catch (MessagingException me) {
if (me.getMessage().length() > 1 && me.getMessage().charAt(1) == '3') {
throw new AuthenticationFailedException("AUTH PLAIN failed (" + me.getMessage()
+ ")");
}
throw me;
}
}
}

###################################################################

SEND NOTIFICATION FROM A SERVICE
http://stackoverflow.com/questions/1207 ... in-android

=========================
There are only 10 types of people in the world...
Those who know binary and those who don't.


###############################################

http://www.anddev.org/viewtopic.php?p=26603

Camera Image Capture...GOOOOOOOOOOOD

...

import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.Intent;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.net.Uri;
import android.os.Handler;
import android.os.Message;
import android.os.Bundle;
import android.provider.MediaStore.Images;
import android.provider.MediaStore.Video;
import android.view.Menu;
import android.view.MenuItem;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.KeyEvent;
import android.view.Window;
import android.hardware.Camera;
import android.hardware.Camera.PictureCallback;
import android.hardware.Camera.ShutterCallback;

import android.util.Log;

public class CameraApiTest extends Activity implements SurfaceHolder.Callback
{
private static final String TAG = "CameraApiTest";
Camera mCamera;
boolean mPreviewRunning = false;
Context context;
public void onCreate(Bundle icicle)
{
super.onCreate(icicle);
requestWindowFeature(Window.FEATURE_NO_TITLE);
Log.e(TAG, "onCreate");

getWindow().setFormat(PixelFormat.TRANSLUCENT);

setContentView(R.layout.camera_api_test);
mSurfaceView = (SurfaceView)findViewById(R.id.surface);

mSurfaceHolder = mSurfaceView.getHolder();
mSurfaceHolder.addCallback(this);
mSurfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
}

public boolean onCreateOptionsMenu(android.view.Menu menu) {
MenuItem item = menu.add(0, 0, 0, "goto gallery");
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
public boolean onMenuItemClick(MenuItem item) {
Uri target = Uri.parse("content://media/external/images/media");
Intent intent = new Intent(Intent.ACTION_VIEW, target);
startActivity(intent);
return true;
}
});
return true;
}

@Override
protected void onRestoreInstanceState(Bundle savedInstanceState)
{
super.onRestoreInstanceState(savedInstanceState);
}

Camera.PictureCallback mPictureCallback = new Camera.PictureCallback() {
public void onPictureTaken(byte[] data, Camera c) {
Log.e(TAG, "PICTURE CALLBACK: data.length = " + data.length);
mCamera.startPreview();
}
};



public boolean onKeyDown(int keyCode, KeyEvent event)
{
if (keyCode == KeyEvent.KEYCODE_BACK) {
return super.onKeyDown(keyCode, event);
}

if (keyCode == KeyEvent.KEYCODE_SPACE) {
mCamera.takePicture(shutterCallback, rawCallback,mPictureCallback);
return true;
}

return false;
}

ShutterCallback shutterCallback = new ShutterCallback() {
public void onShutter() {
// TODO Do something when the shutter closes.
}
};

PictureCallback rawCallback = new PictureCallback() {
public void onPictureTaken(byte[] _data, Camera _camera) {
// TODO Do something with the image RAW data.
}
};

protected void onResume()
{
Log.e(TAG, "onResume");
super.onResume();
}

protected void onSaveInstanceState(Bundle outState)
{
super.onSaveInstanceState(outState);
}

protected void onStop()
{
Log.e(TAG, "onStop");
super.onStop();
}

public void surfaceCreated(SurfaceHolder holder)
{
Log.e(TAG, "surfaceCreated");
mCamera = Camera.open();
//mCamera.startPreview();
}

public void surfaceChanged(SurfaceHolder holder, int format, int w, int h)
{
Log.e(TAG, "surfaceChanged");

// XXX stopPreview() will crash if preview is not running
if (mPreviewRunning) {
mCamera.stopPreview();
}

Camera.Parameters p = mCamera.getParameters();
p.setPreviewSize(w, h);
mCamera.setParameters(p);
try{
mCamera.setPreviewDisplay(holder);
}catch(Exception e)
{
new AlertDialog.Builder(context).setTitle("Error")
.setMessage(e.getMessage())
.setPositiveButton("OK", null).show();
}
mCamera.startPreview();
mPreviewRunning = true;
}

public void surfaceDestroyed(SurfaceHolder holder)
{
Log.e(TAG, "surfaceDestroyed");
mCamera.stopPreview();
mPreviewRunning = false;
mCamera.release();
}

private SurfaceView mSurfaceView;
private SurfaceHolder mSurfaceHolder;
}
...........

SAVE CAMERA IMAGE
http://stackoverflow.com/questions/1910 ... ure-intent
.....

private void saveFullImage() {
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
File file = new File(Environment.getExternalStorageDirectory(), "test.jpg");
outputFileUri = Uri.fromFile(file);
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
startActivityForResult(intent, TAKE_PICTURE);
}

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if ((requestCode == TAKE_PICTURE) && (resultCode == Activity.RESULT_OK)) {
// Check if the result includes a thumbnail Bitmap
if (data == null) {
// TODO Do something with the full image stored
// in outputFileUri. Perhaps copying it to the app folder
}
}
}


................
CAMERA IMAGE CAPTURE...GOOD
http://stackoverflow.com/questions/1567 ... he-gallery




Good Image capture
http://www.anddev.org/viewtopic.php?p=26603


camera sdk1.1
http://www.anddev.org/tutorial_for_capt ... t6489.html


write image on sdcard
http://www.coderanch.com/t/436286/Andro ... d-emulator


Camera
code
http://osdir.com/ml/AndroidDevelopers/2 ... 01824.html



more camera..MAY BE COMPLETE
http://stackoverflow.com/questions/9511 ... iew-widget

BEST CAMERA APP EVER##########################
http://github.com/commonsguy/cw-advandr ... ra/Picture


THIS CAMERA ONE IS ALSO GOOOOOOOOD
http://snippets.dzone.com/posts/show/8683


###############################
Try THIS CAMERA FIRST
...
import java.io.IOException;


import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.PixelFormat;
import android.hardware.Camera;
import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.view.View.OnClickListener;
import android.view.View.OnTouchListener;



public class CamaraView extends Activity implements SurfaceHolder.Callback,
OnClickListener {
static final int FOTO_MODE = 0;
private static final String TAG = "CameraTest";
Camera mCamera;
boolean mPreviewRunning = false;
private Context mContext = this;
private String mExpNumber;

public void onCreate(Bundle icicle) {
super.onCreate(icicle);

Log.e(TAG, "onCreate");

Bundle extras = getIntent().getExtras();
mExpNumber = extras.getString("EXP_NUMBER");

getWindow().setFormat(PixelFormat.TRANSLUCENT);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.camera);
mSurfaceView = (SurfaceView) findViewById(R.id.surface_camera);
mSurfaceView.setOnClickListener(this);
mSurfaceHolder = mSurfaceView.getHolder();
mSurfaceHolder.addCallback(this);
mSurfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
}

@Override
protected void onRestoreInstanceState(Bundle savedInstanceState) {
super.onRestoreInstanceState(savedInstanceState);
}

Camera.PictureCallback mPictureCallback = new Camera.PictureCallback() {
public void onPictureTaken(byte[] imageData, Camera c) {

if (imageData != null) {

Intent mIntent = new Intent();

FileUtilities.StoreByteImage(mContext, imageData,
50, mExpNumber);
mCamera.startPreview();

setResult(FOTO_MODE,mIntent);
finish();


}
}
};

protected void onResume() {
Log.e(TAG, "onResume");
super.onResume();
}

protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
}

protected void onStop() {
Log.e(TAG, "onStop");
super.onStop();
}

public void surfaceCreated(SurfaceHolder holder) {
Log.e(TAG, "surfaceCreated");
mCamera = Camera.open();

}

public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {
Log.e(TAG, "surfaceChanged");

// XXX stopPreview() will crash if preview is not running
if (mPreviewRunning) {
mCamera.stopPreview();
}

Camera.Parameters p = mCamera.getParameters();
p.setPreviewSize(w, h);
mCamera.setParameters(p);
try {
mCamera.setPreviewDisplay(holder);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
mCamera.startPreview();
mPreviewRunning = true;
}

public void surfaceDestroyed(SurfaceHolder holder) {
Log.e(TAG, "surfaceDestroyed");
mCamera.stopPreview();
mPreviewRunning = false;
mCamera.release();
}

private SurfaceView mSurfaceView;
private SurfaceHolder mSurfaceHolder;

public void onClick(View arg0) {

mCamera.takePicture(null, mPictureCallback, mPictureCallback);

}

}
---------
AndroidManifest.xml. T

<uses-permission android:name="android.permission.CAMERA"/>


http://www.brighthub.com/mobile/google- ... 4.aspx?p=2




...
xml file for above
// This is the XML file to use in the Camera Activity
setContentView(R.layout.camera);

camera.xml
..
<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:orientation="vertical">
<SurfaceView android:id="@+id/surface_camera"
android:layout_width="fill_parent" android:layout_height="10dip"
android:layout_weight="1">
</SurfaceView>
</LinearLayout>


..............
CREATE THIS CODE IN A DIFFERENT CLASS FILE like FileUtilities called in the code above....
Store Image
// This code shows the way to store an image from a byte[] array.


public static boolean StoreByteImage(Context mContext, byte[] imageData,int quality, String expName) {

File sdImageMainDirectory = "/sdcard/myImages";
FileOutputStream fileOutputStream = null;
String nameFile;
try {

BitmapFactory.Options options=new BitmapFactory.Options();
options.inSampleSize = 5;

Bitmap myImage = BitmapFactory.decodeByteArray(imageData, 0,
imageData.length,options);


fileOutputStream = new FileOutputStream(
sdImageMainDirectory.toString() +"/" + nameFile + ".jpg");


BufferedOutputStream bos = new BufferedOutputStream(
fileOutputStream);

myImage.compress(CompressFormat.JPEG, quality, bos);

bos.flush();
bos.close();

} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

return true;
}



###############################
SEND IMAGE AS MMS
http://www.brighthub.com/mobile/google- ... 2#comments


Thanks a million for the quick response.

So see if I understand this correctly, here is what I am doing...

I am using your code...found here...http://snippets.dzone.com/user/Jbeer

1) CamaraView --- class
2) FileUtilities --- class with (storeByteImage) method.
in this storeByteImage method, image is saved as .jpg.

So now I am creating another method that is to send the MMS with the image like this.



//HE said need to enter the extra...to address etc...find how to send mms first.
public void sendMMS() {

String url = "/sdcard/myImages/myimage.jpg";

Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.setType("image/jpg");
sendIntent.putExtra(Intent.EXTRA_SUBJECT, “My Picture”);
sendIntent.putExtra("sms_body", "here put the body");
sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(url));

}

??? What size image will your program save? so the SendMMS can send it properly.
---------

Also, for the GridView

I need my pictures to look like this...
http://developer.android.com/guide/tuto ... dview.html

Instead of hardcoding the images, how can I read the images in a specific directory for this app.

Thanks alot again, I really appreciate it.

Yassin




----MMS
http://www.netmite.com/android/mydroid/ ... ivity.java

$$$$$$$$$$$$$$$$$$$
MMS GOOD SITE SEE THIS ONE
http://jtribe.blogspot.com/2008/12/send ... droid.html




#################################
=====================

AUDIO RECORDER
---------------------------------------------------------------------------------------------
http://www.benmccann.com/dev-blog/andro ... -tutorial/
......
package com.benmccann.android.hello;

import java.io.File;
import java.io.IOException;

import android.media.MediaRecorder;
import android.os.Environment;

/**
* @author <a href="http://www.benmccann.com">Ben McCann</a>
*/
public class AudioRecorder {

final MediaRecorder recorder = new MediaRecorder();
final String path;

/**
* Creates a new audio recording at the given path (relative to root of SD card).
*/
public AudioRecorder(String path) {
this.path = sanitizePath(path);
}

private String sanitizePath(String path) {
if (!path.startsWith("/")) {
path = "/" + path;
}
if (!path.contains(".")) {
path += ".3gp";
}
return Environment.getExternalStorageDirectory().getAbsolutePath() + path;
}

/**
* Starts a new recording.
*/
public void start() throws IOException {
String state = android.os.Environment.getExternalStorageState();
if(!state.equals(android.os.Environment.MEDIA_MOUNTED)) {
throw new IOException("SD Card is not mounted. It is " + state + ".");
}

// make sure the directory we plan to store the recording in exists
File directory = new File(path).getParentFile();
if (!directory.exists() && !directory.mkdirs()) {
throw new IOException("Path to file could not be created.");
}

recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
recorder.setOutputFile(path);
recorder.prepare();
recorder.start();
}

/**
* Stops a recording that has been previously started.
*/
public void stop() throws IOException {
recorder.stop();
recorder.release();
}

}

AND
----------------
Hi, the cause is that the source above is not an android *application*, just a helper class. So it just can’t run by itself.

You have to do something like this:

public class MyActivity extends Activity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

final AudioRecorder recorder = new AudioRecorder(“/audiometer/temp”);
recorder.start();

//….wait a while
recorder.stop();
}
}

##########################################################
Not Android...
Useful collection of Web Links (Just for the technical head geeks)
http://www.swview.org/links


Attachments:
tutorial.pdf [904.94 KiB]
Downloaded 355 times
Android_Slides.ppt [267 KiB]
Downloaded 311 times
android-sec-tutorial.pdf [2.3 MiB]
Downloaded 752 times
appmodel.ppt [1.42 MiB]
Downloaded 291 times
installation.ppt [1.13 MiB]
Downloaded 957 times
introduction-to-android-845.pdf [2.53 MiB]
Downloaded 328 times
lecture7.pdf [3.36 MiB]
Downloaded 732 times
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron