[android-developers] Re: Is Android backwards compatible?

2009-12-01 Thread Andrex
I'd say if you want to support as many handsets as possible, take
pcm2a's advice and target 1.5. However if you really need to take
advantage of new resolutions or you're not worried about download
totals I'd say target 1.6 and wait for the other devices to catch up.

On Dec 1, 10:14 am, bennyb  wrote:
> Is Android backwards compatible, in other words can an application
> developed in Android 1.6 run in Android 2.0?
>
> I just published a 2.0 application and discovered that I can't find it
> in the market using my G1 (Android 1.6) phone. But apparently others
> are downloading it.
>
> Should I downgrade the application to 1.6 or do I need to create
> separate applications for each Android version?

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


[android-developers] Re: Send message

2008-12-04 Thread andrex

I solved, Just look the class notification, and notificionManager, if
somebody has a quesuion about how, just ask
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Send message

2008-11-26 Thread andrex

Hi Stefan thanks, but Can I send me a message, to the emulator how run
the application? or what can I do if i want to send an alert to the
user, something like a wap push message or maybe a reminder. I'll be
thanks for the answers
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Send message

2008-11-25 Thread andrex

Hi all, can anyone help me, I want to send an auto message or an alert
to the phone. I've trying this

SmsManager sm = SmsManager.getDefault();
sm.sendTextMessage("5554",null, "My text Message", null,
null);

I put 5554 because is the emulator direcction. No errors, but the
emulator don't receive the message. Any idea?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] pass data between activities

2008-11-06 Thread andrex

Hi guys it's  me again. I would like some help whit a little problem.,
I can't recovery the value of the activity that i call. Look the
follow code.

Manifest

 





Main class prueba how extends of mapActivity

this is the way what I call the actvity

Intent i = new Intent(prueba.this, search.class);
startActivityForResult(i, GET_CODE);

This is the metod which is waiting for the value

 protected void onActivityResult(int requestCode, int resultCode,
String data, Bundle extras){
  switch (resultCode) {
case GET_CODE:
// This is the standard resultCode that is sent back if
the
// activity crashed or didn't doesn't supply an explicit
result.
 if (resultCode == RESULT_CANCELED){

 }
 else {

 }

default:
  break;
}

Search class how extend of Activity

@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
Bundle stats = new Bundle();
 stats.putString(ACTIVITY_SERVICE, mText.getText().toString());
 Intent mIntent = new Intent();
 mIntent.putExtras(stats);
 setResult(RESULT_OK, mIntent);
 finish();
}


When you use setResult it suppose that the values are sent to the
class how call the activity.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Create Data Base

2008-10-23 Thread andrex

Thanks Anm, but I'm looking for something diferent, i want to create a
class like this(I got it from android example):

public class base extends ContentProvider {
private static final String TAG = "Base";

private static final String DATABASE_NAME = "base.db";
private static final int DATABASE_VERSION = 2;
private static final String POINTS_TABLE_NAME = "points";
 //   private static final String CITY_TABLE_NAME = "city";
 //   private static final String CATEGORY_TABLE_NAME = "category";

private static HashMap sNotesProjectionMap;

private static final int POINTS = 1;
private static final int POINT_ID = 2;

private static final UriMatcher sUriMatcher;

private static class DatabaseHelper extends SQLiteOpenHelper {

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

@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL("CREATE TABLE " + POINTS_TABLE_NAME + " ("
+ Points._ID + " INTEGER PRIMARY KEY,"
+ Points.NOMBRE + " TEXT,"
+ Points.DESCRIPCION + " TEXT,"
+ Points.DIRECCION + " TEXT,"
+ Points.ALTITUD + " TEXT,"
+ Points.ID_CAT + " TEXT,"
+ Points.ID_CIUDAD + " TEXT,"
+ Points.LATITUD + " TEXT,"
+ Points.LONGUITUD + " TEXT,"
+ Points.URL + " TEXT,"
+ Points.TELEFONO + " TEXT"
+ ");");
}

@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 notes");
onCreate(db);
}
}
private DatabaseHelper mOpenHelper;

