[android-beginners] Application crashes when I try to retrieve colums from a dbRow

2009-06-14 Thread Kevin J. Brooks

The LaunchFav crashes at the first i.putExtra.  The error is "The
application Track My Drinks (process.parisj13.trackmydrinks) has stopped
unexpectedly.  What am I doing wrong?

private Intent LaunchFav()
{
Cursor c = mFavDrink.fetchAllDrinks();
Intent i = new Intent(this, FavoriteDrink.class);
if(c.isBeforeFirst() && c.isAfterLast()){
i.putExtra(TrackMyDrinksDbAdapter.KEY_DRINK_ID, 
-1);
return i;
}
i.putExtra(TrackMyDrinksDbAdapter.KEY_DRINK_NAME, c.getString(

c.getColumnIndex(TrackMyDrinksDbAdapter.KEY_DRINK_NAME)));
i.putExtra(TrackMyDrinksDbAdapter.KEY_ALCOHOL_VOL, c.getDouble(

c.getColumnIndex(TrackMyDrinksDbAdapter.KEY_ALCOHOL_VOL)));
i.putExtra(TrackMyDrinksDbAdapter.KEY_ALCOHOL_PERC,c.getDouble(

c.getColumnIndex(TrackMyDrinksDbAdapter.KEY_ALCOHOL_PERC)));
i.putExtra(TrackMyDrinksDbAdapter.KEY_DRINK_ID, c.getInt(

c.getColumnIndex(TrackMyDrinksDbAdapter.KEY_DRINK_ID)));
return i;
}




This code is the code that puts a record or updates a record when
necessary.



private void ProcessFavorite(Intent i)
{
Bundle extras = i.getExtras();
TextView tv = (TextView)this.findViewById(R.id.Otheramt);
String FavName =
extras.getString(TrackMyDrinksDbAdapter.KEY_DRINK_NAME);
double AlcVol =
extras.getDouble(TrackMyDrinksDbAdapter.KEY_ALCOHOL_VOL, 0.00);
double AlcPerc =
extras.getDouble(TrackMyDrinksDbAdapter.KEY_ALCOHOL_PERC, 0.00);
long RowId = 
extras.getLong(TrackMyDrinksDbAdapter.KEY_DRINK_ID);
double curAlc = AlcVol * AlcPerc;
othercnt++;

mCurrentTime = new Date();

if(mBAC == 0){
mStartTime = (Date) mCurrentTime.clone();
}

if(RowId == -1)
{
mFavDrink.createDrink(FavName, AlcVol, AlcPerc);
}
else
{
mFavDrink.updateDrink(RowId, FavName, AlcVol, AlcPerc);
}

mTotAlcohol = mTotAlcohol + curAlc;
tv.setText(String.valueOf(othercnt));

CalcDisplayBac();
}







This is my entire DB Helper class.







package com.parisj13.trackmydrinks;


import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

class TrackMyDrinksDbAdapter {
public static final String KEY_DRINK_NAME ="drinkname";
public static final String KEY_ALCOHOL_VOL ="volume";
public static final String KEY_ALCOHOL_PERC = "perc";
public static final String KEY_DRINK_ID = "_id";

private static final String TAG = "TrackMyDrinksDbAdapter";
private DatabaseHelper mDbHelper;
private SQLiteDatabase mDb;

private static final String DATABASE_CREATE =
"create table drink (_id integer primary key autoincrement, "
+ "drinkname text not null, volume double not null, perc
double not null);";

private static final String DATABASE_NAME = "trackmydrinks";
private static final String DATABASE_TABLE = "drink";
private static final int DATABASE_VERSION = 2;

private final Context mCtx;

private static class DatabaseHelper extends SQLiteOpenHelper {

public DatabaseHelper(Context context) {
super(context, DATABASE_NAME, null, DATABASE_VERSION);
}

@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL(DATABASE_CREATE);

}

@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int
newVersion) {
Log.w(TAG, "Upgrading database from version " + oldVersion +
" to "
+ newVersion + ", which will destroy all old data");
db.execSQL("DROP TABLE IF EXISTS drink");
onCreate(db);   
}

}

/**
 * Constructor - takes the context to allow the database to be
 * opened/created
 * 
 * @param ctx the Context within which to work
 */

public TrackMyDrinksDbAdapter(Context ctx){
this.mCtx = ctx;
}

