[android-developers] Re: possible to lock device?

2008-10-18 Thread hackbod

Take a look in the log and see if there is an error message about not
having a permission; I would assume that there is a permission needed
to do this.

On Oct 17, 7:59 pm, Mast3rpyr0 [EMAIL PROTECTED] wrote:
 hmm that didnt seem to work right, i ran using the debugger and it did
 infact run the method but nothing; heres what i got:

 final PowerManager pm = (PowerManager)
 getSystemService(Context.POWER_SERVICE);
 ...
 if(lock.equals(lock))
                                                 {
                                                         pm.goToSleep(1);
                                                 }

 On Oct 17, 2:53 am, shailesh prakash [EMAIL PROTECTED] wrote:

  Sure it does, but if your phone is stolen then it should wake up in
  password lock mode and ack should send to alternative number or mail
  with gps location and cell ID(network operator's cell).

  On Fri, Oct 17, 2008 at 11:34 AM, hackbod [EMAIL PROTECTED] wrote:

   I believe PowerManager.goToSleep() should lock the device as part of
   putting it to sleep:

  http://code.google.com/android/reference/android/os/PowerManager.html...)

   On Oct 16, 9:51 pm, Mast3rpyr0 [EMAIL PROTECTED] wrote:
   hmm i wish there was a simple lockDevice() method :P
   this is the last thing i need before i want to release my app.
   it goes out for a closed beta on the 22nd.

   On Oct 17, 12:33 am, shailesh prakash [EMAIL PROTECTED] wrote:

Hey Mast3rpyr0,

I did try it earlier but drop in between. I had plans to do it like 
this,
    Send SMS, broadcast receiver will listen it and open msg read
content match with data in SQLite database and change phone state
accordingly.
I implemented till the last and most tedious task, changing phone 
state.
Hope it will help you in some extent

On Fri, Oct 17, 2008 at 9:56 AM, Mast3rpyr0 [EMAIL PROTECTED] wrote:

 Im working on a security app that allows a user to track their phone
 on a web site if they lose the phone or it is stolen. I already have
 the part working where i could do this if a user selected lock on the
 site but once the device gets this data, how can i have the device go
 into the locked state like if the end call button was pressed and ask
 for the patern if the user set one up?
--~--~-~--~~~---~--~~
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] is voip a nightmare on android?

2008-10-18 Thread gs_cmans

hi
   i am new to android platform. i am interested in porting our voip
client application to Android. But i am wondering about the technical
feasibility with Android(as OHA having given up on developers making
performance intensive apps by making Java as language for SDK).

  We face issues on Blackberry platform on this.

  afaik there is no commercial software codec[duplex capable] seems to
be available for java mobile sdks. We were talking to companies who
specialise in audio codec stuff, and they seems to have given up the
effort in developing java codecs for devices.

a. what are the codecs that comes along on the onboard dsp codec?
b. and do we have acces to hardware codec with recorder/player
interface?
c. does sdk apis support full duplex audio? [remember blackberry
public apis has problem with this]


as G1 doesn't yet support calls on gtalk and no onboard SIP stack we
are worried whether the usual NT-op catch will be there on android
platform too; !!!if its the case i promise its gonna be a dump
platform just pretending to be developer friendly.!!!



regs
-g

--~--~-~--~~~---~--~~
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] Activities

2008-10-18 Thread beauty

Have you done any activities/projects on environment.
Share them with us. ... Activity : To burn paper using
the power of the sun ...
@@
http://www.freewebs.com/krishnagri/
http://indianfriendfinder.com/go/g1029652-pmem
http://italianfriendfinder.com/go/g1029652-pmem


--~--~-~--~~~---~--~~
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: SQLite problems: how to use LIKE expression

2008-10-18 Thread jtaylor

Snippet from WikiNotesProvider.java:

case KEYWORD_SEARCH:
// this match searches for a text match in the body of notes
qb.setTables(keywords);
qb.setProjectionMap(KEYWORDS_LIST_PROJECTION_MAP);
qb.appendWhere(body like ? or title like ?);
whereArgs = new String[2];
whereArgs[0] = whereArgs[1] = % + uri.getLastPathSegment() +
%;
break;



- Juan T.

On Oct 17, 10:36 am, Premier [EMAIL PROTECTED] wrote:
 The problem is '%?%' .
 It doesn't recognize that string.

 On 17 Ott, 12:48, Mark Murphy [EMAIL PROTECTED] wrote:

  Premier wrote:
   Hello world,
  likein object, i want to useLIKEexpression in Android

   [CODE]
   private SQLiteDatabase db;
   ...
   Cursor resultCursor= null;
   resultCursor= db.query(false, DB_TABLE, null, idlike%+id+%,
   null, null, null, null, null);
   ...
   [/CODE]

  I have not triedLIKEfrom within Android. SQLite definitely supports
  it, as I have used it from outside Android.

  You may need to switch to rawQuery().

  --
  Mark Murphy (a Commons Guy)http://commonsware.com
  _The Busy Coder's Guide to Android Development_ Version 1.3 Published!
--~--~-~--~~~---~--~~
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: Error using XMPP using Smack API 3.0.4

2008-10-18 Thread 陈立国
2008/10/18 jsm [EMAIL PROTECTED]


 I was trying out the smack API for connecting to gtalk. I was able to
 connect but had two errors.
 Anybody have any ideas on resolving this error?

 First error is something regarding Keystore as shown below:
 --error 1 -
 10-18 08:40:10.884: WARN/System.err(266):
 java.security.KeyStoreException: KeyStore jks implementation not found
 10-18 08:40:10.884: WARN/System.err(266): at
 java.security.KeyStore.getInstance(KeyStore.java:107)
 10-18 08:40:10.894: WARN/System.err(266): at
 org.jivesoftware.smack.ServerTrustManager.init(ServerTrustManager.java:
 61)
 10-18 08:40:10.894: WARN/System.err(266): at

 org.jivesoftware.smack.XMPPConnection.proceedTLSReceived(XMPPConnection.java:
 1115)
 10-18 08:40:10.904: WARN/System.err(266): at
 org.jivesoftware.smack.PacketReader.parsePackets(PacketReader.java:
 313)
 10-18 08:40:10.904: WARN/System.err(266): at
 org.jivesoftware.smack.PacketReader.access$000(PacketReader.java:44)
 10-18 08:40:10.904: WARN/System.err(266): at
 org.jivesoftware.smack.PacketReader$1.run(PacketReader.java:76)
 end err 1 --

 Second error was after I got the connection and I was able to send a
 message but threw the below exception:
 ---error 2-
 10-18 08:40:14.814: WARN/dalvikvm(266): VFY: unable to resolve new-
 instance 201 (Ljava/beans/PropertyDescriptor;) in Lorg/jivesoftware/
 smack/util/PacketParserUtils;
 10-18 08:40:14.834: WARN/dalvikvm(266): VFY:  rejecting opcode 0x22 at
 0x0016
 10-18 08:40:14.834: WARN/dalvikvm(266): VFY:  rejected Lorg/
 jivesoftware/smack/util/PacketParserUtils;.parseWithIntrospection
 (Ljava/lang/String;Ljava/lang/Class;Lorg/xmlpull/v1/
 XmlPullParser;)Ljava/lang/Object;
 10-18 08:40:14.834: WARN/dalvikvm(266): Verifier rejected class Lorg/
 jivesoftware/smack/util/PacketParserUtils;
 10-18 08:40:14.854: WARN/dalvikvm(266): threadid=23: thread exiting
 with uncaught exception (group=0x40010e28)
 10-18 08:40:14.854: ERROR/AndroidRuntime(266): Uncaught handler:
 thread Smack Packet Reader (0) exiting due to uncaught exception
 10-18 08:40:14.864: ERROR/AndroidRuntime(266): java.lang.VerifyError:
 org.jivesoftware.smack.util.PacketParserUtils
 10-18 08:40:14.864: ERROR/AndroidRuntime(266): at
 org.jivesoftware.smack.PacketReader.parsePackets(PacketReader.java:
 278)
 10-18 08:40:14.864: ERROR/AndroidRuntime(266): at
 org.jivesoftware.smack.PacketReader.access$000(PacketReader.java:44)
 10-18 08:40:14.864: ERROR/AndroidRuntime(266): at
 org.jivesoftware.smack.PacketReader$1.run(PacketReader.java:76)
 - end err 2 -
 
 Hi,
   Because smack can't find cacerts security file,this file belong to