@Override
public boolean onCreate() {
mOpenHelper = new DatabaseHelper(getContext());
return true;
}
@Override
public Cursor query(Uri uri, String[] projection, String
selection, String[] selectionArgs,
String sortOrder) {
SQLiteQueryBuilder qb = new SQLiteQueryBuilder();

switch (sUriMatcher.match(uri)) {
case POINTS:
qb.setTables(POINTS_TABLE_NAME);
qb.setProjectionMap(sNotesProjectionMap);
break;

case POINT_ID:
qb.setTables(POINTS_TABLE_NAME);
qb.setProjectionMap(sNotesProjectionMap);
qb.appendWhere(Points._ID + "=" +
uri.getPathSegments().get(1));
break;

default:
throw new IllegalArgumentException("Unknown URI " + uri);
}

// If no sort order is specified use the default
String orderBy;
if (TextUtils.isEmpty(sortOrder)) {
orderBy = tablas.Points.DEFAULT_SORT_ORDER;
} else {
orderBy = sortOrder;
}

// Get the database and run the query
SQLiteDatabase db = mOpenHelper.getReadableDatabase();
Cursor c = qb.query(db, projection, selection, selectionArgs,
null, null, orderBy);

// Tell the cursor what uri to watch, so it knows when its
source data changes
c.setNotificationUri(getContext().getContentResolver(), uri);
return c;
}

@Override
public String getType(Uri uri) {
switch (sUriMatcher.match(uri)) {
case POINTS:
  //  return Notes.CONTENT_TYPE;

case POINT_ID:
//return Notes.CONTENT_ITEM_TYPE;

default:
throw new IllegalArgumentException("Unknown URI " + uri);
}
}

@Override
public Uri insert(Uri uri, ContentValues initialValues) {
// Validate the requested uri
if (sUriMatcher.match(uri) != POINTS) {
throw new IllegalArgumentException("Unknown URI " + uri);
}

ContentValues values;
if (initialValues != null) {
values = new ContentValues(initialValues);
} else {
values = new ContentValues();
}

Long now = Long.valueOf(System.currentTimeMillis());
/*
// Make sure that the fields are all set
if (values.containsKey(NotePad.Notes.CREATED_DATE) == false) {
values.put(NotePad.Notes.CREATED_DATE, now);
}

if (values.containsKey(NotePad.Notes.MODIFIED_DATE) == false)
{
values.put(NotePad.Notes.MODIFIED_DATE, now);
}

if (values.containsKey(NotePad.Notes.TITLE) == false) {
Resources r = Resources.getSystem();
values.put(NotePad.Notes.TITLE,
r.getString(android.R.string.untitled));
}

if (values.containsKey(NotePad.Notes.NOTE) == false) {
values.put(NotePad.Notes.NOTE, "");
} */
values.put(tablas.Points.NOMBRE, "Pizza Hut");
 

[android-developers] Create Data Base

2008-10-21 Thread andrex

Hi all, i was loking for an example of how to create a date base in
sqlitedabase, but I was'n lucky. May someone help me whit that, maybe
an example or a document. Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Help Drawing Over Google Maps

2008-09-26 Thread andrex

Hi I got other question, how can I write a little description. I know
that OverlayItem(prueba.Point , "Title","Snippet") has a tittle but
how can i see that on the map. Thanks for the answer.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Help Drawing Over Google Maps

2008-09-26 Thread andrex


Great

Thanks Peter, It worked so good.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Help Drawing Over Google Maps

2008-09-25 Thread andrex

Hi, I have the follow code on my application:

In the class Prueba:

import android.os.Bundle;
import android.view.*;
import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;

public class prueba extends MapActivity {

Drawable defaultMarker = getResources().getDrawable(
R.drawable.mark);

Canvas ruta = new Canvas();
MapView map;
   GeoPoint Point = new GeoPoint((int) (-1.416402 * 100), (int)
   (-78.025078 * 100));
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
map = (MapView) findViewById(R.id.map);
map.getController().setCenter(Point);
map.displayZoomControls(true);
map.getController().setZoom(7);
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
menu.add(0,1,2, "My Location");
//menu 1
SubMenu sub1 = menu.addSubMenu(3, 2, 3,"Vistas");
sub1.add(3,3,1, "Satelite");
sub1.add(3,4,2, "Trafico");
//menu 2
SubMenu sub = menu.addSubMenu(2, 5, 1,"Zoom");
sub.add(2,6,1, "In");
sub.add(2,7,2, "Out");
return true;
}
@Override
public boolean onMenuItemSelected(int featureId, MenuItem item) {
super.onMenuItemSelected(featureId, item);
WhereAmIOverlay WhereAmIOverlay;
View zoomView;
switch (item.getItemId()) {
case 1:
defaultMarker.setBounds(0, 0,
defaultMarker.getIntrinsicWidth(),
defaultMarker.getIntrinsicHeight());
WhereAmIOverlay = new WhereAmIOverlay(this,defaultMarker);
map.getController().animateTo(Point);
map.getOverlays().add(WhereAmIOverlay);
zoomView = map.getZoomControls();
zoomView.setLayoutParams(new ViewGroup.LayoutParams
(ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.WRAP_CONTENT));
//  map.addView(zoomView);
//map.displayZoomControls(true);
  //  map.getController().setZoom(16);
  //  map.setClickable(true);
//map.setEnabled(true);
return true;
case 3:
map.setSatellite(true);
return true;
case 4:
map.setSatellite(false);
return true;
case 6:
int level = map.getZoomLevel();
map.getController().setZoom(level + 1);
return true;
case 7:
int level1 = map.getZoomLevel();
map.getController().setZoom(level1 - 1);
return true;
 }
 return super.onOptionsItemSelected(item);
   }
@Override
protected boolean isRouteDisplayed() {
// TODO Auto-generated method stub
return false;
}
}