/**
 * Open

[android-beginners] Re: String format of numbers into currency

2009-06-14 Thread sm1

short and sweet examples:

http://www.java2s.com/Code/Java/I18N/JavaI18NFormatNumberFormat.htm

serge

On Jun 14, 7:17 pm, "MMC2"  wrote:
> Further to my formatting problem and your reply,
>
> I changed s from being a string to being a double and it now works.
> Thanks for your help. I would still appreciate your recommendation on  a
> writeup about string formatting and your thoughts on the sync connection
> problem
> described below.
>
> Mike
>
>
>
> - Original Message -
> From: "MMC2" 
> To: 
> Sent: Sunday, June 14, 2009 3:28 PM
> Subject: [android-beginners] Re: String format of numbers into currency
>
> > Thanks Mark for your reply, but when I include the line you suggested
>
> > String t=customFormat("$###,###.###", s);
>
> > I don't get an error message but the app crashes at run time. I comment
> > out
> > the line
> > and it runs ok. Can you help further please?
>
> > On a separate issue. I frequently get a message "unable to open sync
> > connection" when I try to run my app.
> > I am using Eclipse. To get around it I restart my computer. I am using a
> > laptop with approx 1.5Gig memory.
> > Could you explain what the message means and would more memory help? Also
> > could you recommend
> > where I would find a good writeup on string formatting?
>
> > Regards
>
> > Mike
>
> > - Original Message -
> > From: "Mark Murphy" 
> > To: 
> > Sent: Saturday, June 13, 2009 7:52 AM
> > Subject: [android-beginners] Re: String format of numbers into currency
>
> >> MMC2 wrote:
> >>> I want to format a number that is held in a string called s to have a
> >>> leading $ sign and two places after the decimal point. So partly
> >>> following an example I wrote
>
> >>> static public String customFormat(String pattern, String s ) {
> >>>       DecimalFormat myFormatter = new DecimalFormat(pattern);
> >>>       String stringformatoutput = myFormatter.format(s);
> >>>       return stringformatoutput;
> >>>    }
>
> >>> then in my code where  I went to use this I wrote
>
> >>>                        customFormat("$###,###.###", s);
> >>>            String t = stringformatoutput;
>
> >>> hoping to have my formatted string ready for output in t, but I get an
> >>> error message that stringformatoutput cannot be resolved.
>
> >>> Can someone set me straight please
>
> >> String t=customFormat("$###,###.###", s);
>
> >> --
> >> Mark Murphy (a Commons Guy)
> >>http://commonsware.com|http://twitter.com/commonsguy
>
> >> Need Android talent? Ask on HADO!http://wiki.andmob.org/hado
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: Invokation Exception

2009-06-14 Thread sm1

As MrChaz wrote, you'll definitively need the Camera permission and
for checking if you are still getting exceptions, try this:

Camera cam = null;
try{
  cam = Camera.open();
}catch(Exception ex){
  Log.e("Camera.open()",""+ex);
}
if(cam==null){
  return;
}
//it is very important that the camera be released by the app that
opens it.
try{//try-finally block to ensure that the camera is released
  try{
cam.startPreview();
  }catch(Exception ex){
Log.e("Camera.startPreview()",""+ex);
return;
  }

  //other work here

}finally{
  try{
cam.release();
  }catch(Exception ex){
Log.e("Camera. release()",""+ex);
  }
}


serge


On Jun 13, 9:51 am, MrChaz  wrote:
> Have you added the Camera permission to the manifest?
>
> On Jun 12, 11:32 am, Urizev  wrote:
>
>
>
> > I am developing an application which uses the camera of my G2. The
> > code using the camera is showed below:
>
> >                 Camera cam = Camera.open();
> >                 if (cam == null) {
> >                         return;
> >                 }
>
> >                 cam.startPreview();
>
> > It throws and  Exception and I do not know why. Someone has any
> > idea?
>
> > com.sun.jdi.InvocationException occurred invoking
>
> > Regards
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] XML Layout Language

2009-06-14 Thread Mitch

Does anyone know a link to the specification for the XML Layout?  I'm
looking for a description of the tags etc.  Since I'm new and just
learning, a simplified version would be nice, focusing on the most
common tags.  Everything I read now is vague.

If not, here's some questions I have that are more specific.

>From the layout section of the DevGuide:


http://schemas.android.com/apk/res/
android"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:orientation="vertical" >




- What does xmlns mean?
- What is the android: sytnax all about?
- What does the "http://schemas.android.com/apk/res/android"; do?
- Can you create your own Layouts like the "LinearLayout"?
- Is there a list of available components like "Button", "TextView"?
- What does the @ symbol do?
- Can I edit this directly in Eclipse with a graphical editor rather
than manipulating text?

I'm sure these are probably simple questions answered somewhere, but I
just can't find the specification and I'm so new I don't seem to be
able to find the info.

Thanks for any hints.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] How to Drag-n-Drop an Image from source to target ImageButton

2009-06-14 Thread Chandru

Hi

I have a TableLayout with various Image buttons. I'm using XML layout
instead of a custom view class. I'd like to move an image from one
ImageButton object to another like moving a chess piece to a target
square by capturing a piece.

I'd like to know how to obtain the target ImageButton object based on
current(target) coordinates represented in the MotionEvent object and
draw the source image on the selected button? I'm using the following
listener code snippet to capture the source view and the event.

class BoardListener implements OnTouchListener {
@Override
public boolean onTouch(View v, MotionEvent event) {
switch(v.getId()) {
case R.id.a8:
 }
}
}

Appreciate your input

Thanks
Chandru

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Porting C project in android

2009-06-14 Thread subram

Hi There
   I am new to android,I had downloaded Android SDK and Eclipse in
windows,android source code in ubuntu. I created a C project in ubuntu
and generated shared library of my project using the Android.mk,arm
compiler that comes with the android source files and make .Now i have
to integrate/port this .so(shared library) c project in the android
SDK in windows using Eclipse.If any one came with this kindly suggest
me how to load/call this .so(shared library of my project) into
android and execute as an application in the Android phone.

Thanks & Regards
Subbraman.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Making .apk files?

2009-06-14 Thread [.K]

I want to test out a program. Now how do I make the apk file? So I
have my .java file right? Then what?
Thanks for the help.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] starting the htc dream

2009-06-14 Thread Yves Dorfsman


Hi,

I received my HTC dream, installed a sim and the battery, and it prompts me 
to setup my google account. I don't want to setup my google account, I don't 
even have a data plan (and don't plan to get one any time soon as they are 
too expensive in Canada). But, I still want to use the phone and local apps, 
write apps for the phone that I can use on it etc...

I've tried all the buttons, all the menus I could get too etc..., but it 
always returns to the google acocunt setting ?

I can I skip the account setup menu ?



Thanks.

-- 
Yves.
http://www.sollers.ca/


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Possible to run Android on ARM7?

2009-06-14 Thread peterweichai

Hi,

Is it possible to run Android on ARM7 board? I have a ARM7 board
running with uclinux previously, would like to know is it possible to
replace it with Android?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Can I just redraw part of the view without clean the existed pic?

2009-06-14 Thread James Lai

Hi,

I want to draw more pictures to a canvas of a view when I touch the
screen, such as when a touch event happened, I will draw a number in
the canvas, then a touch event happened again, I want to draw another
number in a different area in the canvas(I need keep the first one I
drawed just now).
so I just draw the numbers in onDraw, and call Invalidate() when touch
event happened. But the problem is when I call invalidate(), I need
draw all the numbers again, it will waste some effort. so I want to
know how to keep the original pic and just add the new part to the
original one anyone knows? Thanks.

P.S. some one said I can use invalidate(x,y,top, bottom) to invalidate
Rect of a canvas, but the problem is I need redraw in area1 and area2,
may be more areas, I can not give a specific area when call invalidate
(x,y,top, bottom) ...

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: Android dev guide

2009-06-14 Thread [.K]

> I was wondering if there is a pdf version of the android dev guide. I
> would like to print out the guide but not sure exactly how to do that.
> Any help would be appreciated.

A simple google search would've found it for you, but here you are.
http://files.me.com/artyom.loenko/nc9a4c

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Camera Preview

2009-06-14 Thread roscoe_x

Camera Preview sample code in here:
http://developer.android.com/guide/samples/ApiDemos/src/com/example/android/apis/graphics/CameraPreview.html

My questions are:
1. There's an error in the program, in the try{} catch{} part in
surfaceCreated(). Any suggestions on how to solve this problem?
2. In the top part of the html page written "The file containing the
source code shown below is located in the corresponding directory in
/platforms/android-/samples/...". But I can not find the
sample code in that directory. Is the information wrong or my system
is incomplete?
3. What do I get (see) when the program run normally?

Thanks for the answer.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] What DB do you use in android flatform?

2009-06-14 Thread Dan Lee

Hi

I'm going to design small application in android flatform.
I need DB to manage data. What DB is mostly used in android?
and Where can I get the docs?

If you have a any tutorial side, It's very appreciated.

Regards
Dan

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] loading images from network/web url

2009-06-14 Thread R

Hello All,

I want to do something like "". How do i achieve this in android. I have looked up SDK
and found imageviewer. all i can get to his how to load from a file
path. i am unable to achieve this if the image is located somewhere in
the web and is accessible by a web address rather than a physical file
path.

I have also found Async class but i am unable to implement it. Could
anyone suggest a solution to this scenario

Thanks all

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] EditText

2009-06-14 Thread Synapse

How can I change choise from contextual menu of EditText ( Menu that
includes copy/paste funcionality ) ?
Anyone has some piece of code?

Synapse

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Voicemail Indicator Always On

2009-06-14 Thread Chris de Barros

Hello,

I am on the BTC GSM network in The Bahamas.  I can not get the VM
indicator to go away even though I have deleted all VMs in my inbox.
The indicator always shows up as new VM in the status/notifications
bar.

Also, I get a weird blank SMS every time I delete the VM from my inbox
using the carrier dialup interface.

I am assuming that this blank VM is a message to the fone to make
something happen.  How do I get my device to recognize this SMS and
clear my VM in the top bar?

Using a Google ION fone at 1.5 Cupcake.

Regards

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: More about "Conversion to Dalvik format failed with error 1"

2009-06-14 Thread Lordsaibat

I had those same errors but the Java file was not created when I made
a new project.

On May 19, 4:06 pm, Dahai Guo  wrote:
> I am new to Android.
>
> Tocreateand run the HelloWorldproject, I installed Eclipse 3.4,
> Android SDK, and ADT.
>
> Right after theprojectwas created, I got two error messages: "no
> classfiles specified" and "Conversion to Dalvik format failed with
> error 1". Then I tried to build and run theproject. While no error
> was received, the emulator could not display "Hello, world!".
>
> I almost read every post about these two error messages, but still
> could not solve the problem.
>
> I happened to run theprojectagain. It did not display either. I
> forgot to close the emulator. Almost five minutes later, "Hello,
> world!" was showing. OMG! (The delay decreased quite a bit the next
> time I ran theproject.)
>
> Then I changed the compiler to verbose mode and realize that there is
> a huge delay when waiting for android.process.acore to be lauched.
> Here is the output:
>
> [2009-05-19 15:57:23 - HelloAndroid] Android Launch!
> [2009-05-19 15:57:23 - HelloAndroid] adb is running normally.
> [2009-05-19 15:57:23 - HelloAndroid] Performing
> com.example.helloandroid.HelloAndroid activity launch
> [2009-05-19 15:57:23 - HelloAndroid] Automatic Target Mode: launching
> new emulator with compatible AVD 'new_avd'
> [2009-05-19 15:57:23 - HelloAndroid] Launching a new emulator with
> Virtual Device 'new_avd'
> [2009-05-19 15:57:25 - HelloAndroid] New emulator found: emulator-5554
> [2009-05-19 15:57:25 - HelloAndroid] Waiting for HOME
> ('android.process.acore') to be launched...
>
>  delay delay delay *** // commented by Dahai
>
> [2009-05-19 15:57:59 - HelloAndroid] HOME is up on device
> 'emulator-5554'
> [2009-05-19 15:57:59 - HelloAndroid] Uploading HelloAndroid.apk onto
> device 'emulator-5554'
> [2009-05-19 15:57:59 - HelloAndroid] Installing HelloAndroid.apk...
> [2009-05-19 15:58:17 - HelloAndroid] Application already exists.
> Attempting to re-install instead...
> [2009-05-19 15:58:24 - HelloAndroid] Success!
> [2009-05-19 15:58:25 - HelloAndroid] Starting activity
> com.example.helloandroid.HelloAndroid on device
> [2009-05-19 15:58:27 - HelloAndroid] ActivityManager: Starting: Intent
> { comp={com.example.helloandroid/
> com.example.helloandroid.HelloAndroid} }
>
>  "Hello, world!" is showing. *** // commented by Dahai
>
> Is this normal for "android.process.acore" to take so long to launch?
> Does it have anything to do with the error messages: "no classfiles
> specified" and "Conversion to Dalvik format failed with error 1"?
>
> Thanks,
> Dahai

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] My First Custom View Totally Busted

2009-06-14 Thread Dave Smith

Hi all -

I'm trying to get up to speed with custom views, and I took most of
this code from examples, but I cannot get it to do anything.  When I
run the code below in the emulator I just get a blank screen, and when
I set debug breakpoints it shows that onDraw() never gets called!
It's got to be something dumb and simple, but I don't see it.  I'm
just trying to get a circle painted for starters.  I even tried adding
an "mv.invalidate()" call to the onCreate() method to try and get it
to redraw but nothing changed.  Help!

Thanks in advance!

[main.xml]

http://schemas.android.com/apk/res/
android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>


[/main.xml]


[myActivity.java]
package com.examples.customview;

import android.app.Activity;
import android.os.Bundle;

public class Compass extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
myView mv = (myView)this.findViewById(R.id.myView);
}
}
[/myActivity.java]


[myView.java]
package com.examples.customview;

import android.content.Context;
import android.graphics.*;
import android.view.*;
import android.util.AttributeSet;
import android.content.res.Resources;

public class myView extends View {

[...private members...]

public myView(Context context){
super(context);
initView();
}

public myView(Context context, AttributeSet attrs){
super(context, attrs);
initView();
}

public myView(Context context, AttributeSet attrs, int defaultStyle){
super(context, attrs, defaultStyle);
initView();
}

protected void initView(){
setFocusable(true);

circlePaint = new Paint(Paint.ANTI_ALIAS_FLAG);
circlePaint.setColor(R.color.background_color);
circlePaint.setStrokeWidth(1);
circlePaint.setStyle(Paint.Style.FILL_AND_STROKE);
}

@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
{
// The compass is a circle that fills as much screen as 
possible.
// Set the measured dimensions to the shortest screen boundary.
int measuredWidth = measure(widthMeasureSpec);
int measuredHeight = measure(heightMeasureSpec);

int d = Math.min(measuredWidth, measuredHeight);

//setMeasuredDimension must be called by onMeasure
setMeasuredDimension(d, d);
}

private int measure(int measureSpec){
int result = 0;

//Decode the spec value
int specMode = MeasureSpec.getMode(measureSpec);
int specSize = MeasureSpec.getSize(specMode);

if(specMode == MeasureSpec.UNSPECIFIED){
//Return a default value
result = 200;
} else {
//Return full bounds since we are filling available 
space
result = specSize;
}

return result;
}

@Override
protected void onDraw(Canvas canvas){
//Find the center point
int px = getMeasuredWidth() / 2;
int py = getMeasuredHeight() / 2;
int radius = Math.min(px, py);

//Draw the background
canvas.drawCircle(px, py, radius, circlePaint);
}
}
[/myView.java]

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Grid (TableLayout) of TextViews

2009-06-14 Thread Sergio Padrino

Hi!

I'm trying to create a 10x10 grid of TextViews using TableLayout. I
want this grid fills the whole screen like this:
http://files.getdropbox.com/u/1040020/right.png

But I get this: http://files.getdropbox.com/u/1040020/wrong.png

My code:

TableLayout layout = new TableLayout(this);

for(int i=0; i < 10; i++) {
TableRow row = new TableRow(this);

for(int j=0; j < 10; j++) {
TextView tv = new TextView(this);
tv.setText(String.valueOf(i*10 + j + 1));
tv.setGravity(Gravity.CENTER);

row.addView(tv);
}

layout.addView(row);
}


What am I doing wrong? Can I achieve the same effect doing another
thing? (Other layouts, using fixed sizes for each TextView...
whatever)

Thank you in advance :)

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] XML Layout Specification

2009-06-14 Thread Mitch

Here's a layout from the DevGuide: 
http://developer.android.com/guide/topics/ui/declaring-layout.html


http://schemas.android.com/apk/res/
android"
 android:layout_width="fill_parent"
 android:layout_height="fill_parent"
 android:orientation="vertical" >
   
   


- What does xmlns mean?
- What is the android:xxx sytnax all about?
- What does the "http://schemas.android.com/apk/res/android"; do?
- Are there other values I might choose?  (ex. "http://
schemas.android.com/apk/res/iPhone")
- Can you create your own Layouts like the "LinearLayout"?
- Is there a list of available components like "Button", "TextView"?
- What does the @, the / and the + symbol do?
- Can I edit this directly in Eclipse with a graphical editor rather
than editing the xml text?

That's a lot of questions.  So let me sum these up into one simple
question:

Does anyone know a link to the specification for the XML Layout
Language for Android?

Thanks for any hints for a complete newbie.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] tools/android fails with runtime error java.lang.AssertionError on ubuntu 9.04

2009-06-14 Thread Brett

I just had an issue and fixed it myself, so I thought I would put this
out there in case anyone else has the same problem. I am running
ubuntu 9.04. I just downloaded the android sdk for linux and when I
tried to run "android list targets" I got a java runtime error. I
eventually figured out that my system was not using the official sun
version of java. I ran "sudo update-alternatives --config java" and
used that utility to switch to the official sun version and the
runtime error went away. Hope this helps someone.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] How to put buttons in a row?

2009-06-14 Thread Dan Lee

Hi

I am totally newbie for android.
Today I wrote one example code.
I would put them 3X3. but buttons won't be in same row.

What I want is here...

button1 button2button3

button4 button5button6

button7 button8button9

Here's my example code...

=
public class butt_test1 extends Activity {
private TextView displayView;

private Button AddMenu1;
private Button AddMenu2;

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

AddMenu1= (Button)findViewById(R.id.btn1);
AddMenu2= (Button)findViewById(R.id.btn2);

}

}
=

here's xml file
=

http://schemas.android.com/apk/res/
android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>






=

Thanks in advance

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] OnClickListener

2009-06-14 Thread trontron

I will refer to the HelloListView tutorial list for a reference.

How do I set an onclicklistener on a particular item in the list?
How do I make the response of onclicklistener of a list item to start
activity2?

Thanks for the help.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] New Projects

2009-06-14 Thread Lordsaibat

When I make a new project the .java file is not generated.
I can run the project, but it does not run in the emulator or
anything.
It did work before then it stop working one day. I tried deleting the
folder and all project files.
After that I reinstalled everything but I am still having problems.
Please help.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: Where I can get royalty free pictures?

2009-06-14 Thread Brandon

I've used PicFindr (http://www.picfindr.com/) in the past, and there's
a pretty large amount of royalty free pictures.  There are some
"sponsored results" that cost money mixed in, but they are clearly
marked and easy to ignore.

Good luck!

-Brandon

On Jun 8, 8:44 pm, Andrew Li  wrote:
> Hello, everyone!
> I made a game recently. and I need some pictures, I searched on the
> internet. But most of them are not allowed to use into the Mobile
> devices or applications. Does anyone know where I can get royalty free
> pictures? Please tell me!
> Thanks!!!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: How to put buttons in a row?

2009-06-14 Thread guruk

u can do it in your xml file with tablelayout and tablerow

http://schemas.android.com/apk/res/android";>
 


















greets
chris

On Jun 14, 4:49 am, Dan Lee  wrote:
> Hi
>
> I am totally newbie for android.
> Today I wrote one example code.
> I would put them 3X3. but buttons won't be in same row.
>
> What I want is here...
>
> button1     button2    button3
>
> button4     button5    button6
>
> button7     button8    button9
>
> Here's my example code...
>
> =
> public class butt_test1 extends Activity {
>         private TextView displayView;
>
>         private Button AddMenu1;
>         private Button AddMenu2;
>
>     /** Called when the activity is first created. */
>     @Override
>     public void onCreate(Bundle savedInstanceState) {
>         super.onCreate(savedInstanceState);
>         setContentView(R.layout.main);
>
>         AddMenu1        = (Button)findViewById(R.id.btn1);
>         AddMenu2        = (Button)findViewById(R.id.btn2);
>
>     }
>
> }
>
> =
>
> here's xml file
> =
> 
> http://schemas.android.com/apk/res/
> android"
>     android:orientation="vertical"
>     android:layout_width="fill_parent"
>     android:layout_height="fill_parent"
>     >
>
>              android:layout_width="wrap_content"
>         android:layout_height="wrap_content"
>         android:text="booton1"/>
>
>              android:layout_width="wrap_content"
>         android:layout_height="wrap_content"
>         android:text="boooton2"/>
> 
>
> =
>
> Thanks in advance
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: Can I just redraw part of the view without clean the existed pic?