JRE(jre\lib\security\cacerts), but android have not the cacerts.Using smack
source and commenting exception code.

Wind

--~--~-~--~~~---~--~~
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: MAC address?

2008-10-18 Thread Al Sutton

Just by looking at the docs, what about getting ANDROID_ID from the 
System Settings?

The docs at 
http://code.google.com/android/reference/android/provider/Settings.System.html 
say;


public static final String
http://code.google.com/android/reference/java/lang/String.html
ANDROID_ID

The Android ID (a unique 64-bit value) as a hex string. Identical to 
that obtained by calling GoogleLoginService.getAndroidId(); it is also 
placed here so you can get it without binding to a service.
Constant Value: android_id

Al.


Mark Murphy wrote:
 nkijak wrote:
   
 Wouldn't you need some other unique ID? Wouldn't the MAC address would
 be different if the user was on wi-fi or the cell network?
 

 Yeah, but I'm running out of answers. TelephonyManager#getDeviceId() 
 requires permissions, and I'm trying to minimize required permissions.

 Besides, I might be able to control which MAC address of the available 
 ones I use for my identifying purposes.

 So...anyone know how to get it?

   


-- 
Al Sutton

W: www.alsutton.com
B: alsutton.wordpress.com
T: twitter.com/alsutton


--~--~-~--~~~---~--~~
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: Android developers UNITE!

2008-10-18 Thread Al Sutton

Reply posted on android-discuss. Hopefully we can leave you guys to read 
more useful emails :).

Al.

david wrote:
 Since Google groups won't let me edit my original post, nor let me
 post this reply to your comments with my AdroitAndroid email address,
 please be aware that I am the original poster.

 I find the lack of trust sad and offensive... but understandable.

 The application fee was meant to provide the LLC with startup cash,
 not to scam anyone.  To address this concern, we have amended the
 program so that THERE IS NO APPLICATION FEE, but anyone accepted as a
 member must buy in, for which they will have documented proof of
 ownership and a signed operating agreement.  The buy in amount will be
 determined when the number of founders is known and will be based on
 the projected costs of running the start-up for six months.

 Note that AdroitAndroid is not an agency.  You won't just be talent
 farmed out for corporate profit.  You will be AN OWNER who SHARES in
 the profit.

 The founders of this organization are experienced technologists,
 entrepreneurs, and management consultants who have strong professional
 credentials and who can provide professional references for anyone who
 has doubts about credibility.  We are doing this to HELP the
 community, not hurt it.

 Please email me at my adroitandroid email address if you are
 interested.



 Joey, to address your second point, Flow 2 works best for the
 developer only if his application sells.  If it doesn't, he's put all
 his time and effort into it for nothing.  This cult, as you call it,
 is a risk-management device so that the developer's risk is shared by
 a community.  Thus, the developers with the top selling projects will
 earn less than they otherwise would, but the developers who would have
 earned less will get more.  It balances everything out...




 On Oct 17, 1:44 pm, Joey Yandle [EMAIL PROTECTED] wrote:
   
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Wow, this is definitely the most blatant scam I've ever seen posted on
 this list.

 
 AdroitAndroid will have a promotional budget to
 advertise and promote your applications and then send you a check for
 a portion of the profits generated on ALL AdroitAndroid applications.
   
 Restrictions and responsibilities:
 -  You must apply for membership in the AdroitAndroid LLC.
 -  There is a $200 non-refundable application fee.
 -  All members must dedicate a (yet to be determined) set number of
 hours to work on AdroitAndroid projects and/or management.
 -  All members will be subject to the operating agreement.
   
 Let's boil this down to the essentials.  I will use DEV to represent the
 independent developer, and AALLC to represent AdroitAndroid LLC, and I
 will break it down to workflows.

 Flow 1
 - --
 DEV pays AALLC $200.
 AALLC tells dev sorry, we don't want you.

 Summary: AALLC gets $200, DEV gets nothing.  Total scam.

 Flow 2
 - --
 DEV pays AALLC $200.
 AALLC tells DEV we want you.
 DEV gives AALLC DEV's apps to sell.
 DEV gives programming and management time to AALLC.
 AALLC pays DEV a portion of the profits.

 Summary: AALLC gets $200, DEV's apps, lots of DEV's time.  DEV gets a
 portion of the profits, which must be less than DEV would have received
 selling DEV's programs (has to pay out management and marketing costs,
 at least).  Not a total scam, more of a cult really.

 So, this offer is either a total scam, or a cult invitation.  I
 sincerely hope no one on this list is stupid enough to fall for this.

 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.5 (GNU/Linux)
 Comment: Using GnuPG with Mozilla -http://enigmail.mozdev.org

 iD8DBQFI+Pk1Nig/07RbnEsRAiRXAKDNzeSykO+EzHdqY5B+k59ykLtUhACg8Wvu
 c8TnyA3Tn6VUlk4vqSfafVQ=
 =uYum
 -END PGP SIGNATURE-
 
 
   


-- 
Al Sutton

W: www.alsutton.com
B: alsutton.wordpress.com
T: twitter.com/alsutton


--~--~-~--~~~---~--~~
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: MAC address?

2008-10-18 Thread Mark Murphy

Al Sutton wrote:
 Just by looking at the docs, what about getting ANDROID_ID from the 
 System Settings?
 
 The docs at 
 http://code.google.com/android/reference/android/provider/Settings.System.html
  
 say;
 
 
 public static final String
 http://code.google.com/android/reference/java/lang/String.html
 ANDROID_ID
 
 The Android ID (a unique 64-bit value) as a hex string. Identical to 
 that obtained by calling GoogleLoginService.getAndroidId(); it is also 
 placed here so you can get it without binding to a service.
 Constant Value: android_id

Ooo!

That's got possibilities! It doesn't really say what the universe of 
unique is, but since it's static, one would hope it is unique to the 
device.

I'll try it out later this morning -- many thanks!

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com

Android Training on the Ranch! -- Mar 16-20, 2009
http://www.bignerdranch.com/schedule.shtml

--~--~-~--~~~---~--~~
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: SQLite problems: how to use LIKE expression

2008-10-18 Thread Anm

From the SQLite3 docs:
The LIKE operator does a pattern matching comparison. The operand to
the right contains the pattern, the left hand operand contains the
string to match against the pattern. A percent symbol % in the pattern
matches any sequence of zero or more characters in the string. An
underscore _ in the pattern matches any single character in the
string. Any other character matches itself or it's lower/upper case
equivalent (i.e. case-insensitive matching).

That said, is the id a text column?  I ask because identifiers are so
often numerical, which would probably fail a LIKE comparison.


Anm



--~--~-~--~~~---~--~~
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] XML Parsing Error

2008-10-18 Thread JavaAndroid

Hi All,
I m just tried XML parsing in Android activity class...When i run the
application i m getting unKnown Error in Screen...

This is my Activity Class
import java.net.URL;

import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;

import org.xml.sax.InputSource;
import org.xml.sax.XMLReader;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;

public class ParsingXML extends Activity {

private final String DEBUG_TAG = ParsingXML;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TextView tv = new TextView(this);
try{
URL url = new URL(http://www.anddev.org/images/tut/basic/
parsingxml/example.xml);

SAXParserFactory spf = SAXParserFactory.newInstance();
SAXParser sp = spf.newSAXParser();

XMLReader xmlReader = sp.getXMLReader();
ExampleHandler exampleHandler = new ExampleHandler();

xmlReader.setContentHandler(exampleHandler);
xmlReader.parse(new InputSource(url.openStream()));

ParsedExampleDataSet parsedExampleDataSet =
exampleHandler.getParsedData();

tv.setText(parsedExampleDataSet.toString());

}catch(Exception e){
tv.setText(Error:  + e.getMessage());
Log.e(DEBUG_TAG, ParsingXMLError, e);
}
this.setContentView(tv);
}
}

And my ExampleHandler class

is
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;

