Re: [android-beginners] sqlite sample sd-card

2010-03-27 Thread Alessandro Pellizzari
Il giorno mar, 23/03/2010 alle 04.38 -0700, hermann ha scritto:

> i looking for small sample how to access a sqlite db on sd-card.
> can anybody help with a small snipet ?

File sdcard = Environment.getExternalStorageDirectory();

File dbfile = sdcard.getAbsolutePath() + File.separator + "dbname.sql";

SQLiteDatabase db = SQLiteDatabase.openOrCreateDatabase(dbfile, null);


it is a good practice to NOT put your DBs on the sdcard root, so please
create a directory for your software.

Bye.


-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

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

To unsubscribe from this group, send email to 
android-beginners+unsubscribegooglegroups.com or reply to this email with the 
words "REMOVE ME" as the subject.


Re: [android-beginners] Re: main.out.xml

2010-03-27 Thread mbaye dieng
hello,
Me also I have this probleme of main.out.xml.
Can you explain how have you done to resolve it please? Thanks in advance

2010/3/27 Matze 

> Thank you so much! The error is gone and I can continue working!
> Awesome!
>
> On Mar 27, 12:12 am, Xavier Ducrohet  wrote:
> > Try a clean, if that doesn't remove an error marker that shouldn't be
> > there (which happens occasionally), just delete it manually.
> > Open the Problems view, select the marker and hit del on your
> > keyboard. Then clean your project again and make sure the problem
> > doesn't show up again (which would mean that the error is in fact
> > still present).
> >
> > Xav
> >
> >
> >
> > On Fri, Mar 26, 2010 at 9:49 AM, Matze 
> wrote:
> > > Hey Folks,
> > > I've been hanging around this problem for almost two days and I'm very
> > > frustraded. I accidently executed the main.xml file while I was trying
> > > to start my normal application (currently I'm going through the
> > > tutorial on at Android Developers). However, a new file was created
> > > named main.out.xml in my layout folder. I read about this in other
> > > threads and I deleted it and restarted Eclipse. Unfortunatly the
> > > result was, that I couldn't execute my programm no more since Eclipse
> > > tells me all the time that: "Your project contains error(s), please
> > > fix them vefore running your application". I did this several times to
> > > be sure that I can recreate the problem.
> > > I know this is very less information, but I just don't know what could
> > > be useful for you guys to know to help me, since I'm very new to
> > > programming. It could be something with my IDE configurations, but I
> > > did it quite like Tim Layton says in this video:
> > >http://www.youtube.com/watch?v=vumCqNOwiUM&feature=player_embedded#
> >
> > > Please help me, thank you!
> >
> > > --
> > > You received this message because you are subscribed to the Google
> > > Groups "Android Beginners" group.
> >
> > > NEW! Try asking and tagging your question on Stack Overflow at
> > >http://stackoverflow.com/questions/tagged/android
> >
> > > 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
> >
> > > To unsubscribe from this group, send email to android-beginners+
> unsubscribegooglegroups.com or reply to this email with the words "REMOVE
> ME" as the subject.
> >
> > --
> > Xavier Ducrohet
> > Android SDK Tech Lead
> > Google Inc.
> >
> > Please do not send me questions directly. Thanks!
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Beginners" group.
>
> NEW! Try asking and tagging your question on Stack Overflow at
> http://stackoverflow.com/questions/tagged/android
>
> 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
>
> To unsubscribe from this group, send email to android-beginners+
> unsubscribegooglegroups.com or reply to this email with the words "REMOVE
> ME" as the subject.
>



-- 
Mbaye Dieng, engineer in computer science.
Address: Am annatal 47, 15344 Strausberg
Tel: (+49) 017635459747

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

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

To unsubscribe from this group, send email to 
android-beginners+unsubscribegooglegroups.com or reply to this email with the 
words "REMOVE ME" as the subject.


Re: [android-beginners] Question about Andriod application's IPC

2010-03-27 Thread milton john
Hi Raj,