In the class where should draw I got:


import java.util.ArrayList;
import java.util.List;
import android.graphics.*;
import android.graphics.drawable.Drawable;
import com.google.android.maps.*;

public class WhereAmIOverlay extends ItemizedOverlay< OverlayItem>{
private List mItemList = new
ArrayList();
prueba prueba;
GeoPoint geoPoint;
Drawable marker;
private Projection p;
Point point;
Paint paint;
public WhereAmIOverlay(prueba prueba,Drawable defaultMarker) {
super(defaultMarker);
this.prueba = prueba;
paint = new Paint();
mItemList.add(new OverlayItem(prueba.Point , "Title",
"Snippet"));
populate();
}
@Override
public void draw(Canvas canvas, MapView mapView, boolean shadow)
{
super.draw(canvas, mapView, true);
 p = mapView.getProjection();
 point =  p.toPixels(prueba.Point,null);
 canvas.drawCircle(point.x, point.y, 10, paint);
}
@Override
protected OverlayItem createItem(int i) {
return mItemList.get(i);
}
@Override
public int size() {
return mItemList.size();
}
}

But It did'n work. Some help please. Thanks

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



[android-developers] Re: Drawing on MapView

2008-09-25 Thread andrex

Hi peter, i was trying use the code but i can't. I'll show you the
code of my class

import android.graphics.Canvas;
import android.graphics.drawable.Drawable;

import java.io.DataOutputStream;
import java.io.OutputStream;
import java.lang.reflect.Array;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Vector;
import org.apache.http.protocol.HTTP;
import android.os.Bundle;
import android.view.*;
import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;


public class prueba extends MapActivity {

MapView map;
   GeoPoint Point = new GeoPoint((int) (-1.416402 * 100), (int)
   (-78.025078 * 100));
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
map = (MapView) findViewById(R.id.map);
map.getController().setCenter(Point);
 //  map.getController().animateTo(Point);
map.displayZoomControls(false);
map.getController().setZoom(7);
 }
public boolean onKeyDown(int keyCode, KeyEvent event) {
switch(keyCode){
case KeyEvent.KEYCODE_I:
int level = map.getZoomLevel();
map.getController().setZoom(level + 1);
return true;
case KeyEvent.KEYCODE_O:
int level2 = map.getZoomLevel();
map.getController().setZoom(level2 + 1);
return true;
case KeyEvent.KEYCODE_S:
map.setSatellite(true);
return true;
case KeyEvent.KEYCODE_T:
map.setSatellite(false);
return true;
}
return false;
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
menu.add(0,1,2, "My Location");
//menu 1
SubMenu sub1 = menu.addSubMenu(3, 2, 3,"Vistas");
sub1.add(3,3,1, "Satelite");
sub1.add(3,4,2, "Trafico");
//menu 2
SubMenu sub = menu.addSubMenu(2, 5, 1,"Zoom");
sub.add(2,6,1, "In");
sub.add(2,7,2, "Out");
return true;
}
@Override
public boolean onMenuItemSelected(int featureId, MenuItem item) {
super.onMenuItemSelected(featureId, item);
switch (item.getItemId()) {
case 1:

return true;
case 3:
map.setSatellite(true);
return true;
case 4:
map.setSatellite(false);
return true;
case 6:
int level = map.getZoomLevel();
map.getController().setZoom(level + 1);
return true;
case 7:
int level1 = map.getZoomLevel();
map.getController().setZoom(level1 - 1);
return true;
 }
 return super.onOptionsItemSelected(item);
   }