public class ExampleHandler extends DefaultHandler{

private boolean in_outertag = false;
private boolean in_innertag = false;
private boolean in_mymytag = false;

private ParsedExampleDataSet myParsedExampleDataSet = new
ParsedExampleDataSet();

public ParsedExampleDataSet getParsedData(){
return this.myParsedExampleDataSet;
}

public void startDocument() throws SAXException{
this.myParsedExampleDataSet = new ParsedExampleDataSet();
}

public void endDocument(){

}

public void startElement(String nameSpaceURI, String localName,
String qName, Attributes atts) throws SAXException{
if(localName.equals(outertag)){
this.in_outertag = true;
}else if(localName.equals(innertag)){
this.in_innertag = true;
}else if(localName.equals(myTag)){
this.in_mymytag = true;
}else if(localName.equals(tagwithnumber)){
String attributeValue = atts.getValue(thenumber);
int attr = Integer.parseInt(attributeValue);
myParsedExampleDataSet.setExtractedInt(attr);
}
}

 public void endElement(String namespaceURI, String localName,
String qName) throws SAXException{
 if(localName.equals(outertag)){
 this.in_outertag = false;
 }else if(localName.equals(innertag)){
 this.in_innertag = false;
 }else if(localName.equals(myTag)){
this.in_mymytag = true;
}else if(localName.equals(tagwithnumber)){
 }
}

 public void characters(char ch[],int start, int end){
 if(this.in_mymytag){
 myParsedExampleDataSet.setExtractedString(new
String(ch,start,end));
 }
 }

}


ParsedExampleDataSet class is this
public class ParsedExampleDataSet {
private String extractedString = null;
private int extractedInt = 0;

public void setExtractedString(String extractedString){
this.extractedString = extractedString;
}

public String getExtractedString(){
return this.extractedString;
}

public void setExtractedInt(int extractedInt){
this.extractedInt = extractedInt;
}

public int getExtractedInt(){
return this.extractedInt;
}

public String toString(){
return ExtractedString =  + this.extractedString
+ \nExtractedInt =  + this.extractedInt;
}

}


when i run this application i m getting this error

10-18 19:46:33.697: ERROR/OSNetworkSystem(203): unknown socket error
-1
10-18 19:46:33.757: ERROR/ParsingXML(203): ParsingXMLError
10-18 19:46:33.757: ERROR/ParsingXML(203): java.net.SocketException:
unknown error
10-18 19:46:33.757: ERROR/ParsingXML(203): at

[android-developers] Error While Starting Emulator

2008-10-18 Thread JavaAndroid

Hi All,

Whenever i start my emulator i m getting this error in Console..But
anyways its not affecting the Working of apps, this gets printed
during starting...
10-18 19:31:29.449: ERROR/mountd(19): could not read initial mass
storage state
10-18 19:31:29.989: ERROR/flash_image(28): can't find recovery
partition
10-18 19:31:57.798: ERROR/MemoryHeapBase(51): error opening /dev/pmem:
No such file or directory
10-18 19:31:57.820: ERROR/SurfaceFlinger(51): Couldn't open /sys/
android_power/wait_for_fb_sleep or /sys/android_power/wait_for_fb_wake
10-18 19:31:57.918: ERROR/GLLogger(51): couldn't load libhgl.so
library (Cannot find library)
10-18 19:31:58.208: ERROR/GLLogger(51): couldn't load libhgl.so
library (Cannot find library)
10-18 19:32:07.208: ERROR/BatteryService(51): Could not open '/sys/
class/power_supply/usb/online'
10-18 19:32:07.220: ERROR/BatteryService(51): Could not open '/sys/
class/power_supply/battery/batt_vol'
10-18 19:32:07.220: ERROR/BatteryService(51): Could not open '/sys/
class/power_supply/battery/batt_temp'
10-18 19:32:07.789: ERROR/EventHub(51): could not get driver version
for /dev/input/mouse0, Not a typewriter
10-18 19:32:07.818: ERROR/EventHub(51): could not get driver version
for /dev/input/mice, Not a typewriter
10-18 19:32:08.008: ERROR/System(51): Failure starting core service
10-18 19:32:08.008: ERROR/System(51): java.lang.SecurityException
10-18 19:32:08.008: ERROR/System(51): at
android.os.BinderProxy.transact(Native Method)
10-18 19:32:08.008: ERROR/System(51): at
android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:
146)
10-18 19:32:08.008: ERROR/System(51): at
android.os.ServiceManager.addService(ServiceManager.java:72)
10-18 19:32:08.008: ERROR/System(51): at
com.android.server.ServerThread.run(SystemServer.java:155)
10-18 19:32:08.041: ERROR/AndroidRuntime(51): Crash logging skipped,
no checkin service
10-18 19:32:09.410: ERROR/SystemServer(51): Failure starting
StatusBarService
10-18 19:32:09.410: ERROR/SystemServer(51):
java.lang.NullPointerException
10-18 19:32:09.410: ERROR/SystemServer(51): at
com.android.server.status.StatusBarPolicy.updateBluetooth(StatusBarPolicy.java:
749)
10-18 19:32:09.410: ERROR/SystemServer(51): at
com.android.server.status.StatusBarPolicy.init(StatusBarPolicy.java:
282)
10-18 19:32:09.410: ERROR/SystemServer(51): at
com.android.server.status.StatusBarPolicy.installIcons(StatusBarPolicy.java:
337)
10-18 19:32:09.410: ERROR/SystemServer(51): at
com.android.server.ServerThread.run(SystemServer.java:186)
10-18 19:32:09.438: ERROR/AndroidRuntime(51): Crash logging skipped,
no checkin service
10-18 19:32:10.338: ERROR/GpsLocationProvider(51): Could not open GPS
configuration file /etc/gps.conf
10-18 19:32:10.338: ERROR/GpsLocationProvider(51):
java.io.FileNotFoundException: /etc/gps.conf
10-18 19:32:10.338: ERROR/GpsLocationProvider(51): at
org.apache.harmony.luni.platform.OSFileSystem.open(OSFileSystem.java:
227)
10-18 19:32:10.338: ERROR/GpsLocationProvider(51): at
java.io.FileInputStream.init(FileInputStream.java:76)
10-18 19:32:10.338: ERROR/GpsLocationProvider(51): at
com.android.internal.location.GpsLocationProvider.init(GpsLocationProvider.java:
179)
10-18 19:32:10.338: ERROR/GpsLocationProvider(51): at
com.android.server.LocationManagerService._loadProvidersNoSync(LocationManagerService.java:
356)
10-18 19:32:10.338: ERROR/GpsLocationProvider(51): at
com.android.server.LocationManagerService.loadProvidersNoSync(LocationManagerService.java:
340)
10-18 19:32:10.338: ERROR/GpsLocationProvider(51): at
com.android.server.LocationManagerService.loadProviders(LocationManagerService.java:
333)
10-18 19:32:10.338: ERROR/GpsLocationProvider(51): at
com.android.server.LocationManagerService.init(LocationManagerService.java:
447)
10-18 19:32:10.338: ERROR/GpsLocationProvider(51): at
com.android.server.ServerThread.run(SystemServer.java:230)
10-18 19:32:10.361: ERROR/AndroidRuntime(51): Crash logging skipped,
no checkin service
10-18 19:32:25.477: ERROR/NetworkStateTracker(51): Can't set tcp
buffer sizes:java.io.FileNotFoundException: /sys/kernel/ipv4/
tcp_rmem_min
10-18 19:32:46.047: ERROR/AndroidRuntime(188): Uncaught handler:
thread main exiting due to uncaught exception
10-18 19:32:46.047: ERROR/AndroidRuntime(188): *** EXCEPTION IN SYSTEM
PROCESS.  System will crash.
10-18 19:32:46.116: ERROR/AndroidRuntime(188):
java.lang.SecurityException: Permission Denial: starting Intent
{ flags=0x1000 comp={com.dreamapp.employeeinfo.activity/
com.dreamapp.employeeinfo.activity.EmployeeEdit} } from null (pid=-1,
uid=-1) requires null
10-18 19:32:46.116: ERROR/AndroidRuntime(188): at
android.os.Parcel.readException(Parcel.java:1234)
10-18 19:32:46.116: ERROR/AndroidRuntime(188): at
android.os.Parcel.readException(Parcel.java:1222)
10-18 19:32:46.116: ERROR/AndroidRuntime(188): at
android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:
998)

[android-developers] Re: MapActivity and onKeyDown

2008-10-18 Thread Mark Murphy

Ricardo wrote:
 Hi all,
 
 I created a MapActivity/MapView and I override the onKeyDown method
 like this.
 
 But now the back button doesn´t work any more.
 
 Since I returned false in my code, this means I didn´t handle this
 event and it should continue...
 
 So I didn´t understand why the back button crashed..
 
 any idea? thank you
 
 public boolean onKeyDown(int keyCode, KeyEvent event) {
   if (keyCode == KeyEvent.KEYCODE_Z) {
   mapView.getController().zoomIn();
   return true;
   } else if (keyCode == KeyEvent.KEYCODE_X) {
   mapView.getController().zoomOut();
   return true;
   }
 
   return false;
   }