2009-06-14 Thread lai james
It seems I can not see my question in the post list, why

2009/6/13 James Lai 

> Hi,
>
> I want to draw more pictures to a canvas of a view when I touch the
> screen, such as when a touch event happened, I will draw a number in
> the canvas, then a touch event happened again, I want to draw another
> number in a different area in the canvas(I need keep the first one I
> drawed just now).
> so I just draw the numbers in onDraw, and call Invalidate() when touch
> event happened. But the problem is when I call invalidate(), I need
> draw all the numbers again, it will waste some effort. so I want to
> know how to keep the original pic and just add the new part to the
> original one anyone knows? Thanks.
>
> P.S. some one said I can use invalidate(x,y,top, bottom) to invalidate
> Rect of a canvas, but the problem is I need redraw in area1 and area2,
> may be more areas, I can not give a specific area when call invalidate
> (x,y,top, bottom) ...

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: Making .apk files?

2009-06-14 Thread guruk

i dont know exactly what you like.
when u use eclipse go to android tools and
export signed or unsigned apk


On Jun 13, 9:54 pm, "[.K]"  wrote:
> I want to test out a program. Now how do I make the apk file? So I
> have my .java file right? Then what?
> Thanks for the help.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: Practical questions

2009-06-14 Thread Tony Su