By using AIDL(Android Interface definition Lanuage), we can slove this IPC
issue.

see this below link for example and reference.

Thanks,
A.Milton


http://saigeethamn.blogspot.com/2009/09/android-developer-tutorial-part-9.html
http://developer.android.com/intl/zh-CN/guide/developing/tools/aidl.html
On Tue, Mar 23, 2010 at 4:16 AM, RAJ  wrote:

> Hello,
> Have a real basic question about IPC exists in android application
> space(SDK)
> I have two projects in eclipse workspace – (So two processes)
> one is activity which is UI app
> Second one is “service” which exposes some apis to client (above UI
> App)
>
> I want  my first UI app(activity) to call some apis in second service
> app, and in doing so, I get the following error:
>
> WARN/dalvikvm(289): VFY: unable to resolve static method 31: Lcom/
> example/testservice/ITestService$Stub;.asInterface (Landroid/os/
> IBinder;)Lcom/example/testservice/ITestService;
>
> I am not sure if there is any sample code such scenarios (IPC between
> two apps) ? Can someone please point me to right reference app/code?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Beginners" group.
>
> NEW! Try asking and tagging your question on Stack Overflow at
> http://stackoverflow.com/questions/tagged/android
>
> 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
>
> To unsubscribe from this group, send email to android-beginners+
> unsubscribegooglegroups.com or reply to this email with the words "REMOVE
> ME" as the subject.
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

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

To unsubscribe from this group, send email to 
android-beginners+unsubscribegooglegroups.com or reply to this email with the 
words "REMOVE ME" as the subject.


[android-beginners] Re: Help converting C# code (Isn't there anyone that will help out here)

2010-03-27 Thread Mr. Baseball 34
I am trying to convert a C# game to Android and need some help with
the graphics stuff.

Can anyone show me how to convert this to Java?

using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using System.Drawing.Drawing2D;

namespace MyGame
{
 public partial class MyButton : Button
 {
   GraphicsPath path;
   GraphicsPath innerPath;

   private bool _clicked = false;
   public bool Clicked
   {
 get { return _clicked; }
 set
 {
   _clicked = value;
   Invalidate();
 }
   }

   public MyButton()
   {
 InitializeComponent();
   }

   protected override void OnPaint(PaintEventArgs pevent)
   {
 Graphics g = pevent.Graphics;
 g.SmoothingMode = SmoothingMode.AntiAlias;

 // Create painting objects
 Brush b = new SolidBrush(this.ForeColor);

 // Create Rectangle To Limit brush area.
 Rectangle rect = new Rectangle(0, 0, 150, 150);

 LinearGradientBrush linearBrush =
   new LinearGradientBrush(rect,
   Color.FromArgb(20,20,20),
   this.ForeColor,
   225);

 path = new GraphicsPath();
 innerPath = new GraphicsPath();

 path.AddArc(0, 0, 270, 270, 180, 90);
 path.AddArc(120, 0, 30, 30, 270, 90);
 path.AddLine(150, 0, 150, 85);
 path.AddArc(100, 100, 100, 100, -90, -90);
 path.AddLine(100, 150, 0, 150);
 path.AddArc(0, 120, 30, 30, 90, 90);

 innerPath.AddArc(10, 10, 250, 250, 180, 90);
 innerPath.AddArc(130, 10, 10, 10, 270, 90);
 innerPath.AddLine(140, 0, 140, 90);
 innerPath.AddArc(90, 90, 100, 100, -90, -90);
 innerPath.AddLine(90, 140, 10, 140);
 innerPath.AddArc(10, 130, 10, 10, 90, 90);

 this.Region = new Region(path);

 PathGradientBrush pgbrush = new PathGradientBrush(innerPath);
 pgbrush.CenterPoint = new Point(75, 75);
 pgbrush.CenterColor = Color.White;
 pgbrush.SurroundColors = new Color[] {
Color.FromArgb(250,this.ForeColor) };

 if (_clicked == false)
 {
   g.FillPath(linearBrush, path);
   g.FillPath(b, innerPath);
 }
 else
 {
   g.FillPath(linearBrush, path);
   g.FillPath(pgbrush, innerPath);
 }

 // Dispose of painting objects
 b.Dispose();
 pgbrush.Dispose();
 linearBrush.Dispose();
   }