Don't return false. Return super.onKeyDown(keyCode, event). Right now, 
you're overriding all the base functionality.

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

--~--~-~--~~~---~--~~
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: MapActivity and onKeyDown

2008-10-18 Thread Ricardo

Thanks Mark, it´s working now...

I didn´t realize that..

Ricardo

On 18 out, 11:37, Mark Murphy [EMAIL PROTECTED] wrote:
 Ricardo wrote:
  Hi all,

  I created a MapActivity/MapView and I override the onKeyDown method
  like this.

  But now the back button doesn´t work any more.

  Since I returned false in my code, this means I didn´t handle this
  event and it should continue...

  So I didn´t understand why the back button crashed..

  any idea? thank you

  public boolean onKeyDown(int keyCode, KeyEvent event) {
             if (keyCode == KeyEvent.KEYCODE_Z) {
                     mapView.getController().zoomIn();
                     return true;
             } else if (keyCode == KeyEvent.KEYCODE_X) {
                     mapView.getController().zoomOut();
                     return true;
             }

             return false;
     }

 Don't return false. Return super.onKeyDown(keyCode, event). Right now,
 you're overriding all the base functionality.

 --
 Mark Murphy (a Commons Guy)http://commonsware.com
 _The Busy Coder's Guide to Android Development_ Version 1.3 Published!
--~--~-~--~~~---~--~~
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: what the hell is these errors to my emulator bootup every time??

2008-10-18 Thread JavaAndroid

Hi,
Even i m getting this error while emulator starts up.this looks
very sacry..Whats the reason for this? Is there any way to fix
this one...

Thanks in Advance

Thanks
JavaAndroid

On Sep 15, 2:25 am, Megha Joshi [EMAIL PROTECTED] wrote:
 2008/9/14 Nickname [EMAIL PROTECTED]



  Thanks, Megha  God!

  Is it reasonable to make these non-critical scary errors as warnings?

 Yes, could you please log a bug in the public issue tracker for this.





  On Sep 13, 5:39 pm, Megha Joshi [EMAIL PROTECTED] wrote:
   2008/9/13 Nickname [EMAIL PROTECTED]

And, what is /etc/gps.conf stuff? is it critical? how to fix the
problem?

Looks scary

   gps.conf error is not critical...this file is not needed for the mock gps
   feature on emulator. So you can ignore this error.

(attached error log)

  ---­

09-13 17:28:03.009: ERROR/mountd(20): could not read initial mass
storage state
09-13 17:29:47.819: ERROR/MemoryHeapBase(52): error opening /dev/pmem:
No such file or directory
09-13 17:29:48.050: ERROR/SurfaceFlinger(52): Couldn't open /sys/
android_power/wait_for_fb_sleep or /sys/android_power/wait_for_fb_wake
09-13 17:29:48.369: ERROR/GLLogger(52): couldn't load libhgl.so
library (Cannot find library)
09-13 17:29:49.910: ERROR/GLLogger(52): couldn't load libhgl.so
library (Cannot find library)
09-13 17:30:51.270: ERROR/BatteryService(52): Could not open '/sys/
class/power_supply/usb/online'
09-13 17:30:51.339: ERROR/BatteryService(52): Could not open '/sys/
class/power_supply/battery/batt_vol'
09-13 17:30:51.358: ERROR/BatteryService(52): Could not open '/sys/
class/power_supply/battery/batt_temp'
09-13 17:30:54.029: ERROR/EventHub(52): could not get driver version
for /dev/input/mouse0, Not a typewriter
09-13 17:30:54.099: ERROR/EventHub(52): could not get driver version
for /dev/input/mice, Not a typewriter
09-13 17:30:55.030: ERROR/System(52): Failure starting core service
09-13 17:30:55.030: ERROR/System(52): java.lang.SecurityException
09-13 17:30:55.030: ERROR/System(52):     at
android.os.BinderProxy.transact(Native Method)
09-13 17:30:55.030: ERROR/System(52):     at
android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:
146)
09-13 17:30:55.030: ERROR/System(52):     at
android.os.ServiceManager.addService(ServiceManager.java:72)
09-13 17:30:55.030: ERROR/System(52):     at
com.android.server.ServerThread.run(SystemServer.java:151)
09-13 17:30:55.219: ERROR/AndroidRuntime(52): Crash logging skipped,
no checkin service
09-13 17:31:01.809: ERROR/GpsLocationProvider(52): Could not open GPS
configuration file /etc/gps.conf
09-13 17:31:01.809: ERROR/GpsLocationProvider(52):
java.io.FileNotFoundException: /etc/gps.conf
09-13 17:31:01.809: ERROR/GpsLocationProvider(52):     at
org.apache.harmony.luni.platform.OSFileSystem.open(OSFileSystem.java:
227)
09-13 17:31:01.809: ERROR/GpsLocationProvider(52):     at
java.io.FileInputStream.init(FileInputStream.java:76)
09-13 17:31:01.809: ERROR/GpsLocationProvider(52):     at

  com.android.internal.location.GpsLocationProvider.init(GpsLocationProvide­r.java:
179)
09-13 17:31:01.809: ERROR/GpsLocationProvider(52):     at

  com.android.server.LocationManagerService._loadProvidersNoSync(LocationMana­gerService.java:
312)
09-13 17:31:01.809: ERROR/GpsLocationProvider(52):     at

  com.android.server.LocationManagerService.loadProvidersNoSync(LocationManag­erService.java:
296)
09-13 17:31:01.809: ERROR/GpsLocationProvider(52):     at

  com.android.server.LocationManagerService.loadProviders(LocationManagerServ­ice.java:
289)
09-13 17:31:01.809: ERROR/GpsLocationProvider(52):     at

  com.android.server.LocationManagerService.init(LocationManagerService.jav­a:
403)
09-13 17:31:01.809: ERROR/GpsLocationProvider(52):     at
com.android.server.ServerThread.run(SystemServer.java:225)
09-13 17:31:01.919: ERROR/AndroidRuntime(52): Crash logging skipped,
no checkin service
09-13 17:31:31.380: ERROR/jdwp(94): Failed sending reply to debugger:
Broken pipe
09-13 17:31:32.089: ERROR/jdwp(94): ERROR: bad handshake ''- Hide 
quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
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: XML Parsing Error

2008-10-18 Thread Ludwig
I think you can see from your stack that you do not even get near your XML
parsing code.It is my impression that you fail open the Http connection to
get the file.
This might be because you have not given permission to your app to access
the internet.

Could you check that you have
  uses-permission android:name=android.permission.INTERNET /
in your AndroidManifest.xml?

Ludwig