As a person has used Windows Mobile/CE devices for over 6 years and been 
developing for the mobile platform for over 4 years, I think I can offer some 
perspective...

First, regarding G1 availability, costs and restrictions (since to date 
anything else is largely vaporware or just launching)... Users always can 
choose the grey market (purchasing from a source other than T-Mobile). Today, 
you might be required to purchase for $180 from T-Mobile with a 2 year 
contract, but you can get a phone without a contract for somewhere from 
$210-280(street price). T-Mobile service is required to activate (T-Mobile 
seems to be doing a good job of closing all efforts to jailbreak), and although 
no pre-paid plan is supported, you can get on a month to month contract 
(requires both a voice and a data/messaging plans). So, it might be more 
expensive than pre-paid but not necessarily tremendously moreso unless you 
never plan to use the phone in a "normal user" way.

Usually, with hardware you get what you pay for. Ever actually get your hands 
on a Sciphone (with its supposedly "android-like interface")? You're not 
getting nearly the same thing... Features like slide-out keyboards are 
expensive.

I haven't compared to the iPhone 3GS yet, but earlier models had their warts 
compared to the G1, too... Like lack of support for multi-tasking applications, 
poor camera picture quality. Support for multi-tasking might be desirable but 
it also can be demanding... drawing down power quickly, maxing out resource 
utilization. Whatever model of hardware and software you might want to compare, 
you'll likely find feature advantages or lacking every time. So, it's whatever 
floats your boat which should determine whether you choose an iPhone, 
Blackberry, G1 or anything else.