   protected override void OnMouseEnter(EventArgs e)
   {
 this.Cursor = Cursors.Hand;
 base.OnMouseEnter(e);
   }

   protected override void OnMouseLeave(EventArgs e)
   {
 this.Cursor = Cursors.Arrow;
 base.OnMouseLeave(e);
   }

   protected override void OnMouseDown(MouseEventArgs mevent)
   {
 _clicked = true;
 base.OnMouseDown(mevent);
   }

   protected override void OnMouseUp(MouseEventArgs mevent)
   {
 _clicked = false;
 base.OnMouseUp(mevent);
   }
 }
}

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

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

To unsubscribe from this group, send email to 
android-beginners+unsubscribegooglegroups.com or reply to this email with the 
words "REMOVE ME" as the subject.


Re: [android-beginners] Which version of Java is used in Android?

2010-03-27 Thread Mark Murphy
Poldie wrote:
> I've read that Android doesn't use Java; instead, you write in Java
> syntax but the code is compiled into a different VM's bytecode
> format.  Fine, assuming this is true, but which version of Java
> syntax?  I understand that Java 1.5 has generics; 1.6 has annotations
> etc - is there a cut-off point? 

http://developer.android.com/sdk/requirements.html

"JDK 5 or JDK 6 (JRE alone is not sufficient)"

> Do I get sensible warnings if I try
> and use stuff that's not supported, or will it happy compile but then
> fail at runtime?

If it compiles from source with JDK 5 or JDK 6, it should work without
issue on Android when that code is cross-compiled into Dalvik VM
bytecodes by the rest of the build chain. Hence, the only warnings you
will typically see come from the JDK javac compiler.

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

Android Training in US: 14-18 June 2010: http://bignerdranch.com

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

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

To unsubscribe from this group, send email to 
android-beginners+unsubscribegooglegroups.com or reply to this email with the 
words "REMOVE ME" as the subject.


[android-beginners] Which version of Java is used in Android?

2010-03-27 Thread Poldie
I've read that Android doesn't use Java; instead, you write in Java
syntax but the code is compiled into a different VM's bytecode
format.  Fine, assuming this is true, but which version of Java
syntax?  I understand that Java 1.5 has generics; 1.6 has annotations
etc - is there a cut-off point? Do I get sensible warnings if I try
and use stuff that's not supported, or will it happy compile but then
fail at runtime?

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

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

To unsubscribe from this group, send email to 
android-beginners+unsubscribegooglegroups.com or reply to this email with the 
words "REMOVE ME" as the subject.


[android-beginners] Re: How to block incoming call in Android?

2010-03-27 Thread Sam Lowry
jitendra kumar wrote:

>  I want to develop one call control application on android. As we know
>  android sdk does not provide any API which block incoming call due to
>  security reasion.
>
>  Is there any possiablity to block incoming call using android open
> source api;s?

Did, you ever work this out?

~S


-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

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

To unsubscribe from this group, send email to 
android-beginners+unsubscribegooglegroups.com or reply to this email with the 
words "REMOVE ME" as the subject.


[android-beginners] Re: Passing Command line arguments

2010-03-27 Thread Zigurd
The "am" command in the shell starts applications. Use "adb shell" to
get a shell. Then type "am" without arguments and you will see the
parameters for this command.

Command line arguments to Android applications are equivalent to what
is passed in an Intent object. Since you use the "am" command, you do
not actually invoke the application directly. You specify arguments
that match an application's intent filters. So "am" is useful in cases
where you want to try different Intent objects and matches without
modifying code. There is no difference or advantage to launching an
app from the command line.

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

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

To unsubscribe from this group, send email to 
android-beginners+unsubscribegooglegroups.com or reply to this email with the 
words "REMOVE ME" as the subject.