2008/10/18 JavaAndroid [EMAIL PROTECTED]


 Hi All,
 I m just tried XML parsing in Android activity class...When i run the
 application i m getting unKnown Error in Screen...

 This is my Activity Class
 import java.net.URL;

 import javax.xml.parsers.SAXParser;
 import javax.xml.parsers.SAXParserFactory;

 import org.xml.sax.InputSource;
 import org.xml.sax.XMLReader;

 import android.app.Activity;
 import android.os.Bundle;
 import android.util.Log;
 import android.widget.TextView;

 public class ParsingXML extends Activity {

private final String DEBUG_TAG = ParsingXML;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TextView tv = new TextView(this);
try{
URL url = new URL(http://www.anddev.org/images/tut/basic/
 parsingxml/example.xmlhttp://www.anddev.org/images/tut/basic/parsingxml/example.xml
 );

SAXParserFactory spf = SAXParserFactory.newInstance();
SAXParser sp = spf.newSAXParser();

XMLReader xmlReader = sp.getXMLReader();
ExampleHandler exampleHandler = new ExampleHandler();

xmlReader.setContentHandler(exampleHandler);
xmlReader.parse(new InputSource(url.openStream()));

ParsedExampleDataSet parsedExampleDataSet =
 exampleHandler.getParsedData();

tv.setText(parsedExampleDataSet.toString());

}catch(Exception e){
tv.setText(Error:  + e.getMessage());
Log.e(DEBUG_TAG, ParsingXMLError, e);
}
this.setContentView(tv);
}
 }

 And my ExampleHandler class

 is
 import org.xml.sax.Attributes;
 import org.xml.sax.SAXException;
 import org.xml.sax.helpers.DefaultHandler;

 public class ExampleHandler extends DefaultHandler{

private boolean in_outertag = false;
private boolean in_innertag = false;
private boolean in_mymytag = false;

private ParsedExampleDataSet myParsedExampleDataSet = new
 ParsedExampleDataSet();

public ParsedExampleDataSet getParsedData(){
return this.myParsedExampleDataSet;
}

public void startDocument() throws SAXException{
this.myParsedExampleDataSet = new ParsedExampleDataSet();
}

public void endDocument(){

}

public void startElement(String nameSpaceURI, String localName,
 String qName, Attributes atts) throws SAXException{
if(localName.equals(outertag)){
this.in_outertag = true;
}else if(localName.equals(innertag)){
this.in_innertag = true;
}else if(localName.equals(myTag)){
this.in_mymytag = true;
}else if(localName.equals(tagwithnumber)){
String attributeValue = atts.getValue(thenumber);
int attr = Integer.parseInt(attributeValue);
myParsedExampleDataSet.setExtractedInt(attr);
}
}

 public void endElement(String namespaceURI, String
 localName,
 String qName) throws SAXException{
 if(localName.equals(outertag)){
 this.in_outertag = false;
 }else if(localName.equals(innertag)){
 this.in_innertag = false;
 }else if(localName.equals(myTag)){
this.in_mymytag = true;
}else if(localName.equals(tagwithnumber)){
 }
}

 public void characters(char ch[],int start, int end){
 if(this.in_mymytag){

 myParsedExampleDataSet.setExtractedString(new
 String(ch,start,end));
 }
 }

 }


 ParsedExampleDataSet class is this
 public class ParsedExampleDataSet {
private String extractedString = null;
private int extractedInt = 0;

public void setExtractedString(String extractedString){
this.extractedString = extractedString;
}

public String getExtractedString(){
return this.extractedString;
}

public void setExtractedInt(int extractedInt){
this.extractedInt = extractedInt;
}

public int getExtractedInt(){
return this.extractedInt;
}

public String 

[android-developers] writing a image to The local memory?

2008-10-18 Thread [EMAIL PROTECTED]

Hey guys, im trying to see if i can create thumbnails for a ftp app,
so i figured id need to download the image file from the server, and
have it stored somewhere, but how would i go about this? or if there
is a easier way to go about this, IE where i dont have to download the
picture, or i can create an image with a url(createImage does this)
and then use the url for the picture to create the thumbnail. if
anyone can help it would be a humongous help for me. Thanks Anthony
--~--~-~--~~~---~--~~
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: XML Parsing Error

2008-10-18 Thread JavaAndroid

Hi Ludwig,
Thanks for ur Response.. i added that entry. After adding uses-
permission tag in androidmanifest.xml, i was getting
UnknownHostException...it was basically due to URL classI replaced
everything with HTTPClient classes

Here is my modified class and it worked me.
import java.io.InputStream;

import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;

import org.apache.commons.httpclient.HostConfiguration;
import org.apache.commons.httpclient.HttpConnection;
import org.apache.commons.httpclient.HttpConnectionManager;
import org.apache.commons.httpclient.HttpState;
import org.apache.commons.httpclient.HttpURL;
import org.apache.commons.httpclient.SimpleHttpConnectionManager;
import org.apache.commons.httpclient.methods.PostMethod;
import org.xml.sax.InputSource;
import org.xml.sax.XMLReader;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;

public class ParsingXML extends Activity {

private final String DEBUG_TAG = ParsingXML;
protected HttpConnectionManager connectionManager = new
SimpleHttpConnectionManager();
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TextView tv = new TextView(this);
String baseURL = http://www.anddev.org/images/tut/basic/
parsingxml/example.xml;
HttpConnection connection = null;
try{
HttpURL httpURL = new HttpURL(baseURL);
HostConfiguration host = new HostConfiguration();
host.setHost(httpURL.getHost(), httpURL.getPort());
connection = connectionManager.getConnection(host);
Log.d(MyLogger, Before Opening Conn);
connection.open();
PostMethod postMethod = new PostMethod(baseURL);
postMethod.execute(new HttpState(), connection);
InputStream response = postMethod.getResponseBodyAsStream();
Log.d(MyLogger, response.toString());
SAXParserFactory spf = SAXParserFactory.newInstance();
SAXParser sp = spf.newSAXParser();
XMLReader xmlReader = sp.getXMLReader();
ExampleHandler exampleHandler = new ExampleHandler();
xmlReader.setContentHandler(exampleHandler);
xmlReader.parse(new InputSource(response));
ParsedExampleDataSet parsedExampleDataSet =
exampleHandler.getParsedData();
tv.setText(parsedExampleDataSet.toString());

}catch(Exception e){
tv.setText(Error:  + e.getMessage());
Log.e(DEBUG_TAG, ParsingXMLError, e);
}
this.setContentView(tv);
}
}

 i got response from that Specified URL

Thanks
JavaAndroid