BTW - That's some trick running J2ME on Windows Mobile. There's only one phone 
that supports that configuration with decent performance(not the one you 
mention) which severely restricts that market (unless performance is not an 
issue).

IMO,
Tony





- Original Message -
From: A 
Sent: Thu, 6/11/2009 5:56am
To: Android Beginners 
Subject: [android-beginners] Practical questions


Hi all,

I have some practical questions.

I might be interested in coding for Android. I have some J2ME programs
that I could port that are very useful.

But I am wondering, why bother? Consider:

1.
Looking at the documentation for Android it seems to me that the
learning curve for working with Android is large.

2.
Looking at the available phones they are all about $500 without a
contract. We're in a Recession and $500 is a lot of money. Compare
that to my 3-inch touch screen Sciphone i68 which was $100 and has
MIDP support.

3.
I don't do contracts. I have heard that Android phones are hobbled by
the requirement that I'd have to have a contract. I use prepaid
exclusively to keep my phone bills down.

4.
No contract means no data plan.

5.
I can get a Windows Mobile phone for $260, called the CECT M88+. It
will run native apps and J2ME. That's half the cost of an Android
phone.

6.
Regular consumers know we're in a recession. They are going to avoid
expensive phones and long contracts more now than ever. Will $500
luxury Android phones take hold? I'm skeptical.

