[android-beginners] Re: Having a lot of problems finding the documentation (e.g. about sendevent)
Hi rk, 1. From where you got this logs(I mean the logs you got like the oo3 0001 0001d) you can get those events by doing a adb -s emulator-5554 shell getevent in the command prompt 2. I used the following code in batch file, but it's not giving any o/ p adb shell sendevent /dev/input/event0 0003 0005 adb shell sendevent /dev/input/event0 0003 0001 001d adb shell sendevent /dev/input/event0 0003 014a 0001 adb shell sendevent /dev/input/event0 0003 sorry i wasn't clear on the sendevent command sendevent expects integer values not hex value you have entered your first two commands should look like this adb shell sendevent /dev/input/event0 3 0 5 adb shell sendevent /dev/input/event0 3 1 29 as for the last two commands you did something wrong with it as you touch the screen on the device it has to know the location and what happen there as android wants to know what did you do on that location your 0003 014a 0001 was incorrect after the location u sent you need to indicate what's happening 0001 014a 0001 the above would indicate a touch at the location however to do something useful you will want to untouch which indicate a tap gesture on the screen the untouch part looks like this: 0001 014a so to tap at 5 pixel from the left and 29 pixel from top top of the screen you would use this adb shell sendevent /dev/input/event0 3 0 5 adb shell sendevent /dev/input/event0 3 1 29 adb shell sendevent /dev/input/event0 1 330 1 adb shell sendevent /dev/input/event0 0 0 0 adb shell sendevent /dev/input/event0 1 330 0 adb shell sendevent /dev/input/event0 0 0 0 remeber sendevent expects integer values if it happens that a program icon in at that location the above code will indicate a tap on the program which android will launch it here is my commands for lauching a Messaging program on the emulator. the messaging program is located at x=39, y=262 on my emulator. after executing the code the Messaging program launched! adb shell sendevent /dev/input/event0 3 0 39 adb shell sendevent /dev/input/event0 3 1 262 adb shell sendevent /dev/input/event0 1 330 1 adb shell sendevent /dev/input/event0 0 0 0 adb shell sendevent /dev/input/event0 1 330 0 adb shell sendevent /dev/input/event0 0 0 0 if you want to know more about what's happening on the screen or when you press something get used to looking at getevent command dragging ( flick on the screen ) on the screen is a little more difficult, but not too different from the above commands for example flicking/dragging left or right on the android desktop/home screen will slide the desktop to the direction you flicked/dragged hope this time i explained more clearly. sorry for being long winded On Wed, May 13, 2009 at 10:21 PM, rk raj.10...@gmail.com wrote: Hi Kent, I tried this one with the sendevent but it's not working. I can't see any action in the emulator. I have few clarification on the about solution. 1. From where you got this logs(I mean the logs you got like the oo3 0001 0001d) 2. I used the following code in batch file, but it's not giving any o/ p adb shell sendevent /dev/input/event0 0003 0005 adb shell sendevent /dev/input/event0 0003 0001 001d adb shell sendevent /dev/input/event0 0003 014a 0001 adb shell sendevent /dev/input/event0 0003 thanks raj On May 11, 1:51 pm, Kent Yip yes...@gmail.com wrote: ok, i have taken another look at keyevent on the action performed on the screen... read more » i pressed on one spot on the screen ( pressed then let go ) -x | | | | | | v y what was generated were: /dev/input/event0: 0003 0005 /dev/input/event0: 0003 0001 001d /dev/input/event0: 0001 014a 0001 /dev/input/event0: /dev/input/event0: 0001 014a /dev/input/event0: i am not 100% sure, here is what i think 0003 0005 is the screen location in the x-position the type 0003 is the screen type is the x-coordinate code 0005 is the pixel (maybe) value ----- 0003 0001 001d is the y-coordinate on the screen 0003 is the screen type 0001 is the y-coordinate code 001d is the pixel value ------ so /dev/input/event0: 0003 0005 /dev/input/event0: 0003 0001 001d will be at screen location in pixel x=5, y=21 that just the screen location i have touched, it doesn't have the touch/untouch that would indicate a press on the screen ------ /dev/input/event0: 0001 014a 0001 /dev/input/event0: this would
[android-beginners] about .dex files
Hi guys, I'm new to Android and i don't understand very well how dex files work. When I create an application, I do in in java (isn't it?). Then, with the eclipse adt, this file is converted in a dex file and the DVM can receive it. Can someone please explain a little further this process? I don't get WHEN the .dex files are created and specially WHERE they are saved. (the emulator itself create the dex file? or is it created by eclipse and then sended to the emulator?) thank you very much Jim --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Store prepopulated sqlite database in an app
The problem with just using a db created on your desktop (as opposed to pulling one off the emulator) is trusting the endianness of your pc is the same as the target device, and the db versions match. Safer to just adb pull from an emulator and store it. On May 14, 12:41 am, Mark Murphy mmur...@commonsware.com wrote: Basically, saving off a database from the emulator and blowing it up as a raw at runtime seems to work. Just create the database and store it on the emulator. Then use adb pull to pull the database from the emulator onto your desktop. Drop this .db in your project resources/ raw directory. Note that your technique should also work for SQLite databases created outside of the emulator. So long as you are running the same major release of SQLite, the file format will be the same. Hence, if you want to use some desktop tools to create the SQLite file you are baking into your APK as a raw resource, that should be fine. Also, bear in mind that you are now taking up ~1.5 times the amount of on-board flash space -- you have your full-size uncompressed copy, plus the original compressed one. There is no way to get rid of the raw resource after you are done with it. For small databases, this is not an issue, but I would not pack a large database in this way (e.g., 15MB). Finally, others have reported errors when attempting to expand large files out of the APK. I think the limit was 1MB or 2MB. -- Mark Murphy (a Commons Guy)http://commonsware.com _The Busy Coder's Guide to Android Development_ Version 2.0 Available! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: about .dex files
I think that if you find a .apk file, rename it to be a .zip and open it, a lot of the mystery will go away. .apk files, are what you install on your phone. They are a zip file that contain the dex files (and the manifest and maybe a few other things.) They are created by Eclipse. On May 14, 5:44 am, ja...@work jamai5...@gmail.com wrote: Hi guys, I'm new to Android and i don't understand very well how dex files work. When I create an application, I do in in java (isn't it?). Then, with the eclipse adt, this file is converted in a dex file and the DVM can receive it. Can someone please explain a little further this process? I don't get WHEN the .dex files are created and specially WHERE they are saved. (the emulator itself create the dex file? or is it created by eclipse and then sended to the emulator?) thank you very much Jim --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Not sure how to use Cursors
On May 13, 12:57 pm, Mark Murphy mmur...@commonsware.com wrote: 1 - What if you are working on more complex setups than 1 table? I want 2 tables, which have a one-to-many relationship (a simple example is a Polygons table, and a Points table). How am I supposed to return a cursor that would allow access to the polygon's information, including the points? Good links welcome... Do a join in your SQL query. Ok, cool - thanks. I think I see what my error in thinking was. What happens with crashes? I have seen some adapters around, and they seem to make all data edits directly to/from the database. Is this safe? That depends on how well the code is written. It seems like it would be better to have objects that are manipulated, and written to the database when they are ready. That is not intrinsically safer than what you think is unsafe. If an app crashed unexpectedly after half of a row had been edited Is that like digging half a hole? then the database could have bad data. I would rather loose an entire row, than have a half-correct row. Individual SQL statements are atomic; multiple statements can be made atomic via transactions. -- Mark Murphy (a Commons Guy)http://commonsware.com _The Busy Coder's Guide to Android Development_ Version 2.0 Available! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Running as Android application in Eclipse
What I generally do is use Windows Preference Run/Debug Launching and select the Always launch the previously launched application at the bottom. Once you do that, running will reuse the same launch configuration till you select another one. You can use the grenn icons debug and run in the toolbar to quickly launch the same project. The little arrows next to it let you select the previously launched app easily. R/ On Sat, May 9, 2009 at 3:41 AM, anggo oceanb...@gmail.com wrote: Hi all, I'm new to Eclipse and Android development, so this question might sound dumb. :$ So when I run an application in Eclipse, I want to run it as Android Application, of course. When the package explorer is highlighted and I choose Run Run, the application runs as Android Application by default, which is good. But the thing is that when I was editing a java source file in which case the editing window had focus and I choose Run Run, a dialog box pops up and I have to choose between Android Application, Java Application, Java Applet an so on. This is uncomfortable, I want to run it as Android Application by default no matter which window had focus. Is there a way to do this? Or do you guys always put up with the discomfort? Thanks in advance! :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: startService works, but bindService fails?
Heyhey, i struggle with the same problem. If i am launching the ListActivity, which is responsible for one tab content and needs my personal service, the service would not be bind. Is the only way to solve that issue, moving the binding code to the TabActivity? What a mass! On Mar 27, 4:12 pm, Brian hibr...@gmail.com wrote: Actually what worked was to move the code to theTabActivityclass, instead of one of the tabs the tabHost brings forward. For some reason, binding to the service on the tab activity doesn't work, but binding it on theTabActivityclass does. On Mar 26, 11:26 am, e2865c e28...@gmail.com wrote: Are you implementing the onServiceConnected and onServiceDisconnected methods correctly? typically the Service connection is implemented as below: private MyService serviceBinder; private ServiceConnection mConnection = new ServiceConnection(){ public void onServiceConnected(ComponentName className, IBinder service ){ serviceBinder = ( (MyService.MyBinder) service).getService( ); } public void onServiceDisconnected(ComponentName className){ serviceBinder = null; } } Also try Intent bindIntent= newMe.this, MyService.class); bindService(bindIntent, mConnection, Context.BIND_AUTO_CREATE); instead of bindService(new Intent(Me.this, MyService.class), mConn, Context.BIND_AUTO_CREATE); --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Dictionary program with autocomplete EditText
Hello, I want to make simple dictionary program with two languages English and Lithuanian. The idea is to choose from to what language translating using radio buttons and enter a word in EditText view and eventually after user press Translate button it shows results or says there is no such word to translate. I want to make EditText to be autocomplete but words it should take from my custom xml lets say words.xml And structure might be like this: ?xml version=1.0 encoding=utf-8? resources word name=1 English name=A1Sunset/English Lithuanian name=L1Saulėlydis/Lithuanian /word /resources To make it more clear I need that when user choose a word in list or type it program should know to what word user is referring and than show its translation in label. So now I am trying to figure out how to create autocomplete list from my custom xml with structure above? (If it is possible). Open to any suggestion... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Compiling C/C++ Code and Call It from Java
Hi, Can I compile my C/C++ code as an engine and then call it from Java as the GUI? I heard of using ARM EABI, any explanation about it? Thanks, Eka --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Source not found.
Hi dev! I'm a pretty new android dev.I want to create a contact using existing android database.This is the code package com.android.contact; import android.app.Activity; import android.content.ContentValues; import android.net.Uri; import android.os.Bundle; import android.provider.Contacts; import android.view.View; import android.widget.Button; import android.widget.EditText; public class Contact extends Activity { private EditText name ; private EditText number ; private Button save ; /** Called when the activity is first created. */ @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.main); // ToDo add your GUI initialization code here name = (EditText) findViewById(R.id.name); number = (EditText) findViewById(R.id.number); save = (Button) findViewById(R.id.btnSave); //when save is clicked /* */save.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { String nameId = name.getText().toString(); String phoneNumber = number.getText().toString(); // create a new name ContentValues values = new ContentValues(); //put value in database(key and value) values.put(Contacts.People.NAME, nameId); values.put(Contacts.Phones.NUMBER,phoneNumber); // add it to the database //getContentResolver().insert (Contacts.People.CONTENT_URI, values); } }); } } But I have Source not found ERROR MESSAGE! How could I do to solve this problem? Thank you for all! Aglagla --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Caller ID
Hello, so I am new to Android...I did some of the tutorial and sample apps, but I want to start making my own apps now. Here is what I want to do, no sure if you have had a nokia phone but they have this cool (in my opinion) ring tone that calls out the name of the person calling. I am trying to write an app, or a ring tone, that does this, but I really do not know where to start... Some first advise is desperately needed, i need to be pointed in the right direction thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: I'm not able to receive more than two GPS position. The application hangs.
Hi, I'm having a similar problem to yours and as far as I know sdk 1.5 has introduced some changes concerning location. On the manifest the uses- permission, as far as I know, ACCESS_GPS and ACCESS_LOCATION has been substituted for ACCES_FINE_LOCATION. ACCESS_COARSE_LOCATION is only needed in case you want to access location info about the cell of your mobile antenna or wifi server, which I'm afraid is not the case. The only other permission you should activate is ACCESS_MOCK_LOCATION and about the others I'm not sure you'll need them. Anyway the problem is not here, I've been looking to the API and I've seen a method defined for LocationManager called setTestProviderLocation(String provider, Location loc) which sets a mock location for the given provider. Maybe it could be something related with this method but I can't say, I'm having big problems with this issue too. I've found a lot of information and examples about mock location providers for the older versions but nothing yet for the 1.5 and I really miss some good information for starting with gps activities on this new release. Thanx all, Pablo On 7 mayo, 22:52, Patricio Echague patric...@gmail.com wrote: Hi all, my application read info from theGPSprovider and shows it on the screen. The problem is that the locationListener is executed only twice for some reason. I tried to create another thread to print some other information at the same time to verify that the application is still running, and it was so. However, the listener that listens to the location change is not invoked any more. To generate theGPSinfo i'm using DDMS manually and a .GPX file. Did any of you run into this issue? (I didn't find anything similar in the discussion group) thanks Patricio -- package com.apps.GpsApp; import java.io.IOException; import android.app.Activity; import android.content.Context; import android.location.Location; import android.location.LocationListener; import android.location.LocationManager; import android.location.LocationProvider; import android.os.Bundle; import android.util.Log; import android.widget.TextView; import android.widget.Toast; public class GpsApp extends Activity { private TextView textView; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Set the layout for this activity. You can find it in res/ layout/location_view.xml setContentView(R.layout.location_view); // The text view for our text view, identified by its ID in the XML file. textView = (TextView) findViewById(R.id.text); textView.setText(Ready to receive my location...); final LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); locationManager.requestLocationUpdates (LocationManager.GPS_PROVIDER, 0, 0, new MyLocationListener ()); } private class MyLocationListener implements LocationListener { public void onLocationChanged(Location location) { String lat = String.valueOf(location.getLatitude()); String lon = String.valueOf(location.getLongitude()); Log.e(GPS, location changed: lat=+lat+, lon=+lon); textView.append(\nLast location: + lat + + lon); Toast.makeText(getBaseContext(), Location changed : Lat: + lat + Lng: + lon, Toast.LENGTH_LONG).show(); } public void onProviderDisabled(String provider) { } public void onProviderEnabled(String provider) { } public void onStatusChanged(String provider, int status, Bundle extras) { } } } and the xml is: ?xml version=1.0 encoding=utf-8? manifest xmlns:android=http://schemas.android.com/apk/res/android; package=com.apps.GpsApp android:versionCode=1 android:versionName=1.0 uses-permission android:name=android.permission.ACCESS_LOCATION/ uses-permission android:name=android.permission.ACCESS_GPS/ uses-permission android:name=android.permission.ACCESS_COARSE_LOCATION/ uses-permission android:name=android.permission.ACCESS_FINE_LOCATION/ uses-permission android:name=android.permission.ACCESS_LOCATION_EXTRA_COMMANDS/ uses-permission android:name=android.permission.ACCESS_MOCK_LOCATION/ uses-permission android:name=android.permission.CONTROL_LOCATION_UPDATES/ uses-permission android:name=android.permission.INTERNET/ application android:icon=@drawable/icon android:label=@string/ app_name activity android:name=.GpsApp android:label=@string/app_name intent-filter action
[android-beginners] GridView Usage
Dear Android Experts, I am new to Android, and have some questions on the GridView. I am thinking to display photo thumbnails using GridView and the photo thumbnails are categorized in groups . However: 1) I want to start in a new line for each group. How can I do it Gridview? 2) Is it possible to highlight can group of photos in the Grid? 3) I followed the Grid1.java in the AppDemo. However, is it possible to teach me how to add picture to the GridView dynamically? ie. If I press a button then add another photo to the grid. Thanks and Best Regards, James --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Custom library for android
When creating an Andriod package your manifest *must* contain an application tag. http://developer.android.com/guide/topics/manifest/manifest-element.html On May 12, 9:50 pm, Paul Turchenko paul.turche...@gmail.com wrote: Not really :(. Let me explain couple steps I made do discover how is it possible: 1. Create a regular java library (third party user will reference it from his android application and use classes declared in it). This solves the problem until I want to have embedded resources and access them via the R file (normally generated by an android SDK). The second thing I'm unable to do is create xml attributes for custom views contained in that library. This way user can't comfortably have these views in his layout files (like he does with an android.jar referenced). 2. Create an android library (which will have an AndriodManifest.xml file (with no application tag declared though) and eclipse plugin will recognize it as android library correctly along with taking care of R file generation). This way works until I try to instantiate any of the views declared in my library. Execution fails with exception. I've tried to google that one but didn't find anything useful. I am pretty sure there is a way to create custom library for android that would do the trick. Please share your thought on this. It would be much of help. On May 12, 3:20 pm, eisernWolf eisernw...@gmail.com wrote: It needs to have the same access to my internal resources as it is done in android.jar library. © So you already know the answer, what's the problem? On May 11, 10:49 pm, paul.turchenko paul.turche...@gmail.com wrote: Anyone? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] android emulator window hangs when closing window
Hi, After installing android SDK 1.5 r1 and the ADT plugin for Eclipse Ganymede 3.4.2 on Ubuntu 32 bit 9.04 (Jaunty), I find that after running any android application (with no problems), that I am unable to terminate the emulator instance by closing the window. It just hangs and I have to call kill -9 to terminate the process. This happens irrespective of whatever AVD target I choose (1.1 or 1.5). The same happens even if I run the emulator from a terminal (by passing eclipse altogether) by calling 'emulator -avd myavd -netspeed full -netdelay none' . Adding the -verbose and -logcat and -show- kernel flags does not help resolve the issue. I have looked widely for a solution on the Web but this problem does not appear much. Any ideas on how to resolve this or is there another way to terminate the emulator instance? Thanks, Jim --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Error when setting the android preferences in eclipse.
The structure of the SDK has changed to be able to handle multiple platforms. You must use the Android SDK 1.5 with ADT 0.9x. Note that this SDK includes an android 1.1 image which is *exactly* the same as the one you had in the SDK 1.1_r1. R/ On Tue, May 12, 2009 at 12:52 AM, andersg anders.gjett...@gmail.com wrote: Hi, I can't get the android sdk working in eclipse. I followed the installation guide, but when I point android preferences to my android sdk lib under Window preferences android I get the following error. Error loading the SDK Error: Error parsing the SDK. /home/anders/opt/android-sdk-linux_x86-1.1_r1/plartforms is missing --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Installing the android SDK on my new PC
On Tue, May 12, 2009 at 2:38 PM, Johan Degraeve johan.degra...@gmail.com wrote: I'm having the same problem on a Mac : when trying to create a new android project there's an error message on top 'An SDK Target must be specified'. The project wizard should have a list with 3 SDK targets to choose from: android 1.1, 1.5 and google apis. Click one of the checkboxes. R/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: help compiling Android sourcecode apps
The apps that come in the Android source code are not built using the SDK. They are built using the Android platform (e.g. the make files) and may or may not be using internal APIs which are not part of the SDK. Questions on building the platform should go to http://groups.google.com/group/android-platform. HTH R/ On Thu, May 14, 2009 at 1:37 AM, darren minof...@gmail.com wrote: Hi everyone I have a project where I need to modify one of the native apps on android, the MMS client. I have a working setup going, using 1.5 SDK. Next, I've checked out the MMS app from the Android sourcecode repository git. Loading the MMS source code base into eclipse as an Android project results in many compilation errors and I'm having trouble moving on from here. It appears that a lot of the import statements in the MMS Classes are referencing files that don't exist. for example there is no android.provider.Calendar class in the SDK, but the MMS sourcecode seems to think there is. I was under the impression that Android native apps were no different than any other developer apps, so shouldn't their sourcecode compile like any other? I thought it may also be an SDK version thing, but it doesn't seem to compile under v1.1 or 1.5 of the SDK. Any help would be much appreciated. thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: XML : eclipse, layout problem
Ah yeah, it's a known issue: the TabHost (or more exactly TabWidget) generates an internal NullPointerException when used in the layout editor. It should render fine on the emulator or a device though. Hopefully this should be fixed in the next version of android, whenever that is. R/ On Thu, May 14, 2009 at 2:38 AM, Michaël Gerber mic.ger...@gmail.com wrote: Hi, I have done a XML file but I can't see it in the the Eclipse Layout, there is an error : NullPointerException: null... Here is the XML file : ?xml version=1.0 encoding=utf-8? TabHost xmlns:android=http://schemas.android.com/apk/res/android; android:id=@android:id/tabhost android:layout_width=fill_parent android:layout_height=fill_parent LinearLayout android:id=@+id/layoutTop android:orientation=vertical android:layout_width=fill_parent android:layout_height=wrap_content TabWidget android:id=@android:id/tabs android:layout_width=fill_parent android:layout_height=wrap_content / FrameLayout android:id=@android:id/tabcontent android:layout_width=fill_parent android:layout_height=fill_parent TextView android:id=@+id/general android:layout_width=fill_parent android:layout_height=fill_parent android:text=general option : work in progress / LinearLayout android:id=@+id/xtraZone android:orientation=vertical android:layout_width=fill_parent android:layout_height=fill_parent TextView android:layout_width=fill_parent android:layout_height=wrap_content android:text=Phone number :/ EditText android:id=@+id/txtUsername android:layout_width=fill_parent android:layout_height=wrap_content android:gravity=top android:phoneNumber=true/ TextView android:layout_width=fill_parent android:layout_height=wrap_content android:text=Password :/ EditText android:id=@+id/txtPassword android:layout_width=fill_parent android:layout_height=wrap_content android:gravity=top android:password=true/ /LinearLayout LinearLayout android:id=@+id/about android:orientation=vertical android:layout_width=fill_parent android:layout_height=fill_parent TextView android:id=@+id/appName android:layout_width=fill_parent android:layout_height=wrap_content android:text=MonkeySMS/ TextView android:id=@+id/year android:layout_width=fill_parent android:layout_height=wrap_content android:text=2009/ TextView android:id=@+id/visit android:layout_width=fill_parent android:layout_height=wrap_content android:text=Visit :/ TextView android:id=@+id/link android:layout_width=fill_parent android:layout_height=wrap_content android:text=http://subversion.assembla.com/svn/MonkeySMS; android:autoLink=web/ /LinearLayout /FrameLayout /LinearLayout LinearLayout android:layout_width=fill_parent android:layout_height=wrap_content android:layout_gravity=bottom android:orientation=horizontal Button android:id=@+id/save android:layout_width=wrap_content android:layout_height=wrap_content android:text=Save/ Button android:id=@+id/close android:layout_width=wrap_content android:layout_height=wrap_content android:text=Close/ /LinearLayout /TabHost I don't know if the error comes from the XML code or from eclipse, because I can see the other XML in the Layout... Thank you for your help Michaël --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] Re: about .dex files
On Thu, May 14, 2009 at 2:44 AM, ja...@work jamai5...@gmail.com wrote: Hi guys, I'm new to Android and i don't understand very well how dex files work. When I create an application, I do in in java (isn't it?). Then, with the eclipse adt, this file is converted in a dex file and the DVM can receive it. In a nutshell: - Eclipse compiles your .java into .class - dx converts the various .class into bin/classes.dex. - aapt compiles your resources in a compact binary form. - the manifest, the compiled resources and the classes.dex get combined in your apk file, which is just a zile file. Unzip the apk to have a look at it. You can find many tutorials out there and youtube videos on android that explain that. R/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Android plugins not appearing in Eclipse (XP)
Which version of Eclipse are you using? You need Eclipse RCP or Eclise for Java developers. The Classic version doesn't work. R/ On Thu, May 14, 2009 at 3:29 AM, khendar khen...@gmail.com wrote: I have followed the instructions on this page (http:// developer.android.com/sdk/1.5_r1/installing.html) and it all goes smoothly with no errors. But when I restart Eclipse and go to Preferences, there is no Android tab and there's no Android Project open in the new projects menu. I am running Version 3.4.2 of Eclipse and android-sdk-windows-1.5_r1 on XP SP3. The ADT and DMMS jar files appear in the Eclipse/plugins directory, but the program doesn't appear to be registering them. I've tried downloading ADT plugin and installing manually but that didn't work either. Any thoughts ? Cheers --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Android plugins not appearing in Eclipse (XP)
If you go to Help - Software Updates - Manage Configuration, is the Android plugin present in the left tree? Does it have an exclamation mark icon against it? On Thu, May 14, 2009 at 11:29 AM, khendar khen...@gmail.com wrote: I have followed the instructions on this page (http:// developer.android.com/sdk/1.5_r1/installing.html) and it all goes smoothly with no errors. But when I restart Eclipse and go to Preferences, there is no Android tab and there's no Android Project open in the new projects menu. I am running Version 3.4.2 of Eclipse and android-sdk-windows-1.5_r1 on XP SP3. The ADT and DMMS jar files appear in the Eclipse/plugins directory, but the program doesn't appear to be registering them. I've tried downloading ADT plugin and installing manually but that didn't work either. Any thoughts ? Cheers --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: help compiling Android sourcecode apps
ok great! thanks for the help Raphael On May 14, 9:06 am, Raphael r...@android.com wrote: The apps that come in the Android source code are not built using the SDK. They are built using the Android platform (e.g. the make files) and may or may not be using internal APIs which are not part of the SDK. Questions on building the platform should go tohttp://groups.google.com/group/android-platform. HTH R/ On Thu, May 14, 2009 at 1:37 AM, darren minof...@gmail.com wrote: Hi everyone I have a project where I need to modify one of the native apps on android, the MMS client. I have a working setup going, using 1.5 SDK. Next, I've checked out the MMS app from the Android sourcecode repository git. Loading the MMS source code base into eclipse as an Android project results in many compilation errors and I'm having trouble moving on from here. It appears that a lot of the import statements in the MMS Classes are referencing files that don't exist. for example there is no android.provider.Calendar class in the SDK, but the MMS sourcecode seems to think there is. I was under the impression that Android native apps were no different than any other developer apps, so shouldn't their sourcecode compile like any other? I thought it may also be an SDK version thing, but it doesn't seem to compile under v1.1 or 1.5 of the SDK. Any help would be much appreciated. thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Source not found.
When does this message appear? When you try to compile your code? Are you using Eclipse, or something else? Try the Hello World first, to make sure your environment is set up correctly. http://developer.android.com/guide/tutorials/hello-world.html On Thu, May 14, 2009 at 4:30 AM, aglagla lad...@gmail.com wrote: Hi dev! I'm a pretty new android dev.I want to create a contact using existing android database.This is the code package com.android.contact; import android.app.Activity; import android.content.ContentValues; import android.net.Uri; import android.os.Bundle; import android.provider.Contacts; import android.view.View; import android.widget.Button; import android.widget.EditText; public class Contact extends Activity { private EditText name ; private EditText number ; private Button save ; /** Called when the activity is first created. */ �...@override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.main); // ToDo add your GUI initialization code here name = (EditText) findViewById(R.id.name); number = (EditText) findViewById(R.id.number); save = (Button) findViewById(R.id.btnSave); //when save is clicked /* */save.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { String nameId = name.getText().toString(); String phoneNumber = number.getText().toString(); // create a new name ContentValues values = new ContentValues(); //put value in database(key and value) values.put(Contacts.People.NAME, nameId); values.put(Contacts.Phones.NUMBER,phoneNumber); // add it to the database //getContentResolver().insert (Contacts.People.CONTENT_URI, values); } }); } } But I have Source not found ERROR MESSAGE! How could I do to solve this problem? Thank you for all! Aglagla --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Compiling C/C++ Code and Call It from Java
I'm not an expert, but you are probably looking for the NDK. Also, see this: http://honeypod.blogspot.com/2007/12/dynamically-linked-hello-world-for.html On Thu, May 14, 2009 at 1:23 PM, eka eka.a.kurnia...@gmail.com wrote: Hi, Can I compile my C/C++ code as an engine and then call it from Java as the GUI? I heard of using ARM EABI, any explanation about it? Thanks, Eka --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Having a lot of problems finding the documentation (e.g. about sendevent)
think of 330 as a finger is touching on the screen. adb shell sendevent /dev/input/event0 1 330 0 adb shell sendevent /dev/input/event0 0 0 0 the commands goes in pairs a tap on the screen will have 4 event actions 1 330 1, follow by 0 0 0 always they go in pair then 1 330 0, follow by 0 0 0 always 1 330 1 0 0 0 1 330 0 0 0 0 here is one way to think of the touch and untouch part, think button, there's a press down part and there is a up part, which goes together to indicate a press on the button. 1 330 1 0 0 0 the 1 at the end would indicate a touch ( think button; press down ) and 1 330 0 0 0 0 the 0 at the end would indicate a untouch ( think button; letting go of the button ) On Thu, May 14, 2009 at 1:28 AM, rk raj.10...@gmail.com wrote: Hi Kent, It's really great tutorial. It's working fine. But in the following code what the 330 means. and also that we are here giving the dvice adb shell sendevent /dev/input/event0 3 0 39 adb shell sendevent /dev/input/event0 3 1 262 adb shell sendevent /dev/input/event0 1 330 1 what the 330 means in the above code(will it do touch on the current location[39,262]...!!!) and also what the below code will do with all 0 values (will it do the untouch..!!!)? adb shell sendevent /dev/input/event0 0 0 0 adb shell sendevent /dev/input/event0 1 330 0 adb shell sendevent /dev/input/event0 0 0 0 thanks raj --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Android plugins not appearing in Eclipse (XP)
Thanks Raphael. I was running Classic. I installed the Java version and that fixed it. Maybe that needs to be made clearer in the documentation ? :) Out of curiosity, is it possible at all to get it to work in Classic ? Are there perhaps additional packages that can be installed to allow the Android stuff to work properly ? Cheers. On May 15, 1:30 am, Raphael r...@android.com wrote: Which version of Eclipse are you using? You need Eclipse RCP or Eclise for Java developers. The Classic version doesn't work. R/ On Thu, May 14, 2009 at 3:29 AM, khendar khen...@gmail.com wrote: I have followed the instructions on this page (http:// developer.android.com/sdk/1.5_r1/installing.html) and it all goes smoothly with no errors. But when I restart Eclipse and go to Preferences, there is no Android tab and there's no Android Project open in the new projects menu. I am running Version 3.4.2 of Eclipse and android-sdk-windows-1.5_r1 on XP SP3. The ADT and DMMS jar files appear in the Eclipse/plugins directory, but the program doesn't appear to be registering them. I've tried downloading ADT plugin and installing manually but that didn't work either. Any thoughts ? Cheers --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Errors in VideoPlayer
Hi guys, I have implemented the VideoPlayer example from the following link: http://davanum.wordpress.com/2007/12/29/android-videomusic-player-sample-from-local-disk-as-well-as-remote-urls/ I have two errors with the code:- 1. the return type is incompatible with MediaPlayer.OnErrorListener (MediaPlayer,int,int) public void onError(MediaPlayer mediaPlayer, int what, int extra) { Log.e(TAG, onError--- what: + what + extra: + extra); if (mediaPlayer != null) { mediaPlayer.stop(); mediaPlayer.release(); } } 2. the return type is incompatible with SurfaceHolder.Callback.surfaceCreated(SurfaceHolder) public boolean surfaceCreated(SurfaceHolder surfaceholder) { Log.d(TAG, surfaceCreated called); return true; } The return type is underlined with red. Any idea how to resolve the errors to get the VideoPlayer playing. Regards, Android-Beginner --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] import an existing project
Hello, This would be silly question... When I trying to import an existing project into Eclipse, the package structure is totally mess up. For eg. the package structure looks like this: com.company.project and the folders are: src/com/company/project The src in Eclipse would be these: com, com.company, com.company.project. In another way, the Eclipse treat com, com.company as sepearte packages instead of folders. Any ideas? Thanks, --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: import an existing project
This kind of problem exist if u import project from a svn, won't break your build On May 14, 2009 7:40 PM, Xian Chen hoganx...@gmail.com wrote: Hello, This would be silly question... When I trying to import an existing project into Eclipse, the package structure is totally mess up. For eg. the package structure looks like this: com.company.project and the folders are: src/com/company/project The src in Eclipse would be these: com, com.company, com.company.project. In another way, the Eclipse treat com, com.company as sepearte packages instead of folders. Any ideas? Thanks, --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Text in a image button and updating that text at run time.
I have a question. Is it possible to have an image button, with text also in the button, and have part of that text change. Here is the situation. I want the button to be pretty wide. To the far left of the button, I want an image. Next to the image I want a label such as Button 1 Then to the far right of the button a counter of how many times the button has been clicked. If so can someone supply the XML code snippet that will get it done. Thanks, Kevin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---