On Oct 18, 9:37 pm, Ludwig [EMAIL PROTECTED] wrote:
 I think you can see from your stack that you do not even get near your XML
 parsing code.It is my impression that you fail open the Http connection to
 get the file.
 This might be because you have not given permission to your app to access
 the internet.

 Could you check that you have
           uses-permission android:name=android.permission.INTERNET /
 in your AndroidManifest.xml?

 Ludwig

 2008/10/18 JavaAndroid [EMAIL PROTECTED]





  Hi All,
  I m just tried XML parsing in Android activity class...When i run the
  application i m getting unKnown Error in Screen...

  This is my Activity Class
  import java.net.URL;

  import javax.xml.parsers.SAXParser;
  import javax.xml.parsers.SAXParserFactory;

  import org.xml.sax.InputSource;
  import org.xml.sax.XMLReader;

  import android.app.Activity;
  import android.os.Bundle;
  import android.util.Log;
  import android.widget.TextView;

  public class ParsingXML extends Activity {

         private final String DEBUG_TAG = ParsingXML;
     /** Called when the activity is first created. */
    [EMAIL PROTECTED]
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         TextView tv = new TextView(this);
         try{
                 URL url = new URL(http://www.anddev.org/images/tut/basic/
  parsingxml/example.xmlhttp://www.anddev.org/images/tut/basic/parsingxml/example.xml
  );

                 SAXParserFactory spf = SAXParserFactory.newInstance();
                 SAXParser sp = spf.newSAXParser();

                 XMLReader xmlReader = sp.getXMLReader();
                 ExampleHandler exampleHandler = new ExampleHandler();

                 xmlReader.setContentHandler(exampleHandler);
                 xmlReader.parse(new InputSource(url.openStream()));

                 ParsedExampleDataSet parsedExampleDataSet =
  exampleHandler.getParsedData();

                 tv.setText(parsedExampleDataSet.toString());

         }catch(Exception e){
                 tv.setText(Error:  + e.getMessage());
             

[android-developers] Re: Displaying Images

2008-10-18 Thread JavaAndroid

Hi All,
I figured out the problemthe problem is with main.xml
Earlier it was
Gallery d=@+id/gallery
android:layout_width=fill_parent
android:layout_height=wrap_content
android:gravity=bottom
/
i changed it to
this
Gallery android:id=@+id/gallery
android:layout_width=fill_parent
android:layout_height=wrap_content
android:gravity=bottom
/
this resolved the error...
Thanks
JavaAndroid

On Oct 17, 4:56 pm, JavaAndroid [EMAIL PROTECTED] wrote:
 Hi All,
 I tried displaying a small image in ContentView. But when i run the
 application It says ImageApplication closed unexpectedly

 This is my Activity Class...

 public class ImageApplication extends Activity {
     /** Called when the activity is first created. */
     @Override
     public void onCreate(Bundle icicle) {
         super.onCreate(icicle);
         setContentView(R.layout.main);
         ((Gallery) findViewById(R.id.gallery))
                .setAdapter(new ImageAdapter(this));
     }

 }

 And my Image Adapter class is this
 public class ImageAdapter extends BaseAdapter {
     /** The parent context */
        private Context myContext;

        /** All images to be displayed.
         * Put some images to project-folder:
         * '/res/drawable/uvw.xyz' .*/
        private int[] myImageIds = {
               R.drawable.image1

        };
        /** Simple Constructor saving the 'parent' context. */
        public ImageAdapter(Context c) { this.myContext = c; }

        /** Returns the amount of images we have defined. */
        public int getCount() { return this.myImageIds.length; }

        /* Use the array-Positions as unique IDs */
        public Object getItem(int position) { return position; }
        public long getItemId(int position) { return position; }

           /** Returns a new ImageView to
      * be displayed, depending on
      * the position passed. */
     public View getView(int position, View convertView, ViewGroup
 parent) {
         ImageView i = new ImageView(this.myContext);

         i.setImageResource(this.myImageIds[position]);
         /* Image should be scaled as width/height are set. */
         i.setScaleType(ImageView.ScaleType.FIT_XY);
         /* Set the Width/Height of the ImageView. */
         i.setLayoutParams(new Gallery.LayoutParams(150, 150));
         return i;
     }

     /** Returns the size (0.0f to 1.0f) of the views
      * depending on the 'offset' to the center. */
     public float getScale(boolean focused, int offset) {
       /* Formula: 1 / (2 ^ offset) */
         return Math.max(0, 1.0f / (float)Math.pow(2,
 Math.abs(offset)));
     }

 }

 When i run the appliction i m getting this Exception in console...
 10-17 17:14:09.864: ERROR/AndroidRuntime(203):
 java.lang.RuntimeException: Unable to start activity
 ComponentInfo{com.dreamapp.imageapplication.activity/
 com.dreamapp.imageapplication.activity.ImageApplication}:
 java.lang.NullPointerException
 10-17 17:14:09.864: ERROR/AndroidRuntime(203):     at
 android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
 2140)
 10-17 17:14:09.864: ERROR/AndroidRuntime(203):     at
 android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
 2156)
 10-17 17:14:09.864: ERROR/AndroidRuntime(203):     at
 android.app.ActivityThread.access$1800(ActivityThread.java:112)
 10-17 17:14:09.864: ERROR/AndroidRuntime(203):     at
 android.app.ActivityThread$H.handleMessage(ActivityThread.java:1580)
 10-17 17:14:09.864: ERROR/AndroidRuntime(203):     at
 android.os.Handler.dispatchMessage(Handler.java:88)
 10-17 17:14:09.864: ERROR/AndroidRuntime(203):     at
 android.os.Looper.loop(Looper.java:123)
 10-17 17:14:09.864: ERROR/AndroidRuntime(203):     at
 android.app.ActivityThread.main(ActivityThread.java:3742)
 10-17 17:14:09.864: ERROR/AndroidRuntime(203):     at
 java.lang.reflect.Method.invokeNative(Native Method)
 10-17 17:14:09.864: ERROR/AndroidRuntime(203):     at
 java.lang.reflect.Method.invoke(Method.java:515)
 10-17 17:14:09.864: ERROR/AndroidRuntime(203):     at
 com.android.internal.os.ZygoteInit
 $MethodAndArgsCaller.run(ZygoteInit.java:739)
 10-17 17:14:09.864: ERROR/AndroidRuntime(203):     at
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:497)
 10-17 17:14:09.864: ERROR/AndroidRuntime(203):     at
 dalvik.system.NativeStart.main(Native Method)
 10-17 17:14:09.864: ERROR/AndroidRuntime(203): Caused by:
 java.lang.NullPointerException
 10-17 17:14:09.864: ERROR/AndroidRuntime(203):     at
 com.dreamapp.imageapplication.activity.ImageApplication.onCreate(ImageAppli­cation.java:
 17)
 10-17 17:14:09.864: ERROR/AndroidRuntime(203):     at
 android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
 1122)
 10-17 17:14:09.864: ERROR/AndroidRuntime(203):     at
 android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
 2103)
 10-17 17:14:09.864: ERROR/AndroidRuntime(203):     ... 11 more

 I have entry for id named gallery in 

[android-developers] Stored data files in Android App

2008-10-18 Thread Le Duc Bao

Dear,

I build a Android program with some static data files.

I looked at Android Document:
Android provides access to read or write streams to files local to an
application. Call Context.openFileOutput() and Context.openFileInput()
with a local name and path to read and write files. Calling these
methods with the same name and path strings from another application
will not work; you can only access local files.

If I have some existent data files, where they could be placed and how
to read them by using Context.openFile*() methods?

Thanks,
Bao Le Duc

--~--~-~--~~~---~--~~
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] USB signal control class?

2008-10-18 Thread chamika

Hi I'm very new to android. This question regard to my future project.
For instance what I want to know is;
Is there any class to control the USB signal output using android.
Up to now I have found that there were class called android.os.IUsb
but no longer exist.
Is this class suit to my requirement?

Please help me!.
I'm under a situation of selecting a technology

--~--~-~--~~~---~--~~
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] How can the app icon be changed at runtime

2008-10-18 Thread omni

I'd like to be able to change the application icon at runtime; either
by providing a completely new image, or by applying badgest to the
existing icon.

Can't seem to find a way to do it that actually works, and group
search only reveals posts about changing views in  an activity.

TIA!


--~--~-~--~~~---~--~~
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] Populating a Spinner from SQLite

2008-10-18 Thread humanoid

All:

Has anybody figured out how to populate a Spinner from SQLite table,
displaying a description in the dropdown but getting an _id upon the
user clicking on a value.

I am trying to recreate the HTML select with which I am sure you are
all familiar.

Any feedback appreciated.

P.S. I know how to populate and display a single column values.

--~--~-~--~~~---~--~~
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: Android developers UNITE!

2008-10-18 Thread david

Bill,

Yes, much more information is available for those that are
interested.  I didn't want to dump too much info here... just post a
bit of info to let those that might want to participate know what's
going on and to contact me for the details.  The answers to the
questions you asked are provided to all that contact me indicating
their interest.

This is the end of this thread in this forum.  Please go to Android
Discussion for follow-ups on this topic.



On Oct 17, 10:55 pm, Bill Zimmerly [EMAIL PROTECTED] wrote:
 David, it might help your image if you filled out your profile
 information and perhaps posted your estimated costs to run the
 business for six months. Suppose you have 10 founders, what is the
 buy-in for each of them?

 (Furthermore, how do these founders differ from the other founders
 you wrote about later on in the posting?)

 Personally as an Android developer, I would want to know *** A LOT ***
 more about your plans than what little you've posted so far on the
 three forums that you've posted to.

 When I go to http://adroitandroid.com/;, I see nothing but a large
 graphic on the page.

 You wrote,

 The founders of this organization are experienced technologists,
 entrepreneurs, and management consultants who have strong professional
 credentials and who can provide professional references for anyone who
 has doubts about credibility.  We are doing this to HELP the
 community, not hurt it.

 Perhaps you can share with us some bio information of the founders of
 this organization that you described in the present tense - beginning
 with yourself.

 And please don't tell us that your head-quarters are in Nigeria!  :)
--~--~-~--~~~---~--~~
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] ListActivity with CursorAdaptor and updating

2008-10-18 Thread Eric B

If you are creating a ListActivity with a CursorAdapter (or
SimpleCursorAdapter), then you may want to have the list updated at
some point.  I had a little trouble figuring this out myself, so I
thought I'd post how to do it.

After updating your database, you want to get the cursor from the
adapter and call the Cursor.requery() method on it.  This is the
method I've created for my list activity class.  Please note that the
BaseCursor.notifyDataSetChanged() method doesn't update the list (at
least not for me).

/**
 * Refreshes this list
 */
private void refreshList() {
if (getListAdapter() == null || !(getListAdapter() instanceof
CursorAdapter)) {
return;
}

CursorAdapter ca = (CursorAdapter) getListAdapter();
if (ca.getCursor() == null) {
return;
}

ca.getCursor().requery();
}

Thanks,
Eric
--~--~-~--~~~---~--~~
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: ListActivity with CursorAdaptor and updating

2008-10-18 Thread Eric B

I'm using version 1.0_r1
--~--~-~--~~~---~--~~
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: Populating a Spinner from SQLite

2008-10-18 Thread GUS

Well, I have an application that does that, but its for version m5.
The code was something like this:

// SPINNER
s1 = (Spinner) findViewById(R.id.spinner1);
ArrayAdapterCharSequence adapter =
ArrayAdapter.createFromResource(
this, R.array.tipo, 
android.R.layout.simple_spinner_item);
adapter

.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
s1.setAdapter(adapter);
//  s1.setSelection(1);