7.
I am not someone who is easily impressed by Google. There is no "wow"
factor for me in using Android. I'm entirely pragmatic.

Thanks.






--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: Making .apk files?

2009-06-14 Thread Tony Su

On this related subject,
I may have a need to create the APK using only the command line (not using 
Eclipse).

I didn't seem to notice that the Android SDK supports this, am I missing 
something?

For that matter, what exactly are the different options how to create an APK? 
Are there other packaging apps or utilities?

TIA,
Tony

- Original Message -
From: guruk 
Sent: Sun, 6/14/2009 1:50pm
To: Android Beginners 
Subject: [android-beginners] Re: Making .apk files?


i dont know exactly what you like.
when u use eclipse go to android tools and
export signed or unsigned apk


On Jun 13, 9:54 pm, "[.K]"  wrote:
> I want to test out a program. Now how do I make the apk file? So I
> have my .java file right? Then what?
> Thanks for the help.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: Problem running the Hello World example

2009-06-14 Thread Fahd

All of a sudden it began to work!!!

when running i got two new statements that I didnt before:
[2009-06-14 22:09:29 - HelloAndroid] New emulator found: emulator-5554
[2009-06-14 22:09:29 - HelloAndroid] Waiting for HOME
('android.process.acore') to be launched...

Can anyone help me understand why I may not be getting these and if
these are causing the application to appear in the emulator?

Fahd