@Override
protected boolean isRouteDisplayed() {
// TODO Auto-generated method stub
return false;
}
}

Over that map i want to draw some information, how i call a class
which extend of ItemizedOverlay. thanx for the help

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



[android-developers] Drawing on MapView

2008-09-17 Thread andrex

Hi, I'm new here, I need some help. I'm building an aplicattion which
show maps. My problem is that I need write information over the map. I
was ussing canvas package but It did not work. Can you help me please.

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



[android-developers] Re: HTC skin now available for Android Emulator!

2008-08-21 Thread Andrex

This is really cool, finally something to change it up a bit. Thanks!

On Aug 21, 12:22 am, Tea Vui Huang <[EMAIL PROTECTED]> wrote:
> HTC skin now available for Android Emulator!http://teavuihuang.com/android
>
> To install, download and unzip "HVGA-P-HTC.zip" to the Android skin
> directory, e.g. "C:\android-sdk-windows-0.9_beta\tools\lib\images
> \skins". To run the Android emulator with this HTC skin, enter this on
> the command line: "emulator -skin HVGA-P-HTC".
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Call out to the community about the poor quality of Android's error messaging

2008-04-04 Thread Andrex

Well that's what you get when you program in the Java language...

Although I agree, some errors are seemingly random. It'd be nice to
have some sort of stability, but I'll make do because of how great
Android is now already.

On Apr 5, 12:19 am, acopernicus <[EMAIL PROTECTED]> wrote:
> Yeah...the Challenge deadline is growing closer, so I needed to spread
> a a little feedback to the Android team about the many days I've just
> spent working around issues in the API.  OK...first off...some of
> those issues were mine but my biggest waste of time has been tracking
> down error messaging like "Null", "IOException", "...".
>
> The error messaging on the MediaPlayer in particular has been killing
> me these last few days but the error messaging throughout the entire
> API in general is AWFUL.  I would like the Google team to please
> realize that..while yes this is a pre-alpha release...many of us are
> wasting many precious hours of our spare time on this project and do
> not have the benefit of the source code that will someday be
> available.  SO it woudl be great if they would please update their
> error messaging to give us a clearer idea of just what has happened
> rather than blank messages or simple "null" statements.
>
> If you feel the same way, then please echo your thoughts on Android's
> error messaging.
>
> Biosopher
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Why don't System.err and System.out point to the console?

2008-04-04 Thread Andrex

It's because the Android code isn't really Java, it's Dalvik, and the
Android emultator makes you report those things to the Dalvik output.
You yourself listed the process to print errors there, I suggest you
use it. ;)

On Apr 4, 7:34 pm, Anil <[EMAIL PROTECTED]> wrote:
> It would be good for Android phones to have a rolling log file that
> doubles as a console.
> That way, when there are problems with applications in production, the
> user can simply push the logs to a server - just as Microsoft does
> now.
> It is weird for developers to not have familiar tools like
> e.printstacktrace() or System.out.println().
> Instead we have something rather inconvenient to use:
>
> http://code.google.com/android/reference/adb.html
>
> "By default, the Android system sends stdout and stderr (System.out
> and System.err) output to /dev/null. In processes that run the Dalvik
> VM, you can have the system write a copy of the output to the log
> file. In this case, the system writes the messages to the log using
> the log tags stdout and stderr, both with priority I.
>
> To route the output in this way, you stop a running emulator/device
> instance and then use the shell command setprop to enable the
> redirection of output. Here's how you do it:
>
> $ adb shell stop
> $ adb shell setprop log.redirect-stdio true
> $ adb shell start"
>
> thanks,
> Anil
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---