s1.setOnItemSelectedListener(new 
Spinner.OnItemSelectedListener() {

public void onItemSelected(AdapterView parent, View v,
int position, long id) {
tipo = position;
}

public void onNothingSelected(AdapterView arg0) {
// TODO Auto-generated method stub

}
});
// END SPINNER

I'm gonna migrate the application an tell you later if something has
changed.

cordially, Gus.
http://www.androidforum.com.br


On 18 out, 12:06, humanoid [EMAIL PROTECTED] wrote:
 All:

 Has anybody figured out how to populate a Spinner from SQLite table,
 displaying a description in the dropdown but getting an _id upon the
 user clicking on a value.

 I am trying to recreate the HTML select with which I am sure you are
 all familiar.

 Any feedback appreciated.

 P.S. I know how to populate and display a single column values.
--~--~-~--~~~---~--~~
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: possible to lock device?

2008-10-18 Thread Mast3rpyr0

i added device_power but doesnt seem to do anything.

On Oct 18, 8:01 am, e [EMAIL PROTECTED] wrote:
 im have error

 10-18 17:27:58.569: ERROR/AndroidRuntime(204): Uncaught handler:
 thread main exiting due to uncaught exception
 10-18 17:27:58.581: ERROR/AndroidRuntime(204):
 java.lang.SecurityException: Neither user 10017 nor current process
 has android.permission.DEVICE_POWER.
 10-18 17:27:58.581: ERROR/AndroidRuntime(204):     at
 android.os.Parcel.readException(Parcel.java:1234)
 10-18 17:27:58.581: ERROR/AndroidRuntime(204):     at
 android.os.Parcel.readException(Parcel.java:1222)
 10-18 17:27:58.581: ERROR/AndroidRuntime(204):     at
 android.os.IPowerManager$Stub$Proxy.goToSleep(IPowerManager.java:175)
 10-18 17:27:58.581: ERROR/AndroidRuntime(204):     at
 android.os.PowerManager.goToSleep(PowerManager.java:364)
 10-18 17:27:58.581: ERROR/AndroidRuntime(204):     at
 aexp.phoneintent.MyPhoneStateListener.onCallStateChanged(MyPhoneStateListener.java:
 114)
 10-18 17:27:58.581: ERROR/AndroidRuntime(204):     at
 android.telephony.PhoneStateListener
 $2.handleMessage(PhoneStateListener.java:254)
 10-18 17:27:58.581: ERROR/AndroidRuntime(204):     at
 android.os.Handler.dispatchMessage(Handler.java:88)
 10-18 17:27:58.581: ERROR/AndroidRuntime(204):     at
 android.os.Looper.loop(Looper.java:123)
 10-18 17:27:58.581: ERROR/AndroidRuntime(204):     at
 android.app.ActivityThread.main(ActivityThread.java:3742)
 10-18 17:27:58.581: ERROR/AndroidRuntime(204):     at
 java.lang.reflect.Method.invokeNative(Native Method)
 10-18 17:27:58.581: ERROR/AndroidRuntime(204):     at
 java.lang.reflect.Method.invoke(Method.java:515)
 10-18 17:27:58.581: ERROR/AndroidRuntime(204):     at
 com.android.internal.os.ZygoteInit
 $MethodAndArgsCaller.run(ZygoteInit.java:739)
 10-18 17:27:58.581: ERROR/AndroidRuntime(204):     at
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:497)
 10-18 17:27:58.581: ERROR/AndroidRuntime(204):     at
 dalvik.system.NativeStart.main(Native Method)

 im using permission

 uses-permission android:name=android.permission.WAKE_LOCK/uses-
 permission
 uses-permission android:name=android.permission.DEVICE_POWER/uses-
 permission
 On Oct 18, 11:32 am, hackbod [EMAIL PROTECTED] wrote:

  Take a look in the log and see if there is an error message about not
  having a permission; I would assume that there is a permission needed
  to do this.

  On Oct 17, 7:59 pm, Mast3rpyr0 [EMAIL PROTECTED] wrote:

   hmm that didnt seem to work right, i ran using the debugger and it did
   infact run the method but nothing; heres what i got:

   final PowerManager pm = (PowerManager)
   getSystemService(Context.POWER_SERVICE);
   ...
   if(lock.equals(lock))
                                                   {
                                                           
   pm.goToSleep(1);
                                                   }

   On Oct 17, 2:53 am, shailesh prakash [EMAIL PROTECTED] wrote:

Sure it does, but if your phone is stolen then it should wake up in
password lock mode and ack should send to alternative number or mail
with gps location and cell ID(network operator's cell).

On Fri, Oct 17, 2008 at 11:34 AM, hackbod [EMAIL PROTECTED] wrote:

 I believe PowerManager.goToSleep() should lock the device as part of
 putting it to sleep:

http://code.google.com/android/reference/android/os/PowerManager.html...)

 On Oct 16, 9:51 pm, Mast3rpyr0 [EMAIL PROTECTED] wrote:
 hmm i wish there was a simple lockDevice() method :P
 this is the last thing i need before i want to release my app.
 it goes out for a closed beta on the 22nd.

 On Oct 17, 12:33 am, shailesh prakash [EMAIL PROTECTED] wrote:

  Hey Mast3rpyr0,

  I did try it earlier but drop in between. I had plans to do it 
  like this,
      Send SMS, broadcast receiver will listen it and open msg read
  content match with data in SQLite database and change phone state
  accordingly.
  I implemented till the last and most tedious task, changing phone 
  state.
  Hope it will help you in some extent

  On Fri, Oct 17, 2008 at 9:56 AM, Mast3rpyr0 [EMAIL PROTECTED] 
  wrote:

   Im working on a security app that allows a user to track their 
   phone
   on a web site if they lose the phone or it is stolen. I already 
   have
   the part working where i could do this if a user selected lock 
   on the
   site but once the device gets this data, how can i have the 
   device go
   into the locked state like if the end call button was pressed 
   and ask
   for the patern if the user set one up?
--~--~-~--~~~---~--~~
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, 

[android-developers] Location Providers

2008-10-18 Thread Bradley Kite

Hi all,

The LocationProvider class (android.location.LocationProvider) is
documented as being an abstract super-class, However I could not find
any concrete classes (eg GPSLocationProvider, CellLocationProvider,
WifiLocationProvider etc.).

Does any body (either from within google, or otherwise) know which
location providers are actually implemented?

How would one go about implementing other LocationProviders?

Many thanks in advance.
--
Brad.

--~--~-~--~~~---~--~~
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] WiFi Ad-hoc networks in android?

2008-10-18 Thread corjuela

I'm interested in developing an application which involve a wifi ad-
hoc network created by the app. itself. Can anyone tell me if it is
possible? and more important . how?  ;-) . 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] ContentProviders and Security of SQL Snippets

2008-10-18 Thread Anm


If I understand the ContentProvider API correctly, much of the API
comes from passing SQL snippets for projects, selection, sort, etc.
This strikes me as particularly dangerous, as these snippets can
easily come from malicious, third party apps.  http://xkcd.com/327/
comes to mind, but this seems worse, as we're dealing with actual SQL,
rather than just string parameters that can be encoded.

I'm sure Google has thought about these problems, and I'm wondering if
anything exists in the APIs or automatically behind the scenes to
sanitize the strings coming into a ContentProvider.

I see some discussion about this issue here:
  http://code.google.com/p/android/issues/detail?id=159
But no follow-up.  (It seems strange to me that this security related
bug, arising from a fundamental design flaw of a core API is
acknowledged as a defect but only marked as Medium priority.)



Anm
--~--~-~--~~~---~--~~
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: ContentProviders and Security of SQL Snippets

2008-10-18 Thread Mark Murphy

Anm wrote:
 If I understand the ContentProvider API correctly, much of the API
 comes from passing SQL snippets for projects, selection, sort, etc.

The API makes passing values into the SQLiteDatabase API easy. It does 
not mandate the use of SQLite, or even SQL. It does not prohibit you 
from doing your own data validation, including sanitizing your inputs.

 This strikes me as particularly dangerous, as these snippets can
 easily come from malicious, third party apps.  http://xkcd.com/327/
 comes to mind, but this seems worse, as we're dealing with actual SQL,
 rather than just string parameters that can be encoded.

If Android itself is not examining the parameters, that merely means 
programming for Android is not significantly different than programming 
for just about any other platform developed by mankind. If you don't 
want Little Bobby Tables problems, sanitize your inputs.