On Jun 14, 7:56 am, Fahd  wrote:
> I found out how to clean :)
>
> Ok now a message is coming "Sorry! Process com.android.phone is not
> responding Force close or wait"
>
> nothing happens with either option.
>
> some progress but still no hello android window...
>
> Fahd
>
> On Jun 14, 7:16 am, Fahd  wrote:
>
>
>
> > I see. What do you exactly mean by clean Mike?
>
> > Fahd
>
> > On Jun 14, 3:37 am, Michael Dorin  wrote:
>
> > > I was/am having the same problem.
> > > I saw a post that said do a 'clean'  then exit eclipse and go back in...
> > > then it should work.
> > > Let me know how it goes please.
> > > -Mike
>
> > > On Sat, Jun 13, 2009 at 8:22 PM, Fahd wrote:
>
> > > > Hi All,
>
> > > > I am pretty new to  android development. I followed all the
> > > > instructions to install the android SDK and configure the Eclipse
> > > > environment.
>
> > > > I was then doing the Hello World example. The problem is that when I
> > > > run the following code:
> > > > "
> > > > package com.example.helloandroid;
>
> > > > import android.app.Activity;
> > > > import android.os.Bundle;
> > > > import android.widget.TextView;
>
> > > > public class HelloAndroid extends Activity {
> > > >   /** Called when the activity is first created. */
> > > >   @Override
> > > >   public void onCreate(Bundle savedInstanceState) {
> > > >       super.onCreate(savedInstanceState);
> > > >       TextView tv = new TextView(this);
> > > >       tv.setText("Hello, Android");
> > > >       setContentView(tv);
> > > >   }
> > > > }
> > > > "
> > > > the emulator starts and after some time, when it loads fully, it takes
> > > > me to the android desktop in the mobile. However my helloword
> > > > application never appears! I waited quite a bit after it was fully
> > > > loaded but still nothing. I don't get the blackscreen with "Hello,
> > > > Android" text on it.
>
> > > > I do recall the following errors that occurred when I created the
> > > > HelloAndroid project as per example's instructions:
> > > > "
> > > > [2009-06-14 01:49:17 - HelloAndroid] no classfiles specified
> > > > [2009-06-14 01:49:17 - HelloAndroid] Conversion to Dalvik format
> > > > failed with error 1
> > > > "
>
> > > > Can anyone help me out please?
> > > > Fahd
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: starting the htc dream

2009-06-14 Thread Tony Su

I just went through all that.

I wasn't able to get unrestricted root access to implement any of the 
workarounds posted on the Internet. I tried using Telnet and remote ADP, 
T-Mobile seems to have closed that security hole on all current Android images.

In the end, I setup my Google account beforehand, then waited for T-Mobile to 
activate my G1 upgrade (their funky billing system doesn't support upgrades in 
the middle of a billing cycle unless you're willing to pay an extra month in 
advance).

Also, when connecting to the Google servers, you only enter the mailbox name 
without the "@gmail.com"

I don't know what your options are in Canada, if you insist on not signing up 
with an authorized carrier, you may have to consider flashing to an earlier 
image.

Tony

- Original Message -
From: Yves Dorfsman 
Sent: Fri, 6/12/2009 8:44pm
To: android-beginners@googlegroups.com
Subject: [android-beginners] starting the htc dream



Hi,

I received my HTC dream, installed a sim and the battery, and it prompts me 
to setup my google account. I don't want to setup my google account, I don't 
even have a data plan (and don't plan to get one any time soon as they are 
too expensive in Canada). But, I still want to use the phone and local apps, 
write apps for the phone that I can use on it etc...

I've tried all the buttons, all the menus I could get too etc..., but it 
always returns to the google acocunt setting ?

I can I skip the account setup menu ?



Thanks.

-- 
Yves.
http://www.sollers.ca/




--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



Re: *****SPAM***** [android-beginners] OnClickListener

2009-06-14 Thread Nigel Eke
On Sat, 2009-06-13 at 09:29 -0700, trontron wrote:

> I will refer to the HelloListView tutorial list for a reference.
> 
> How do I set an onclicklistener on a particular item in the list?
> How do I make the response of onclicklistener of a list item to start
> activity2?
> 


You will need to setup an OnItemClickListener.  (Note 'Item').  Then
setOnItemClickListener on the ListView.

Cheers,

Nigel


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: XML Layout Specification

2009-06-14 Thread Mark Murphy

> - What does xmlns mean?

That defines an XML namespace.

http://en.wikipedia.org/wiki/Xml_namespace

> - What is the android:xxx sytnax all about?

That is the use of an XML namespace. It keeps (most) of the Android
attributes out of the way of any other attributes one might layer in from
some other XML dialect for some other purpose.

> - What does the "http://schemas.android.com/apk/res/android"; do?

It is a unique identifier of the namespace.