[android-beginners] Re: PCM format

2010-03-27 Thread niko20
Hi Chris

16bit PCM is signed. Its data type is in shorts. (not floating point).
A WAV file is little endian byte order. That means if you read it with
a java method you have to reverse the byte order using a ByteBuffer()
since java reads things big endian. (Read the data, move it to a byte
buffer that has the correct order, and get the array of data from that
buffer). Reading the WAV in native code using the NDK is faster since
it will read in little endian to start with.

amplitude of zero is simply the value zero.

For stereo data, the sound is simply "interleaved" like so:
leftrightleftrightleftright. So you have short data, and left is
first, then right, then left, etc. on left/right combo is a sample.

Google WAV file format. The same format that the PCM data in a WAV is
in is the same format the AudioTrack expects.

-niko

On Mar 23, 9:18 pm, MadVillain  wrote:
> Hey I'm just beginning writing Android apps and have a basic, but poor
> understanding of digital audio. Can someone tell me what the format of
> PCM 16-bit is? Is it signed/unsigned? Is it floating point/fixed
> point? What is the byte ordering? What bit pattern represents an
> amplitude of zero? I'm asking so I can write a dinky little FM synth
> using the AudioTrack class.
>
> Thanks,
> Chris

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

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

To unsubscribe from this group, send email to 
android-beginners+unsubscribegooglegroups.com or reply to this email with the 
words "REMOVE ME" as the subject.


[android-beginners] Re: main.out.xml

2010-03-27 Thread Matze
Thank you so much! The error is gone and I can continue working!
Awesome!

On Mar 27, 12:12 am, Xavier Ducrohet  wrote:
> Try a clean, if that doesn't remove an error marker that shouldn't be
> there (which happens occasionally), just delete it manually.
> Open the Problems view, select the marker and hit del on your
> keyboard. Then clean your project again and make sure the problem
> doesn't show up again (which would mean that the error is in fact
> still present).
>
> Xav
>
>
>
> On Fri, Mar 26, 2010 at 9:49 AM, Matze  wrote:
> > Hey Folks,
> > I've been hanging around this problem for almost two days and I'm very
> > frustraded. I accidently executed the main.xml file while I was trying
> > to start my normal application (currently I'm going through the
> > tutorial on at Android Developers). However, a new file was created
> > named main.out.xml in my layout folder. I read about this in other
> > threads and I deleted it and restarted Eclipse. Unfortunatly the
> > result was, that I couldn't execute my programm no more since Eclipse
> > tells me all the time that: "Your project contains error(s), please
> > fix them vefore running your application". I did this several times to
> > be sure that I can recreate the problem.
> > I know this is very less information, but I just don't know what could
> > be useful for you guys to know to help me, since I'm very new to
> > programming. It could be something with my IDE configurations, but I
> > did it quite like Tim Layton says in this video:
> >http://www.youtube.com/watch?v=vumCqNOwiUM&feature=player_embedded#
>
> > Please help me, thank you!
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Beginners" group.
>
> > NEW! Try asking and tagging your question on Stack Overflow at
> >http://stackoverflow.com/questions/tagged/android
>
> > 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
>
> > To unsubscribe from this group, send email to 
> > android-beginners+unsubscribegooglegroups.com or reply to this email with 
> > the words "REMOVE ME" as the subject.
>
> --
> Xavier Ducrohet
> Android SDK Tech Lead
> Google Inc.
>
> Please do not send me questions directly. Thanks!

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

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

To unsubscribe from this group, send email to 
android-beginners+unsubscribegooglegroups.com or reply to this email with the 
words "REMOVE ME" as the subject.


Re: [android-beginners] Abridged summary of android-beginn...@googlegroups.com - 11 Messages in 6 Topics

2010-03-27 Thread rashmi jagtap
REMOVE ME

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

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

To unsubscribe from this group, send email to 
android-beginners+unsubscribegooglegroups.com or reply to this email with the 
words "REMOVE ME" as the subject.