[android-beginners] Re: Hello every body, I'm new here.
Thank you very much, I can catch the error now. I've use catch (Exception) not catch(Error) before so I can't catch it. There is another problem, can I push the limit of memory higher? It is a little too small with only 16 MB. If can, what should I do? On 8月4日, 上午2时15分, Yusuf T. Mobile yusuf.s...@t-mobile.com wrote: Hello, to see the exception, look at logcat. You can do that from either the command line, or from the DDMS tab in Eclipse. Yusuf Saib Android ·T· · ·Mobile· stick together The views, opinions and statements in this email are those of the author solely in their individual capacity, and do not necessarily represent those of T-Mobile USA, Inc. On Aug 2, 7:55 pm,whitechwhit...@163.com wrote: Hi all! I'm new here. Now I've met a problem: when my program using too much memory, it die. Is there an exception or something else? And how to get it? Thank you very much! --~--~-~--~~~---~--~~ 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: Adding objects to a canvas
:) Thank you. I created an array of objects to fix the issue so have an array of circles the onDraw method is using. On Aug 3, 7:13 pm, Yusuf T. Mobile yusuf.s...@t-mobile.com wrote: The onDraw() function is the phone's way of asking you so how do you want me to draw this canvas, from scratch? If you say draw a circle there!, you get one circle. If you want it to draw two circles, your CustomDrawableView needs to tell it to draw two different circles every time onDraw() is called, for example with two different drawables. Yusuf Saib Android ·T· · ·Mobile· stick together The views, opinions and statements in this email are those of the author solely in their individual capacity, and do not necessarily represent those of T-Mobile USA, Inc. On Aug 3, 6:30 am, Graham gxt...@gmail.com wrote: Hi, I am new to the android developing world and have what I think is a very simple question. I have created a circle on a canvas and drawn it successfully. I now wish to add another circle to this already existing canvas in a different position. I have defined my x and y as arguments I pass to custom drawable view but when I try and get another circle drawn it just replaces the one that was already present. How do I keep the first circle and add on a second? (My code below does not show trying to add another circle, it is simply what works with creating a single colour circle). Thanks G package com.image; import android.app.Activity; import android.os.Bundle; public class image extends Activity { /** Called when the activity is first created. */ private CustomDrawableView mCustomDrawableView; //private CustomDrawableView mCustomDrawableView2; protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //last argument 1 = green, all others = red mCustomDrawableView = new CustomDrawableView(this, 150, 40, green); setContentView(mCustomDrawableView); } } package com.image; import android.content.Context; import android.graphics.Canvas; import android.graphics.drawable.ShapeDrawable; import android.graphics.drawable.shapes.OvalShape; import android.view.View; public class CustomDrawableView extends View { private ShapeDrawable mDrawable; public CustomDrawableView(Context context, int x, int y, String Colour) { super(context); //int x = 80; //int y = 90; int width = 50; int height = 50; mDrawable = new ShapeDrawable(new OvalShape()); if (Colour == green){ mDrawable.getPaint().setColor(0xff74AC23);//green } else if (Colour == red) { mDrawable.getPaint().setColor(0x);//red } mDrawable.setBounds(x, y, x + width, y + height); } protected void onDraw(Canvas canvas) { mDrawable.draw(canvas); } }- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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] AlertBuilder and Handler Problem
Hi, I have a problem, I want to create an Alert Builder in a thread started by tha main activity.This Builder should be a multiple choiche. The code is: public class C extends Activity { private PrintWriter savedpoint; private Context context = this; private TextView statusField; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Handler handler=new Handler(); F thread=new F(this,statusField,handler); thread.start(); } } class F extends Thread{ Context context; TextView statusField; Handler handler; String voto; F(Context context,TextView statusField,Handler handler) {this.context=context;this.statusField=statusField;this.handler=handler;} public void run() { final CharSequence[] items = {Ottimo, Buono, Sufficiente,Insufficiente}; String voto=; handler.post(new Runnable(){public void run(){ AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setTitle(Pick a color); builder.setSingleChoiceItems(items, -1, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int item) { Toast.makeText(context.getApplicationContext(), items [item], Toast.LENGTH_SHORT).show(); } }); AlertDialog alert = builder.create(); alert.show(); }}); statusField.setText(voto); } } Problem 1: what can I do for doing some actions when a user select one of the alert choiches? Problem 2: It seems that the code doesn't stop when the alert dialog appears but still run, as a matter of fact the statusField is empty when appears. If nothing is possible to do Is there any other way to obtain something like this working? 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] Customization of Dialogs
Hi, Can we create any dialog without having Title (like the lock screen when emulator boots up). Can anyone tell me the way to do it. Thanks in advance. Regards; Swapnil --~--~-~--~~~---~--~~ 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: Customization of Dialogs
simple do not call setTitle(); -- Best Regards, Atif Gulzar I Unicode, ɹɐzlnƃ ɟıʇɐ On Tue, Aug 4, 2009 at 5:26 PM, swapnil swapnil.da...@gmail.com wrote: Hi, Can we create any dialog without having Title (like the lock screen when emulator boots up). Can anyone tell me the way to do it. Thanks in advance. Regards; Swapnil --~--~-~--~~~---~--~~ 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: Customization of Dialogs
Thank you for your help, But if you don't call setTitle () it will keep that space blank. I want there should not be any space left. From top of Dialog View I want to show the Buttons. Can you please help me in that. Regards; Swapnil --~--~-~--~~~---~--~~ 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] onTouch()
Hi again, I am getting to grip with the android fundamentals and am curious as to how the onTouch and the onTouchlisteners work. To keep it simple I have used onDraw to draw two circles on a canvas, a green circle and a red circle (each of type ShapeDrawable - Oval Shape). I now wish to make it so that when I push the green circle, it will move to the right and if I push the red circle it will move down. I can move the circles with a timer delay so I am aware of how to do this but I can't capture the onTouch. Can someone please help? I have drawn my two circles with the below code (very similar to one of the exercises): package com.image; import android.app.Activity; import android.os.Bundle; public class image extends Activity { /** Called when the activity is first created. */ private CustomDrawableView mCustomDrawableView; //private CustomDrawableView mCustomDrawableView2; protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //last argument 1 = green, all others = red mCustomDrawableView = new CustomDrawableView(this, 20,20,20,20); setContentView(mCustomDrawableView); } } package com.image; import android.content.Context; import android.graphics.Canvas; import android.graphics.drawable.Drawable; import android.graphics.drawable.ShapeDrawable; import android.graphics.drawable.shapes.OvalShape; import android.view.View; public class CustomDrawableView extends View { private ShapeDrawable[] mDrawables; public CustomDrawableView(Context context, int x, int y, int width, int height) { super(context); mDrawables = new ShapeDrawable[2]; mDrawables[0] = new ShapeDrawable(new OvalShape()); // green one mDrawables[1] = new ShapeDrawable(new OvalShape()); //red one mDrawables[0].getPaint().setColor(0xff74AC23); mDrawables[1].getPaint().setColor(0x); mDrawables[0].setBounds(x,y,x+width,y+height); //arguments left, top, right, bottom mDrawables[1].setBounds(x+30,y+30,x+width+30,y+height+30); } @Override protected void onDraw(Canvas canvas) { //mDrawables[0].draw(canvas); for (Drawable dr : mDrawables) { dr.draw(canvas); } } } --~--~-~--~~~---~--~~ 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: AlertBuilder and Handler Problem
If you change your code in a few places, it should work. (It worked for me :)) I have demarked the code changes with // START and //=== END public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Handler handler=new Handler(); //== START // 1. I assume you have a TextView defined in your layout.main file. // 2. Make sure you have android:id set e.g. TextView android:id=@+id/tview TextView statusField = (TextView) findViewById(R.id.tview); //== END == F thread=new F(this,statusField,handler); thread.start(); } } class F extends Thread{ Context context; TextView statusField; Handler handler; String voto; F(Context context,TextView statusField,Handler handler) {this.context=context;this.statusField=statusField;this.handler=handler;} public void run() { final CharSequence[] items = {Ottimo, Buono, Sufficiente,Insufficiente}; String voto=; handler.post(new Runnable(){public void run(){ AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setTitle(Pick a color); builder.setSingleChoiceItems(items, -1, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int item) { Toast.makeText (context.getApplicationContext(), items [item], Toast.LENGTH_SHORT).show(); // START === dialog.cancel(); statusField.setText(items[item]); //= END = } }); AlertDialog alert = builder.create(); alert.show(); }}); //statusField.setText(voto); //REMOVE } } Hope this helps, Balwinder Kaur Open Source Development Center ·T· · ·Mobile· stick together The views, opinions and statements in this email are those of the author solely in their individual capacity, and do not necessarily represent those of T-Mobile USA, Inc. On Aug 4, 5:48 am, Lorenz lorenzoteod...@gmail.com wrote: Hi, I have a problem, I want to create an Alert Builder in a thread started by tha main activity.This Builder should be a multiple choiche. The code is: public class C extends Activity { private PrintWriter savedpoint; private Context context = this; private TextView statusField; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Handler handler=new Handler(); F thread=new F(this,statusField,handler); thread.start(); } } class F extends Thread{ Context context; TextView statusField; Handler handler; String voto; F(Context context,TextView statusField,Handler handler) {this.context=context;this.statusField=statusField;this.handler=handler;} public void run() { final CharSequence[] items = {Ottimo, Buono, Sufficiente,Insufficiente}; String voto=; handler.post(new Runnable(){public void run(){ AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setTitle(Pick a color); builder.setSingleChoiceItems(items, -1, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int item) { Toast.makeText(context.getApplicationContext(), items [item], Toast.LENGTH_SHORT).show(); } }); AlertDialog alert = builder.create(); alert.show(); }}); statusField.setText(voto); } } Problem 1: what can I do for doing some actions when a user select one of the alert choiches? Problem 2: It seems that the code doesn't stop when the alert dialog appears but still run, as a matter of fact the statusField is empty when appears. If nothing is possible to do Is there any other way to obtain something like this working? 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] Re: onTouch()
You need to override the onTouchEvent method in CustomDrawableView @Override public boolean onTouchEvent(MotionEvent event) { switch (event.getAction()) { // get your x and y values from event.getX() and event.getY() case MotionEvent.ACTION_DOWN: // redraw your green or red circle depending on your x,y values. break; } return true; } Hope this helps, Balwinder Kaur Open Source Development Center ·T· · ·Mobile· stick together The views, opinions and statements in this email are those of the author solely in their individual capacity, and do not necessarily represent those of T-Mobile USA, Inc. On Aug 4, 5:10 am, Graham gxt...@gmail.com wrote: Hi again, I am getting to grip with the android fundamentals and am curious as to how the onTouch and the onTouchlisteners work. To keep it simple I have used onDraw to draw two circles on a canvas, a green circle and a red circle (each of type ShapeDrawable - Oval Shape). I now wish to make it so that when I push the green circle, it will move to the right and if I push the red circle it will move down. I can move the circles with a timer delay so I am aware of how to do this but I can't capture the onTouch. Can someone please help? I have drawn my two circles with the below code (very similar to one of the exercises): package com.image; import android.app.Activity; import android.os.Bundle; public class image extends Activity { /** Called when the activity is first created. */ private CustomDrawableView mCustomDrawableView; //private CustomDrawableView mCustomDrawableView2; protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //last argument 1 = green, all others = red mCustomDrawableView = new CustomDrawableView(this, 20,20,20,20); setContentView(mCustomDrawableView); } } package com.image; import android.content.Context; import android.graphics.Canvas; import android.graphics.drawable.Drawable; import android.graphics.drawable.ShapeDrawable; import android.graphics.drawable.shapes.OvalShape; import android.view.View; public class CustomDrawableView extends View { private ShapeDrawable[] mDrawables; public CustomDrawableView(Context context, int x, int y, int width, int height) { super(context); mDrawables = new ShapeDrawable[2]; mDrawables[0] = new ShapeDrawable(new OvalShape()); // green one mDrawables[1] = new ShapeDrawable(new OvalShape()); //red one mDrawables[0].getPaint().setColor(0xff74AC23); mDrawables[1].getPaint().setColor(0x); mDrawables[0].setBounds(x,y,x+width,y+height); //arguments left, top, right, bottom mDrawables[1].setBounds(x+30,y+30,x+width+30,y+height+30); } @Override protected void onDraw(Canvas canvas) { //mDrawables[0].draw(canvas); for (Drawable dr : mDrawables) { dr.draw(canvas); } } } --~--~-~--~~~---~--~~ 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: Hello every body, I'm new here.
You can add -memory for the emulator. If you are using Eclipse, edit your run configuration to add the -memory command line option. go to your_Android_SDK_PATH/tools/emulator -help to see all the emulator options. Balwinder Kaur Open Source Development Center ·T· · ·Mobile· stick together The views, opinions and statements in this email are those of the author solely in their individual capacity, and do not necessarily represent those of T-Mobile USA, Inc. On Aug 3, 11:17 pm, whitech whit...@163.com wrote: Thank you very much, I can catch the error now. I've use catch (Exception) not catch(Error) before so I can't catch it. There is another problem, can I push the limit of memory higher? It is a little too small with only 16 MB. If can, what should I do? On 8月4日, 上午2时15分, Yusuf T. Mobile yusuf.s...@t-mobile.com wrote: Hello, to see the exception, look at logcat. You can do that from either the command line, or from the DDMS tab in Eclipse. Yusuf Saib Android ·T· · ·Mobile· stick together The views, opinions and statements in this email are those of the author solely in their individual capacity, and do not necessarily represent those of T-Mobile USA, Inc. On Aug 2, 7:55 pm,whitechwhit...@163.com wrote: Hi all! I'm new here. Now I've met a problem: when my program using too much memory, it die. Is there an exception or something else? And how to get it? Thank you very much! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
Re: Fwd: [android-beginners] Alarm Manager
How did u achieve that, can u be a bit more elaborative. I am facing the same problem i tried using different requestcode but it didnt work. Thanks On Jul 2, 4:54 pm, Veroland marius.ven...@gmail.com wrote: Thanks, I saw in the documentation that it was not used but tried to set the request code to my alarm's corresponding db entity's id and it looks like its working. I only tried that this morning for the first time. Thanks for the help On Jul 2, 8:42 am, Beth emez...@gmail.com wrote: I hit this issue hard and found the answers sorting through threads on the non-beginner developer group. Here is what I learned... When setting more than one timer/alarm, the second parameter in the Pending Intent call to getBroadcast is important. Your code looks like this: PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0, i, 0); The first zero can be changed up. At this point, the docs define the second parameter this way: requestCode Private request code for the sender (currently not used). However, this request code can be used. If you want to setup a bunch of timers/alarm calls, try using unique request codes for each individual alarm. Track these request codes and set them to be the same when you want to update or cancel an existing alarm. Although the docs say that system is supposed to recognize the intent parameter and take action based on matching the intent and the flags in the last parameter, I found that the request code was used in the match-up. Setting unique request codes for each unique intent solved all my problems. World peace will ensue. Best regards, Beth On Jul 1, 11:09 am, Veroland marius.ven...@gmail.com wrote: To get around this problem look at the flags the PendingIntent takes, I changed mine to PedingIntent.FLAG_CANCEL_CURRENT in the getBroadcast method, it means that if there was a previous PendingIntent it will update it with the new Intent. What I am not sure about yet is being able to create/control more than one of the same PendingIntent's that do the same thing. For multiple reminders for instance like what I am trying. Hope this helps On Jul 1, 7:52 am, varsha acharya varsha.acharya...@gmail.com wrote: Hi, I have a similar problem.. I have to send a sms on alarm to a predefined number. first time it works well... sends the sms on alarm but then if i set the alarm to send a different sms,it sends the previous sms. -- Forwarded message -- From: Veroland marius.ven...@gmail.com Date: Tue, Jun 30, 2009 at 3:53 PM Subject: [android-beginners] Alarm Manager To: Android Beginners android-beginners@googlegroups.com Hi I have 2 problems, I create a timer using AlarmManager and I set an Intent with certain values in the putExtra methods and then create the pendingIntent with this intent and call alamarmManager.set(RTC_Wakeup, time, pendingIntent) 1. The first time I do this everything works fine. The second time I do this and use a intent with different data in the intent when the alarm gets fired in my BroadcastReceiver class the data on the intent is the data of the intent used in the first alarm and NOT the second one. 2. If I call the alarmManager.set 2 times with 2 differents intents and settings only the last alarmManager.set seems to result in my broadcast receiver getting called. Does anyone know how to create multiple alarms? Here is my code I use to create the alarms Intent i = new Intent(getApplicationContext(), ReminderAlarm.class); i.putExtra(ReminderDbAdapter.KEY_ROWID, extras.getLong (ReminderDbAdapter.KEY_ROWID)); i.putExtra(ReminderDbAdapter.KEY_TITLE, extras.getString (ReminderDbAdapter.KEY_TITLE)); i.putExtra(ReminderDbAdapter.KEY_BODY, extras.getString (ReminderDbAdapter.KEY_BODY)); Log.d(Sending, extras.getString(ReminderDbAdapter.KEY_TITLE)); PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0, i, 0); AlarmManager alarmManager = (AlarmManager) getSystemService (ALARM_SERVICE); alarmManager.set(AlarmManager.RTC_WAKEUP, lcal, pendingIntent); -- Regards, Varsha- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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] unable to install ADT plugin for europa eclipse 3.3
Hello everybody, I am getting following message while installing ADT plugin for europa eclipse 3.3. Android Development Tools (0.9.1.v200905011822-1621) requires plug-in org.eclipse.wst.sse.core. Please suggest. 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] Eclipse 3.3, Android SDK 1.5, adb 1.0.18 running, 1.0.20 needed
When you try to point Eclipse 3.3 to Android SDK 1.5 (latest build as of today Aug 3 2009) I get an error saying that I have the wrong adb. so I went to sdk dir/tools and checked it out, running adb version. Sure enough, 1.0.18. including after a restart. Could I have vry specific directions for how to get this to work (running on OSX). If I have to go get SDK source code, can I know specifically where I have to go? I am the newbie on OSX though I developed an Android app on Windows platform about four months ago, or so, maybe longer. Thank you, misbell --~--~-~--~~~---~--~~ 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: Development Phone
You can install app as well in a t-mobile without SIM card. You can install either from eclipse or by downloading the apk file. On Aug 4, 8:19 am, Abhiram Alamuru alamuru420...@gmail.com wrote: I've got an unlocked t-mobile g1 and it works fine without the sim. I can use wifi, browse, play games, download from market etc. I haven't tried installing apps on it but I don't see why it won't work. I got it unlocked directly from t-mobile (a friend sold it to me since he was getting the new g2), if you like I can try installing an app into it using eclipse and let you know. On Mon, Aug 3, 2009 at 1:03 PM, Oliver Rennfort anubis...@gmail.com wrote: Yes you can use the dev phone without a sim but you need to hack it. But its simple comand line hack. Android Apps Developer On Aug 3, 2009 1:34 PM, Greg ghoo...@barereef.com wrote: I'm nearing completion of an app and need to begin testing on a real device. G1s are going for quite a bit less than the official development phone on ebay. I'm wondering if its possible to use the G1 without a sim card? Can you still use the WIFI and the rest of the phone functionality? -- Abhiram Alamuru --~--~-~--~~~---~--~~ 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 SMS?
Yes, I have the goal as you. But off hand I decided that I need to write an application to import my old messages from a csv file into android message database. But I hope there would be a way to gain access to the database.. as root or something. Please let me know if you come across a breakthrough. Thank you, On Jul 30, 6:52 am, Moritz U. ulrich.mor...@googlemail.com wrote: Hello, I'm new to Android, but I really like it. But I'm searching for a way to import mysms-messages from my old phone. I already have them in a csv-file. Is there an application or something for that? It wouldn't be a problem for me to write a small application to accomplish that... I'm experienced in programming. Best regards, Moritz U. --~--~-~--~~~---~--~~ 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] AnalogClock - how do i set it to show 18:50 in my app and never change?
Hi I would like to show an Analog clock in my android app and set it to a specific time, say 18:50 and never change. I have created an AnalogClock view and added it to the activity but it only ever shows the current time and I can't find a function call change it to the time I want. Is it even possible? I would have assumed that it would be something like below but these functions dont exist (or work that wat). AnalogClock clock = (AnalogClock)findViewById(R.id.clock); clock.setHour(18); clock.setMinute(50); or clock.setTime(18:50); or even SimpleDateFormat df = new SimpleDateFormat(HH:mm); Date myDateTime = df.format(18:50); clock.setTime(myDateTime); Am I barking up the wrong tree by trying to use the AnalogClock view for something is not designed to do? If so is there a different way to achieve what I want? I guess I would need to extend the AnalogClock class to make it show a specific time of my choosing. Problem is I wouldnt know where to start. I feel like I have missed something stupidly obvious but I have been looking at it so long I cant see it :-) Any help would be appreciated Thanks Richard --~--~-~--~~~---~--~~ 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] Poor quality contact photos
Hi - is there any way (or an app) to improve the quality of the contact photos, even pictures taken with my dSLR and put on my HTC Hero look terrible when I'm making or receiving calls. 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 really new
I like the pdf books at http://www.commonsware.com They are rather cheap too. On Aug 2, 2009 10:34 PM, mhart michael.web...@gmail.com wrote: Hey everyone I am really new to coding for the android, I have recently become disgusted with the iPhone and Apple inc. as a whole. I have a Development environment setup on my laptop using Ubuntu, Eclipse, and the Android SDK, I got the hello world program to work and it was great. I need some direction, please let me know where to start to get my programming skills sharpened for the Android, 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: Customization of Dialogs
Did you try ? dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); Balwinder Kaur Open Source Development Center ·T· · ·Mobile· stick together The views, opinions and statements in this email are those of the author solely in their individual capacity, and do not necessarily represent those of T-Mobile USA, Inc. On Aug 4, 4:43 am, swapnil swapnil.da...@gmail.com wrote: Thank you for your help, But if you don't call setTitle () it will keep that space blank. I want there should not be any space left. From top of Dialog View I want to show the Buttons. Can you please help me in that. Regards; Swapnil --~--~-~--~~~---~--~~ 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] Doing a periodical task. Counter?
Hi, I'm new on Android and I just made my first application openning a new Activity with a button and some other stuff but now I want to do something that have to be refreshed every little time or as fast as possible like a counter. When you program in C or Java you can make a loop and a counter adding 1 so yo can see 1.. 2 .. 3 ...4 I would like to be able to do that when the program is in the foreground. I've tried this code but it wont even start I get the has stopped unexpectivly when I try to execute it in the emulator. I also tried with the onStart method and a method I made my own and calling it from the onCreate but I get the same error. What I really want to do is to get the sound level in the mic while the program is running, I have the code for that but I don't know how to make it check the sound level periodically. Thank you. package android.manual1; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.widget.TextView; public class Manual1 extends Activity { /** Called when the activity is first created. */ //@Override static private int variable = 1; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } public void onResume (){ TextView text = (TextView) findViewById(R.id.count); do{ text.setText(Contador:+variable); variable=variable+1; }while (variable100); } } --~--~-~--~~~---~--~~ 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: opengl + android
Hi! You can study some tutorials here: http://www.anddev.org Robert On júl. 27, 10:28, Gargo changeyourmindifyou...@gmail.com wrote: Can anybody post here where to get examples of using opengl? --~--~-~--~~~---~--~~ 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: A complete newbie
You go, Dvisionj! tinyang is right about the two things you need to learn: Java language and then Android platform. You don't need to learn Linux to do Android programming. You also don't have to study every Java subject there is (such as Swing or Servlets), just get comfortable with the language basics before moving on to Android. Yusuf Saib Android ·T· · ·Mobile· stick together The views, opinions and statements in this email are those of the author solely in their individual capacity, and do not necessarily represent those of T-Mobile USA, Inc. On Aug 4, 9:31 am, tinyang tiny...@earthlink.net wrote: Here are a few good places to learn Java: http://www.javapassion.com/ http://freshbrain.org/group/learn-java-programming-learning-path Good luck! -Original Message- From: android-beginners@googlegroups.com [mailto:android-beginn...@googlegroups.com] On Behalf Of Dvisionj Sent: Tuesday, August 04, 2009 5:25 AM To: Android Beginners Subject: [android-beginners] A complete newbie Hi all OK, some are going to roll their eyes at the naivety at this post...gotta start somewhere! I wish to get into developing apps for Android, but I'm not sure where to start. I have basic unix/linux skills and I'm wondering what I should study next. I've no experience of Java so I'm guessing that should be it. If so, what are the best book/resources on the subject? Or should I start with C ? I'm not underestimating the huge task ahead, I realise there's a massive learning curve, but dammit, I'm capable and up for it! Thanks for reading. No virus found in this incoming message. Checked by AVG -http://www.avg.com Version: 8.0.169 / Virus Database: 270.13.24/2255 - Release Date: 8/3/2009 5:56 PM --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: How to capture sound level?
This doesn't work with the emulator but it does work on my device. On Jul 28, 8:07 pm, Balwinder Kaur (T-Mobile) balwinder.k...@t- mobile.com wrote: Does this help ? MediaRecorder recorder = new MediaRecorder(); recorder.setAudioSource(MediaRecorder.AudioSource.MIC); int maxvol = recorder.getMaxAmplitude(); Balwinder Kaur Open Source Development Center ·T· · ·Mobile· stick together The views, opinions and statements in this email are those of the author solely in their individual capacity, and do not necessarily represent those of T-Mobile USA, Inc. On Jul 26, 1:45 pm, Alex Mendez twist...@gmail.com wrote: Hi, I've been trying to get thesoundlevelcoming from the mic but I can't find a way to do it. In all the documentation I could find I didn't find anything that could help me read thesoundlevelfrom the mic. Anyone knows how to do it? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: How to capture sound level?
Ofcourse :) The emulator is not equipped to do recording. Balwinder Kaur Open Source Development Center ·T· · ·Mobile· stick together The views, opinions and statements in this email are those of the author solely in their individual capacity, and do not necessarily represent those of T-Mobile USA, Inc. On Aug 4, 12:01 pm, Alex Mendez twist...@gmail.com wrote: This doesn't work with the emulator but it does work on my device. On Jul 28, 8:07 pm, Balwinder Kaur (T-Mobile) balwinder.k...@t- mobile.com wrote: Does this help ? MediaRecorder recorder = new MediaRecorder(); recorder.setAudioSource(MediaRecorder.AudioSource.MIC); int maxvol = recorder.getMaxAmplitude(); Balwinder Kaur Open Source Development Center ·T· · ·Mobile· stick together The views, opinions and statements in this email are those of the author solely in their individual capacity, and do not necessarily represent those of T-Mobile USA, Inc. On Jul 26, 1:45 pm, Alex Mendez twist...@gmail.com wrote: Hi, I've been trying to get thesoundlevelcoming from the mic but I can't find a way to do it. In all the documentation I could find I didn't find anything that could help me read thesoundlevelfrom the mic. Anyone knows how to do it? --~--~-~--~~~---~--~~ 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: Doing a periodical task. Counter?
You are missing in the onResume method super.onResume(); -- Roman Baumgaertner Sr. SW Engineer-OSDC ·T· · ·Mobile· stick together The views, opinions and statements in this email are those of the author solely in their individual capacity, and do not necessarily represent those of T-Mobile USA, Inc. On Aug 4, 9:47 am, Alex Mendez twist...@gmail.com wrote: Hi, I'm new on Android and I just made my first application openning a new Activity with a button and some other stuff but now I want to do something that have to be refreshed every little time or as fast as possible like a counter. When you program in C or Java you can make a loop and a counter adding 1 so yo can see 1.. 2 .. 3 ...4 I would like to be able to do that when the program is in the foreground. I've tried this code but it wont even start I get the has stopped unexpectivly when I try to execute it in the emulator. I also tried with the onStart method and a method I made my own and calling it from the onCreate but I get the same error. What I really want to do is to get the sound level in the mic while the program is running, I have the code for that but I don't know how to make it check the sound level periodically. Thank you. package android.manual1; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.widget.TextView; public class Manual1 extends Activity { /** Called when the activity is first created. */ //@Override static private int variable = 1; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } public void onResume (){ TextView text = (TextView) findViewById(R.id.count); do{ text.setText(Contador:+variable); variable=variable+1; }while (variable100); } } --~--~-~--~~~---~--~~ 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: Doing a periodical task. Counter?
Roman wrote: You are missing in the onResume method super.onResume(); Not to mention the fact that, since the OP is doing all the TextView updates in a tight loop, only the last one will wind up having a visual impact. What I really want to do is to get the sound level in the mic while the program is running, I have the code for that but I don't know how to make it check the sound level periodically. Option #1: Do it when the user tells you to do it, via a button push or something. Option #2: Think long and hard about going with option #1. Option #3: Use postDelayed() on some widget to set up a periodic task. Option #4: Honestly, particularly for tying up and listening on a microphone, I would think the users would want to control the timing of it, so option #1 really should be the answer. Option #5: Use TimerTask, as per regular Java. Option #6: Fork a thread that uses SystemClock.sleep() and a Handler. Option #7: Use AsyncTask, where you sleep() for a bit in doInBackground() and check the mic/schedule the next task in onPostExecute(). -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android App Developer Training: http://commonsware.com/training.html --~--~-~--~~~---~--~~ 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: AlertBuilder and Handler Problem
Thanks Kaur,it works.. but if I want to do some action in the thread after the user has choose ???Namely there is a way to do something like this..:(I've used NEW ) public void run() { final CharSequence[] items = {Ottimo, Buono, Sufficiente,Insufficiente}; String voto=; handler.post(new Runnable(){public void run(){ AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setTitle(Pick a color); builder.setSingleChoiceItems(items, -1, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int item) { Toast.makeText (context.getApplicationContext(), items [item], Toast.LENGTH_SHORT).show(); // START === dialog.cancel(); statusField.setText(items[item]); //= END = voto=items[item]; --NEW } }); AlertDialog alert = builder.create(); alert.show(); }}); } } if(voto==ottimo) do something.. NEW It seems that the code doesn't stop, so the string voto could be empty... I need to use in the thread the choiche of the the user.. If you have some idea.. Thanks On 4 Ago, 17:33, Balwinder Kaur (T-Mobile) balwinder.k...@t- mobile.com wrote: If you change your code in a few places, it should work. (It worked for me :)) I have demarked the code changes with // START and //=== END public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Handlerhandler=newHandler(); //== START // 1. I assume you have a TextView defined in your layout.main file. // 2. Make sure you have android:id set e.g. TextView android:id=@+id/tview TextView statusField = (TextView) findViewById(R.id.tview); //== END == F thread=new F(this,statusField,handler); thread.start(); } } class F extends Thread{ Context context; TextView statusField; Handlerhandler; String voto; F(Context context,TextView statusField,Handlerhandler) {this.context=context;this.statusField=statusField;this.handler=handler;} public void run() { final CharSequence[] items = {Ottimo, Buono, Sufficiente,Insufficiente}; String voto=; handler.post(new Runnable(){public void run(){ AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setTitle(Pick a color); builder.setSingleChoiceItems(items, -1, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int item) { Toast.makeText (context.getApplicationContext(), items [item], Toast.LENGTH_SHORT).show(); // START === dialog.cancel(); statusField.setText(items[item]); //= END = } }); AlertDialog alert = builder.create(); alert.show(); }}); //statusField.setText(voto); //REMOVE } } Hope this helps, Balwinder Kaur Open Source Development Center ·T· · ·Mobile· stick together The views, opinions and statements in this email are those of the author solely in their individual capacity, and do not necessarily represent those of T-Mobile USA, Inc. On Aug 4, 5:48 am, Lorenz lorenzoteod...@gmail.com wrote: Hi, I have a problem, I want to create an Alert Builder in a thread started by tha main activity.This Builder should be a multiple choiche. The code is: public class C extends Activity { private PrintWriter savedpoint; private Context context = this; private TextView statusField; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Handlerhandler=newHandler(); F thread=new F(this,statusField,handler); thread.start(); } } class F extends Thread{ Context context; TextView statusField; Handlerhandler; String voto; F(Context context,TextView
[android-beginners] Re: A complete newbie
thank guys, much appreciated :-) --~--~-~--~~~---~--~~ 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] Recording Video code sample
Anyone got a good sample? I tried to compile the google cam app itself but somehow the code was missing lots of declarations etc. Thanks, Gaz --~--~-~--~~~---~--~~ 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]
I need a notification example in android. Please send me a example --~--~-~--~~~---~--~~ 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-developers] Re: How to Run J2SE Code on Android
Android is using Dalvik VM. That is a sub-set of J2SE with extra Android functions. On 05/08/2009 9:06am, Mark Murphy mmur...@commonsware.com wrote: Watermarker wrote: I am new to Android development. I am developing in Eclipse with Android plugin. I am trying to execute the following J2SE code on Android. Android is not J2SE. It is being compiled without errors as I have imported the JRE library in the android project. Don't do that. In the Configure Build Path option I have imported JRE System Library and in Order and Export option I have also exported this JRE System Library. Don't do that. But when it runs in emulator it gives the exception and failed to run. I think the jar files of JRE are not actually exported to Android emulator platform. If so, can anybody tell me how to export the jar files to Android emulator platform. Use the Android API, please: http://developer.android.com/reference/packages.html package test.six; import android.app.Activity; import android.os.Bundle; import android.widget.TextView; public class Driver extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); TextView tv = new TextView(this); javax.swing.JTextField jt = new javax.swing.JTextField(20); jt.setText( ...Hello its a Text Field... ); tv.setText(tv.getText()+ ,,, +jt.getText()); setContentView(tv); } } Android does not use or offer Swing. Your use of TextView is fine, just not the JTextField. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android Development Wiki: http://wiki.andmob.org --~--~-~--~~~---~--~~ 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] Authentication and Handling Cookies in Android
Hello, I am in some kind of a fix... I have been reading around the subject above and I think Android materials available are very patchy, and the Android documentation is not very useful without enough experience. I have never worked with cookies in Java (only PHP)- and the pages I have read don't discuss both initial AUTHENTICATION and COOKIES together. And I am finding it difficult to bring together a working program here. My idea is- I have a form that the user inputs his credentials, on the click of the button the credentials are passed to the server, the server responds with a cookie, and this is stored for future use. As per the piece of code below, is it possible to make the two methods: authenticate() and xCookies() (receives, store and set cookies with requests) work together? If not please tell me how I can achieve the desired goal (preferably using HTTP class vis-a-vis URL). Your assistance will be highly appreciated. . public class XClient extends Activity { EditText username; EditText password; TextView userTv; TextView pwdTv; @Override public void onCreate(Bundle icicle){ super.onCreate(icicle); setContentView(R.layout.main); login(); } protected void login() { username = (EditText)findViewById(R.id.userNameLbl); password = (EditText)findViewById(R.id.pwdText); pwdTv = (EditText)findViewById(R.id.pwdLbl); userTv =(TextView)findViewById(R.id.userNameText); String userId = username.getText().toString(); String userPwd = password.getText().toString(); Button loginBtn = (Button)this.findViewById(R.id.authButton); loginBtn.setOnClickListener(new OnClickListener() { public void onClick(View v) { authenticate(userId, userPwd); } });} public void authenticate(String token1, String token2)// Supposed to handle authentication { HttpClient client = new DefaultHttpClient(); client.getParams().setParameter(http.useragent, My Browser); HostConfiguration host = client.getHostConfiguration(); host.setHost(new URI(http://localhost:8080;, true)); Credentials credentials = new UsernamePasswordCredentials (token1, token2); AuthScope authScope =new AuthScope(host.getHost(), host.getPort()); HttpState state = client.getState(); state.setCredentials(authScope, credentials); GetMethod method = new GetMethod(www.gmail.com); try{ client.executeMethod(host, method); System.err.println(method.getStatusLine()); System.err.println(method.getResponseBodyAsString()); } catch(Exception e) { System.err.println(e); } finally { method.releaseConnection(); } } //xCookies uses CookieManager class to store received cookie, and sends the cookie with subsequent requests private void xCookies() { CookieManager cm = new CookieManager(); try { URL url = new URL(www.gmail.com); URLConnection conn = url.openConnection(); conn.connect(); cm.storeCookies(conn); System.out.println(cm); cm.setCookies(url.openConnection()); } catch (IOException ioe) { ioe.printStackTrace(); } } } --~--~-~--~~~---~--~~ 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: unable to install ADT plugin for europa eclipse 3.3
Hi, It is the problem of Eclipse version you are using. The Eclipse should be updated. Just go to Software updates option in Help menu of Eclipse update it first then ADT will get installed properly. Regards, Swapnil --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---