> - Are there other values I might choose?  (ex. "http://
> schemas.android.com/apk/res/iPhone")

For layouts, not really.

> - Can you create your own Layouts like the "LinearLayout"?

Yes. Subclass ViewGroup, or one of the existing ViewGroup subclasses.
Since your own implementation should not be in the Java android.widget
package, you'll need to fully qualify your widget declaration in the XML:



> - Is there a list of available components like "Button", "TextView"?

If they have no Java package prefix, they are classes in the
android.widget Java package, and are documented in the SDK.

> - What does the @, the / and the + symbol do?

See http://developer.android.com/guide/topics/ui/declaring-layout.html

> - Can I edit this directly in Eclipse with a graphical editor rather
> than editing the xml text?

Uh, sorta. It's not a full drag-and-drop editor. I don't use Eclipse
personally, so I don't have much direct experience with it.

> That's a lot of questions.  So let me sum these up into one simple
> question:
>
> Does anyone know a link to the specification for the XML Layout
> Language for Android?

There is no "specification" per se. The specification is "read the
associated Javadocs", with other material at the URL I listed a couple of
bullets ago.

> Thanks for any hints for a complete newbie.

Welcome to Android!

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 2.0 Available!



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: How to put buttons in a row?

2009-06-14 Thread Mark Murphy

> I am totally newbie for android.
> Today I wrote one example code.
> I would put them 3X3. but buttons won't be in same row.
>
> What I want is here...
>
> button1 button2button3
>
> button4 button5button6
>
> button7 button8button9

You could use:

-- A nested set of LinearLayouts

-- A RelativeLayout, using alignWithParentTop and kin

-- A TableLayout

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 2.0 Available!



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: What DB do you use in android flatform?

2009-06-14 Thread Mark Murphy

> I'm going to design small application in android flatform.
> I need DB to manage data. What DB is mostly used in android?
> and Where can I get the docs?

SQLite is included with Android. http://sqlite.org and
http://developer.android.com for documentation.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 2.0 Available!



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: Porting C project in android

2009-06-14 Thread Mark Murphy

>I am new to android,I had downloaded Android SDK and Eclipse in
> windows,android source code in ubuntu. I created a C project in ubuntu
> and generated shared library of my project using the Android.mk,arm
> compiler that comes with the android source files and make .Now i have
> to integrate/port this .so(shared library) c project in the android
> SDK in windows using Eclipse.If any one came with this kindly suggest
> me how to load/call this .so(shared library of my project) into
> android and execute as an application in the Android phone.

That is not readily possible today. There will (soon?) be a Native
Developer Kit (NDK) which will allow for C code in Android SDK projects.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 2.0 Available!



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Choosing the Right Book

2009-06-14 Thread Mahou

Hi, I have enough for one book and wanted to know your opion on which
on to get. The choices are:

Hello Android

http://www.amazon.com/Hello-Android-Introducing-Development-Platform/dp/1934356174/ref=sr_1_5?ie=UTF8&s=books&qid=1245037980&sr=1-5

or

Unlocking Android

http://www.amazon.com/Unlocking-Android-Frank-Ableson/dp/1933988673/ref=sr_1_4?ie=UTF8&s=books&qid=1245037980&sr=1-4

Any tips?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Hai

2009-06-14 Thread Siva

Im new for this android how to communicate to each other via sms .
using socket .Is there related example pls help me.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: Problem running the Hello World example

2009-06-14 Thread Sheng-Yi Shih
Finally it worked now. I am not sure why but it took like 10 mins.
I found a way to make it easy.
1. Use command line to run the emulator
emulator -avd avd_device_name to let it show the main menu.
2. Run Hello World by eclipse.
3. It will ask you to choose android device. Just select
"Choose a running Android device".
FYI

On Sun, Jun 14, 2009 at 2:11 PM, Fahd  wrote:

>
> All of a sudden it began to work!!!
>
> when running i got two new statements that I didnt before:
> [2009-06-14 22:09:29 - HelloAndroid] New emulator found: emulator-5554
> [2009-06-14 22:09:29 - HelloAndroid] Waiting for HOME
> ('android.process.acore') to be launched...
>
> Can anyone help me understand why I may not be getting these and if
> these are causing the application to appear in the emulator?
>
> Fahd
>
> On Jun 14, 7:56 am, Fahd  wrote:
> > I found out how to clean :)
> >
> > Ok now a message is coming "Sorry! Process com.android.phone is not
> > responding Force close or wait"
> >
> > nothing happens with either option.
> >
> > some progress but still no hello android window...
> >
> > Fahd
> >
> > On Jun 14, 7:16 am, Fahd  wrote:
> >
> >
> >
> > > I see. What do you exactly mean by clean Mike?
> >
> > > Fahd
> >
> > > On Jun 14, 3:37 am, Michael Dorin  wrote:
> >
> > > > I was/am having the same problem.
> > > > I saw a post that said do a 'clean'  then exit eclipse and go back
> in...
> > > > then it should work.
> > > > Let me know how it goes please.
> > > > -Mike
> >
> > > > On Sat, Jun 13, 2009 at 8:22 PM, Fahd wrote:
> >
> > > > > Hi All,
> >
> > > > > I am pretty new to  android development. I followed all the
> > > > > instructions to install the android SDK and configure the Eclipse
> > > > > environment.
> >
> > > > > I was then doing the Hello World example. The problem is that when
> I
> > > > > run the following code:
> > > > > "
> > > > > package com.example.helloandroid;
> >
> > > > > import android.app.Activity;
> > > > > import android.os.Bundle;
> > > > > import android.widget.TextView;
> >
> > > > > public class HelloAndroid extends Activity {
> > > > >   /** Called when the activity is first created. */
> > > > >   @Override
> > > > >   public void onCreate(Bundle savedInstanceState) {
> > > > >   super.onCreate(savedInstanceState);
> > > > >   TextView tv = new TextView(this);
> > > > >   tv.setText("Hello, Android");
> > > > >   setContentView(tv);
> > > > >   }
> > > > > }
> > > > > "
> > > > > the emulator starts and after some time, when it loads fully, it
> takes
> > > > > me to the android desktop in the mobile. However my helloword
> > > > > application never appears! I waited quite a bit after it was fully
> > > > > loaded but still nothing. I don't get the blackscreen with "Hello,
> > > > > Android" text on it.
> >
> > > > > I do recall the following errors that occurred when I created the
> > > > > HelloAndroid project as per example's instructions:
> > > > > "
> > > > > [2009-06-14 01:49:17 - HelloAndroid] no classfiles specified
> > > > > [2009-06-14 01:49:17 - HelloAndroid] Conversion to Dalvik format
> > > > > failed with error 1
> > > > > "
> >
> > > > > Can anyone help me out please?
> > > > > Fahd
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] how to create apk file in android ,like in j2me we create jar and jad files

2009-06-14 Thread janardhan

hi,
i am new to android .
i done some sample applications.
how to create apk files for that one.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---