If you feel that SQL is the language of Satan, use an object database -- 
I seem to recall db4o or somebody was porting theirs to Android. Most 
likely, you can still provide a ContentProvider interface atop it.

If you wish to write a database defense layer that encapsulates the act 
of sanitizing inputs, make it open source, and encourage people to use 
it, you'll be applauded.

There's any number of ways the community can solve this fundamental 
design flaw. How about we let Google/OHA focus on the things that are 
harder, like, say, video recording?

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

--~--~-~--~~~---~--~~
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: ContentProviders and Security of SQL Snippets

2008-10-18 Thread Jeff Hamilton

The APIs that accept selection strings, i.e. a WHERE clause, also
accept and array of strings that you can use for arguments to that
selection. If you're using SQLite you can use a ? for constant values
and pass the WHERE string directly to SQLite. You then pass in the
arguments array, and they are filled in for the ?s post SQL
parsing/compilation and treated as raw data. No need to worry about
escaping, or even quoting at all. For example, if you wanted to look
up student by a name that is coming from an untrusted sourcee you
could do this:

Cursor c = getContentResolver().query(Students.CONTENT_URI,
PROJECTION, Students.NAME +  = ?, new String[] { untrustedName },
null);

As long as the provider supports this feature you don't have to worry
about untrustedName or even escape it.

You can also do something like design your provider to not accept
WHERE clauses at all, and instead use REST style URIs. For example:

Uri uri = Uri.withAppendedPath(Students.CONTENT_SEARCH_URI, untrustedName);
Cursor c = getContentResolver().query(uri, PROJECTION, null, null, null);

and then ensure in the provider that the leaf path node is properly
escaped when used to query whatever data source is backing the
provider.

-Jeff

On Sat, Oct 18, 2008 at 6:53 PM, Mark Murphy [EMAIL PROTECTED] wrote:

 Anm wrote:
 If I understand the ContentProvider API correctly, much of the API
 comes from passing SQL snippets for projects, selection, sort, etc.

 The API makes passing values into the SQLiteDatabase API easy. It does
 not mandate the use of SQLite, or even SQL. It does not prohibit you
 from doing your own data validation, including sanitizing your inputs.

 This strikes me as particularly dangerous, as these snippets can
 easily come from malicious, third party apps.  http://xkcd.com/327/
 comes to mind, but this seems worse, as we're dealing with actual SQL,
 rather than just string parameters that can be encoded.

 If Android itself is not examining the parameters, that merely means
 programming for Android is not significantly different than programming
 for just about any other platform developed by mankind. If you don't
 want Little Bobby Tables problems, sanitize your inputs.

 If you feel that SQL is the language of Satan, use an object database --
 I seem to recall db4o or somebody was porting theirs to Android. Most
 likely, you can still provide a ContentProvider interface atop it.

 If you wish to write a database defense layer that encapsulates the act
 of sanitizing inputs, make it open source, and encourage people to use
 it, you'll be applauded.

 There's any number of ways the community can solve this fundamental
 design flaw. How about we let Google/OHA focus on the things that are
 harder, like, say, video recording?

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

 


--~--~-~--~~~---~--~~
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: WiFi Ad-hoc networks in android?

2008-10-18 Thread Jason Parekh
Sorry, 1.0 doesn't support ad-hoc networks.

jason


On Sat, Oct 18, 2008 at 5:21 PM, corjuela [EMAIL PROTECTED] wrote:


 I'm interested in developing an application which involve a wifi ad-
 hoc network created by the app. itself. Can anyone tell me if it is
 possible? and more important . how?  ;-) . 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] Port SDL/TinySDGL to android with native C

2008-10-18 Thread Martin Foo

I have success port SDL/TinySDGL to android with native C!

Make SDL with Makefile.minimal makefile, and config SDL_config.h to
set video use FBCON, and timer user unix implement, and change some
code when user FBCON video.

After compile SDL success, then compile TinySDGL, don't change any
code, so crazy!

But compile TinySDGL demo need change screen size variables, then can
success compile gears example, screensnap pls see the photo:

http://static1.photo.sina.com.cn/bmiddle/4a0a39c3g5994bb8a3f70

Steps as follows:

1.Download arm linux cross platform compile toolchains from URL:

http://www.codesourcery.com/gnu_toolchains/arm/download.html

Windows:
http://www.codesourcery.com/gnu_toolchains/arm/portal/package3400/public/arm-none-linux-gnueabi/arm-2008q3-41-arm-none-linux-gnueabi.exe

Linux:
http://www.codesourcery.com/gnu_toolchains/arm/portal/package3399/public/arm-none-linux-gnueabi/arm-2008q3-41-arm-none-linux-gnueabi.bin

after install the gnu arm linux toolchains, set the dir bin to your
path;

2.If you use windows, pls install cygwin(http://www.cygwin.com), if
you use linux, ignore this step;

3.Download SDL 1.2.13 source from http://www.libsdl.org, and un-zip it
to a dir;

4.Change the Makefile.minimal as follows:

# Makefile to build the SDL library

INCLUDE = -I./include
CFLAGS  = -g -O2 $(INCLUDE) -static
CC  = arm-none-linux-gnueabi-gcc
AR  = arm-none-linux-gnueabi-ar
RANLIB = arm-none-linux-gnueabi-ranlib

CONFIG_H = include/SDL_config.h
TARGET  = libSDL.a
SOURCES = \
 src

#include stdarg.h

typedef signed char int8_t;
typedef unsigned char uint8_t;
typedef signed short int16_t;
typedef unsigned short uint16_t;
typedef signed int int32_t;
typedef unsigned int uint32_t;
typedef unsigned int size_t;
typedef unsigned long uintptr_t;


#define SDL_AUDIO_DRIVER_OSS 1 // SDL_AUDIO_DRIVER_DUMMY


#define SDL_CDROM_DISABLED 1


#define SDL_JOYSTICK_DISABLED 1


#define SDL_LOADSO_DISABLED 1


#define SDL_THREADS_DISABLED 1

  //SDL_TIMERS_DISABLED
#define SDL_TIMER_UNIX 1

// SDL_VIDEO_DRIVER_DUMMY
#define SDL_VIDEO_DRIVER_FBCON 1


#define HAVE_STDIO_H 1

#endif

We enable audio driver oss, and video frame buffer, and unix timer,
and enable stdio to read/write file;

3.Change $SDL/src/video/fbcon/SDL_fbvideo.c, line 191  499, use /dev/
graphics/fb0 instead of /dev/fb0, becuase Android linux use /dev/
graphics/fb0 video device;

4.Now enter SDL dir, you can type make to compile SDL for Android!
if success, you can get libSDL.a in SDL dir;

5.Download TinySDL from http://www.kyb.tuebingen.mpg.de/bu/people/gf/software/,
TinySDGL: http://www.kyb.tuebingen.mpg.de/bu/people/gf/software/TinySDGL.zip,
and un-zip TinySDGL to the same dir as you un-zip SDL;

6.For compile TinySDGL, you just need change Makefile, don't need
change any source code, the makeinclude as follows:

#
# C compiler

# linux / Windows MinGW
CC= arm-none-linux-gnueabi-gcc
AR  = arm-none-linux-gnueabi-ar
RANLIB = arm-none-linux-gnueabi-ranlib
CFLAGS = -g -Wall -O2 -w -static
LFLAGS = -s -static

#
# SDL configuration (for the examples only)

UI_LIBS  = -L../../SDL-1.2.13 -lSDL
UI_INCLUDES = -I../../SDL-1.2.13/include


#
# OpenGL configuration (for the examples only)

# use TinySDGL
GL_LIBS= -L../lib -lTinySDGL
GL_INCLUDES= -I../include
GL_DEPS= ../lib/libTinySDGL.a

# use Mesa
#GL_LIBS= -lMesaGL
#GL_INCLUDES=
#GL_DEPS=

# use OpenGL
#GL_LIBS= -lGL
#GL_INCLUDES=
#GL_DEPS=


# Compile and link control

DIRS= src examples



After change this, you can enter TinySDGL dir, and type make to
compile it, after compile success, enter examples dir, you can find
the gears,triangle demos, now you can push them to android emulator,
and run it, first start your android emulator, and type commonds as
follwos:

adb shell mkdir /dev/sample

adb push gears /dev/sample

adb shell chmod 777 /dev/sample/gears

adb shell

#cd /dev/sample

#./gears

OK, you will see the demo run on android emulator!

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---