[android-beginners] Re: MediaPlayer Volume Range

2009-01-08 Thread Marc Lester Tan
Thanks Dave. Although when I tried putting 100 in the setVolume method

clickSound.setVolume(100, 100);

The volume level in the emulator seems to be louder when compared to 1.0.
Any idea?

-Marc

On Thu, Jan 8, 2009 at 10:39 AM, Dave Sparks davidspa...@android.comwrote:


 The range is 0 to 1. You can use any increment you want to create a
 logarithmic volume scale, just make full volume 1.0. Multiply be a
 scalar less than 1.0 to get the next lower volume. Multiply that
 volume by the same scalar to get the next one. Repeat until you have
 enough values.

 The number you choose for your multiplier will vary according to
 purpose. For example, the Android music volume control is much finer
 grained (32 steps?) than the notification volume control (8 steps?).
 To get a smooth fade, you probably want to use 1dB or less (1dB =
 ~0.89).

 On Jan 7, 3:04 am, Marc Lester Tan mail...@gmail.com wrote:
  Hi folks,
 
  I just want to ask if somebody knows the usable range for the
 MediaPLayer's
  volume levels? The doc just says it is a raw scalar and the UI should
 scale
  logarithmically. An example would be helpful.
 
  Thanks in advance.
 
  -Marc
 


--~--~-~--~~~---~--~~
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] Picture Slideshow in android

2009-01-08 Thread java.webline

Hi all,

I m new to android devlopment.

I want to create an picture viewer type application with some basic
functions such as
Zoom In/Out, Fullscreen etc.

I have no idea whatsoever how to do this.
Can any one provide a hint about the way this should be implemented?

Any help is 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: Using built in class for game development

2009-01-08 Thread Mark Murphy

kozak wrote:
 Hi All,
 I am trying to build a board game, Mastermind
 http://en.wikipedia.org/wiki/Mastermind_(board_game).
 
 Briefly put, the player has to guess a a set of colour codes set by
 the codmaker (2nd player).
 
 To draw the board itself I need to draw about 48 (12 chances x 4 pegs
 each ) holders for the pegs and an additional 48 holders to indicate
 the status of each combination. Check out the picture in the wiki
 link.
 
 My doubt is regarding the design of the game.
 
 One way to draw the board is to have an image Button (built in class )
 for all the pegs and the status pins.
 
 Another way is to take a canvas and draw all the objects for each
 move.
 
 I would like to know which is the most efficient way of doing things.
 Please feel free to post your suggestions if any.

I can tell you that when Ed Burnette created a Sudoku game for his
_Hello, Android_ book, he went with 2D graphics and a Canvas. Whether
that was for efficiency or to make a better book example, I cannot say.

-- 
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] problem in receiving sms.

2009-01-08 Thread Honest

I have created one main class which extends activity. Another class
which extends BroadcastReceiver. The code of it is as below.



import android.app.NotificationManager;
import android.content.*;
import android.app.Notification;
import android.widget.*;


public class AlarmReceiver extends BroadcastReceiver{
// Display an alert that we've received a message.
   // @Override
   ReceiveSMS sms=new ReceiveSMS();

public void onReceive(Context context, Intent intent){
System.out.println(Receive);

   NotificationManager nm = (NotificationManager)
context.getSystemService(Context.NOTIFICATION_SERVICE);
   System.out.println(Message Received);

Notification nm1=new Notification(R.drawable.ab,Message
Received,1000);
nm.notify(3, nm1);
//nm.no
  //  sms.display();

   }
}

The following is my androidmanifiest.xml file.


?xml version=1.0 encoding=utf-8?
manifest xmlns:android=http://schemas.android.com/apk/res/android;
  package=com.android.ReceiveSMS
  android:versionCode=1
  android:versionName=1.0.0
application android:icon=@drawable/icon android:label=@string/
app_name

intent-filter
action android:name=android.intent.action.MAIN /
category
android:name=android.intent.category.LAUNCHER /

/intent-filter

activity android:name=.ReceiveSMS
  android:label=@string/app_name

/activity
receiver android:name=.AlarmReceiver
 /receiver
/application
/manifest




I did not get any error at the compilation time but when i run the
programme in eclipse . It does not get any user input. I thought that
it should invoked when i will send sms to that emulator but yet it
does not invoke. I hope some one will reply me as early as possible.
--~--~-~--~~~---~--~~
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: Complete Basics

2009-01-08 Thread java.webline

hi there i need to develop the same application as
sdrakul...@gmail.com wants to develop.

There is more to me that i have enough experience of eclipse and java
both.

So only thing i need to digg is photo viewer and slideshow in android.

In case anyone can help me out.

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: Confusion about selection

2009-01-08 Thread silverberg.ode...@googlemail.com

I think thats what he already knows. Guess he was asking it, because
in some android books the author says its better to start with J2ME
(or java in general) if you haven't worked with it before, because for
some people it could be too hard to learn Java AND android
programming at the same time.

Basicly it means: I you never programmed something in Java or some
similar language (i.e.C#), it would be pretty hard for someone to
start straight with android w/o the basic knowledge of java/j2me


On Jan 7, 8:22 pm, jtaylor jatto@gmail.com wrote:
 On Jan 5, 11:13 pm, Pratik Patel pratik.pa...@c-sam.com wrote:

 Android replaces J2ME...

 - Juan T.
--~--~-~--~~~---~--~~
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] problem loading images from local file

2009-01-08 Thread baba vali
hi ,

i am loading images from the loacal file
(data/data/myPackage/files/fileName)
i have used decodeFile()

the application is getting crash getting outOfMemory error
i have also tried with
decodeByteArray() still it crashes

can anybody help me to sort out this

thanks
i am loading images from the loacal file
(data/data/myPackage/files/fileName)
i have used decodeFile()

the application is getting crash getting outOfMemory error
i have also tried with
decodeByteArray() still it crashes

can anybody help me to sort out this

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: Using built in class for game development

2009-01-08 Thread Brad Gies

Kozak,

I love Mastermind, but please do the Super Mastermind version :) (5 pegs x
12 chances) :). Or even better, give the user the option to use the tougher
version :)



Sincerely,
 
Brad Gies
 
 
-
Brad Gies
27415 Greenfield Rd, # 2,
Southfield, MI, USA
48076
www.bgies.com  www.truckerphone.com 
www.EDI-Easy.com  www.pricebunny.com
-
 
Moderation in everything, including abstinence

-Original Message-
From: android-beginners@googlegroups.com
[mailto:android-beginn...@googlegroups.com] On Behalf Of kozak
Sent: Wednesday, January 07, 2009 11:11 PM
To: Android Beginners
Subject: [android-beginners] Using built in class for game development


Hi All,
I am trying to build a board game, Mastermind
http://en.wikipedia.org/wiki/Mastermind_(board_game).

Briefly put, the player has to guess a a set of colour codes set by
the codmaker (2nd player).

To draw the board itself I need to draw about 48 (12 chances x 4 pegs
each ) holders for the pegs and an additional 48 holders to indicate
the status of each combination. Check out the picture in the wiki
link.

My doubt is regarding the design of the game.

One way to draw the board is to have an image Button (built in class )
for all the pegs and the status pins.

Another way is to take a canvas and draw all the objects for each
move.

I would like to know which is the most efficient way of doing things.
Please feel free to post your suggestions if any.

Thanks and Regards
Kozak


--~--~-~--~~~---~--~~
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: Delete android database

2009-01-08 Thread roland

How about  deleteDatabase(String name)?

http://code.google.com/intl/fr/android/reference/android/content/ContextWrapper.html#deleteDatabase(java.lang.String)

On 7 jan, 22:03, mitch mitche...@gmail.com wrote:
 Hiya,

 Does anyone know if there is a way to remove an android database file
 programmatically? I need to remove a lot of records (10,000+) and it
 seems it would be quicker to remove the database and re-create from
 scratch rather than deleting from the various tables (Which takes
 about 20 seconds using triggers to force referential integrity).

 Thanks in advance!
 mitch
--~--~-~--~~~---~--~~
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] Audio Processing Options

2009-01-08 Thread obi

What options are there currently for analyzing sound files on Android,
specifically ones from the onboard microphone?  Ideally, I'd like to
be able to look at the amplitude of the microphone over time and
possibly perform an FFT.  Do those options currently exist in Android,
and, if so, where?

-Obi
--~--~-~--~~~---~--~~
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: Removing installed application in Emulator

2009-01-08 Thread Lutz Schönemann
Simplest way to do this is while the emulator is running:
1) Go to the home screen
2) Push the Menu button
3) Select Settings
3) Select Applications
4) Select Manage applications
5) Select the package you want to remove
6) Click on Uninstall
7) Click OK and wait until uninstall is completed
8) Click OK again and the job is done

Lutz

  How can we remove the already installed apps from the Emulator?
 
  Thanks,
  Apparao Mulpuri. 

smime.p7s
Description: S/MIME cryptographic signature


[android-beginners] Re: Problem about registration

2009-01-08 Thread 冯驯
Mike T:
I'm very glad that could see your letter here and  also interested in
android develop,same to you,Im in Beijing.
Maybe we could solve the problem,I really want to have a communicate with
you.(MSN:fx.sidew...@live.cn msn%3afx.sidew...@live.cn)


Sideways


2009/1/7 exlarger xlarg...@gmail.com


 Dear Android:
 We are a software developer team, and we locate in China. Recently, we
 decide to join the Android market for developing some applications for
 Android Mobile phone, everything were just fine until we choose the
 location for developer. There is no option for our Country.
 We are very dissappoit to see that, since Android is an open sorce
 program, and I really don't think there should be any limitation for
 this kind of issue.
 Please help us out.

 Best regards;

 Mike T.

 


--~--~-~--~~~---~--~~
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] Installing new packages out of my own application

2009-01-08 Thread Lutz Schönemann
Hello,

I'm new to Android development and don't realy know about how to use  
all the given functions.

What I want to do is to build a tool (only a proof of concept) to  
manage installation of new packages. The thing is I can't figure out  
how to install a new package.

First I added a uses-permission tag with the value  
android.permission.INSTALL_PACKAGES into my packages manifest file.

I've found the function installPackage(Uri uri) inside the  
PackageManager class. So I tried to use it this way:
Uri.Builder uribuilder = new Uri.Builder();
uribuilder.scheme(http);
uribuilder.path(//hostname/SamplePackage.apk);
PackageManager pm = getPackageManager();
pm.installPackage(uribuilder.build());
What happens is that my application crashes. Using the debuger I  
figured out that a NullPointerException occurs inside the  
PackageManager class.

The next way I tried to install a package is using the already  
existing Package Manager. So I created a new Intent to call the  
Package Manager and called StartActivity with this Intent:
Uri.Builder uribuilder = new Uri.Builder();
uribuilder.scheme(http);
uribuilder.path(//hostname/SamplePackage.apk);
Intent intent = new Intent(Intent.ACTION_PACKAGE_INSTALL,  
uribuilder.build());
startActivity(intent);
But also this method ends with a NullPointerException.

What am I doing wrong? How can I get this job done?

I don't have a real phone to develop on, only the Android emulator.  
Maybe the emulator doesn't support this function or this Intent!?

Thanks for help
Lutz



smime.p7s
Description: S/MIME cryptographic signature


[android-beginners] Re: Removing installed application in Emulator

2009-01-08 Thread Mahesh Vaghela
To remove application

go to command prompt

go up to your tools directory

than use this commands:

 adb shell
cd data
cd app
ls

ls will list all your application installed.

than..

rm Your application name along with Package name









On Wed, Jan 7, 2009 at 4:40 PM, Apparao Mulpuri apparao.for...@gmail.comwrote:


 How can we remove the already installed apps from the Emulator?

 Thanks,
 Apparao Mulpuri.

 


--~--~-~--~~~---~--~~
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] Error using graphics in XML-Based UI

2009-01-08 Thread coderguy89

Is there a bug when using the XML ImageView to display graphics? I can
display images fine using the ImageView class in
androids.widgets.ImageView. But when trying to run an application that
uses the XML ImageView to display images, my application crashes at
start-up saying The application [appname] has stopped unexpectedly.
Please try again..

Code in Main Activity

public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);

setContentView(R.layout.main);
}


Code In main.xml:

?xml version=1.0 encoding=utf-8?
LinearLayout xmlns:android=http://schemas.android.com/apk/res/
android
android:orientation=vertical
android:layout_width=fill_parent
android:layout_height=fill_parent


ImageView android:id=@+id/imageview
android:layout_width=wrap_content
android:layout_height=wrap_content
android:src=@+drawable/eclipse
/

/LinearLayout

In android:src 'eclipse' is an eclipse.png image.  I also tried
android:src=@drawable/eclipse with no success --- it won't even
compile this way.



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] The Share Menu for pictures

2009-01-08 Thread Sheepz

Hey guys, i want to make an app that sends pictures to facebook and i
wanted to know how i can attach myself to the share menu (context menu
for pictures - share picture via: messaging, Gmail, etc..)
anybody knows the api i need to attach myself to?

--~--~-~--~~~---~--~~
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: Confusion about selection

2009-01-08 Thread jtaylor

I had to brush up on Java when Android came out, even though I was
Java Certified from years back. I also knew J2ME.
So he just needs to learn Java first, there's no need to learn J2ME
because it's simply something other.


- Juan T.

On Jan 8, 9:15 am, silverberg.ode...@googlemail.com
silverberg.ode...@googlemail.com wrote:
 I think thats what he already knows. Guess he was asking it, because
 in some android books the author says its better to start with J2ME
 (or java in general) if you haven't worked with it before, because for
 some people it could be too hard to learn Java AND android
 programming at the same time.

 Basicly it means: I you never programmed something in Java or some
 similar language (i.e.C#), it would be pretty hard for someone to
 start straight with android w/o the basic knowledge of java/j2me

 On Jan 7, 8:22 pm, jtaylor jatto@gmail.com wrote:

  On Jan 5, 11:13 pm, Pratik Patel pratik.pa...@c-sam.com wrote:

  Android replaces J2ME...

  - Juan T.
--~--~-~--~~~---~--~~
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 using graphics in XML-Based UI

2009-01-08 Thread coderguy89

Ok - nevermind; I realized the problem - the image was actually in the
wrong directory.

On Jan 7, 3:12 am, coderguy89 codergu...@gmail.com wrote:
 Is there a bug when using the XML ImageView to display graphics? I can
 display images fine using the ImageView class in
 androids.widgets.ImageView. But when trying to run an application that
 uses the XML ImageView to display images, my application crashes at
 start-up saying The application [appname] has stopped unexpectedly.
 Please try again..

 Code in Main Activity

     public void onCreate(Bundle savedInstanceState)
     {
         super.onCreate(savedInstanceState);

         setContentView(R.layout.main);
     }

 Code In main.xml:

 ?xml version=1.0 encoding=utf-8?
 LinearLayout xmlns:android=http://schemas.android.com/apk/res/
 android
     android:orientation=vertical
     android:layout_width=fill_parent
     android:layout_height=fill_parent
     

     ImageView android:id=@+id/imageview
         android:layout_width=wrap_content
         android:layout_height=wrap_content
         android:src=@+drawable/eclipse
     /

 /LinearLayout

 In android:src 'eclipse' is an eclipse.png image.  I also tried
 android:src=@drawable/eclipse with no success --- it won't even
 compile this way.

 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: Notepad tutorial

2009-01-08 Thread Teena
Thanks for the reply Pratap. :)  Yes, my notes_row.xml is in the res 
layout folder.  Is there anything else I could have misplaced?
 

  _  

From: android-beginners@googlegroups.com
[mailto:android-beginn...@googlegroups.com] On Behalf Of PRATAP SOLAPUR
Sent: Wednesday, January 07, 2009 11:02 PM
To: android-beginners@googlegroups.com
Subject: [android-beginners] Re: Notepad tutorial


have you placed the files in proper directoriesnotes_row.xml
must be in under reslayout folder


On 1/8/09, Teena tiny...@earthlink.net wrote: 


Hi all.

I'm following through the notepad tutorial.  I'm in Exercise 1 and in step 5
it says at the end of step 5:
http://code.google.com/android/intro/tutorial-ex1.html

Open the R.java class in the project and look at it, you should see new
definitions for notes_row and text1 (our new definitions) meaning we can now
gain access to these from the our code.

I don't have these new definitions as far as I can tell.  I'm learning the
interface of eclipse at the same time, so I might not be looking in the
right place.  Here is the contents of my R.java:

/* AUTO-GENERATED FILE.  DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found.  It
* should not be modified by hand.
*/

package com.android.demo.notepad1;

public final class R {
   public static final class attr {
   }
   public static final class drawable {
   public static final int icon=0x7f02;
   }
   public static final class layout {
   public static final int notepad_list=0x7f03;
   }
   public static final class string {
   public static final int app_name=0x7f04;
   public static final int no_notes=0x7f040001;
   }
}

I'm looking under Notepadv1  src  com.android.demo.notepad1  R.java in
the Package Explorer.  Can anyone suggest why my new definitions are not
there?







--~--~-~--~~~---~--~~
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] How can I debug this?

2009-01-08 Thread Faber Fedor
I've go tthe following code:

CODE
public void onCreate(Bundle icicle) {
super.onCreate(icicle);

setContentView(R.layout.listlocations);

//set up our ContentProvider
locationsCursor = managedQuery(Provider.Locations.CONTENT_URI,
FIELDS, null, null, null);

locationsCursor.moveToFirst();

ListAdapter adapter = new SimpleCursorAdapter(this,

android.R.layout.simple_list_item_1,
locationsCursor,
new String[] {
Provider.Locations.NAME},
new int[] {R.id.name
});

setListAdapter(adapter);

selection=(TextView)findViewById(R.id.selection);

}
}
/CODE

It appears to be working.  I get what looks like two elements in a list and
I can click on them but I'm not seeing any text in the fields.  My
ContentProvider has two records and I can assign the values to variables, so
I know that's working. I can't figure out where to go from here to make it
work.

Also, to debug this, should I be using DDMS?  Right now I'm using an Eclipse
Debug Configuration becuse I can't see how DDMS can help me.


-- 

Faber Fedor
Cloud Computing New Jersey
http://cloudcomputingnj.com

--~--~-~--~~~---~--~~
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: Post Bitmap over Http

2009-01-08 Thread Raymond Rodgers

mobilek...@googlemail.com wrote:
 Hi,

 I need to send a bitmap to a server. I've written some code, however,
 I got stuck on the part where I need to transform my bitmap into byte
 []. Here is my code:

 public void updateBitmap(Bitmap bm){
   URL url = null;
   HttpURLConnection conn = null;
   try {
   url = new URL(http://www.myurl.com?;);
   } catch (MalformedURLException e) {
   e.printStackTrace();
   }
   try {
   conn = (HttpURLConnection) url.openConnection();
   } catch (IOException e) {
   e.printStackTrace();
   }
   try {
   conn.setRequestMethod(POST);
   } catch (ProtocolException e) {
   e.printStackTrace();
   }
   conn.setDoOutput(true);
   conn.setDoInput(true);
   conn.addRequestProperty(user_id, user.getUsername());
   conn.addRequestProperty(pass, user.getPassword());
   conn.addRequestProperty(id, pinId);

OutputStream os = null;
   try {
   os = conn.getOutputStream();
   } catch (IOException e) {
   e.printStackTrace();
   }

 // Encode bitmap and flush the os

   }

 Could you advice me on how to complete my code? Thank you.
   
I'm going to be tackling the same sort of problem in an app I'm working 
on so I can't give you much advice. BUT, I can tell you that typically 
with HTTP file transfers, you'll want to encode the file into base-64 
format. Unfortunately, for whatever reason, Android does not include 
that capability as far as I know. Oddly, there's a bit of code in the 
Apache Commons/Jakarta project to do that, but it wasn't included in 
Android with the other code borrowed from that project. So what I did is 
download the following files from the Apache site (I grabbed them 
directly out of the source repository browser at 
http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/java/org/apache/commons/codec/
 
) and create new packages within my app's project:

BinaryDecoder.java
BinaryEncoder.java
Decoder.java
DecoderException.java
Encoder.java
EncoderException.java
StringDecoder.java
StringEncoder.java
StringEncoderComparator.java
binary/Base64.java
binary/Base64InputStream.java
binary/Base64OutputStream.java
binary/BinaryCodec.java
binary/Hex.java

I needed to create two packages: org.apache.commons.codec and 
org.apache.commons.codec.binary from those files; it should be easy 
enough to guess which ones go where. :-) From that point, base-64 
encoding or decoding is as simple as including the packages, and 
calling  Base64.encodeString() or Base64.decodeString(). There are 
multiple encoding/decoding functions there to suit your needs.

Raymond

P.S. I'm hoping that Google or some coder will include these classes in 
the Android sources in the future, which would make us using it like 
this unnecessary. Time will tell...

--~--~-~--~~~---~--~~
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 can I debug this?

2009-01-08 Thread Mark Murphy

Faber Fedor wrote:
 So now, I want to double-click on of those fields and edit the record. 
 I assume I want to do that by getting the _id of the record, somehow
 pass that to another Activity, have that Activity open the
 ContentProvider and drop the data into a new layout, right?
 
 Or is there a more 'droidy way to do it?

You call for your personal android, who rolls over, double-clicks on the
field, ... ;-)

You can either go the route you described (using an extra in an Intent
to pass the record _id), or pop a dialog with an EditText, or get fancy
and try to swap out the TextView with an EditText so they can make the
change in-place. I have no idea if the latter approach can work (there
are some hiccups with having focusable items in list elements), but it's
not out of the question.

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

--~--~-~--~~~---~--~~
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: Web App

2009-01-08 Thread Kevin J. Brooks

Jonathan,

Thanks for the help, but I am still stuck.  I am very new at developing
with android.  How to I launch the web browser?

Kevin
On Tue, 2008-12-30 at 13:01 +1100, Jonathan Parker wrote:
 Maybe just call the browser with the URL of the site. Have a look
 at http://code.google.com/android/reference/available-intents.html
 
 On Tue, Dec 30, 2008 at 12:41 PM, Bear34238
 bear123434...@comcast.net wrote:
 
 I have project where the end user has a web application.  He
 wants the
 server to do most of the work, and just wants an android app
 to
 connect.  Can any give some sample code to point me in the
 right
 direction?
 
 
 
  


--~--~-~--~~~---~--~~
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: Audio Processing Options

2009-01-08 Thread Dave Sparks

No, there are no Java API's exposed for this currently.

On Jan 8, 8:06 am, obi mark.cavolow...@gmail.com wrote:
 What options are there currently for analyzing sound files on Android,
 specifically ones from the onboard microphone?  Ideally, I'd like to
 be able to look at the amplitude of the microphone over time and
 possibly perform an FFT.  Do those options currently exist in Android,
 and, if so, where?

 -Obi
--~--~-~--~~~---~--~~
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: Notepad tutorial

2009-01-08 Thread PRATAP SOLAPUR

Are you getting any errors...

On 1/9/09, Teena tiny...@earthlink.net wrote:
 Thanks for the reply Pratap. :)  Yes, my notes_row.xml is in the res 
 layout folder.  Is there anything else I could have misplaced?


   _

 From: android-beginners@googlegroups.com
 [mailto:android-beginn...@googlegroups.com] On Behalf Of PRATAP SOLAPUR
 Sent: Wednesday, January 07, 2009 11:02 PM
 To: android-beginners@googlegroups.com
 Subject: [android-beginners] Re: Notepad tutorial


 have you placed the files in proper directoriesnotes_row.xml
 must be in under reslayout folder


 On 1/8/09, Teena tiny...@earthlink.net wrote:


 Hi all.

 I'm following through the notepad tutorial.  I'm in Exercise 1 and in step 5
 it says at the end of step 5:
 http://code.google.com/android/intro/tutorial-ex1.html

 Open the R.java class in the project and look at it, you should see new
 definitions for notes_row and text1 (our new definitions) meaning we can now
 gain access to these from the our code.

 I don't have these new definitions as far as I can tell.  I'm learning the
 interface of eclipse at the same time, so I might not be looking in the
 right place.  Here is the contents of my R.java:

 /* AUTO-GENERATED FILE.  DO NOT MODIFY.
 *
 * This class was automatically generated by the
 * aapt tool from the resource data it found.  It
 * should not be modified by hand.
 */

 package com.android.demo.notepad1;

 public final class R {
public static final class attr {
}
public static final class drawable {
public static final int icon=0x7f02;
}
public static final class layout {
public static final int notepad_list=0x7f03;
}
public static final class string {
public static final int app_name=0x7f04;
public static final int no_notes=0x7f040001;
}
 }

 I'm looking under Notepadv1  src  com.android.demo.notepad1  R.java in
 the Package Explorer.  Can anyone suggest why my new definitions are not
 there?







 


--~--~-~--~~~---~--~~
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: Removing installed application in Emulator

2009-01-08 Thread PRATAP SOLAPUR

go to command prompt move to tools dir then execute following...

adb uninstall package-name

where package-name is the package name of the application u want to uninstall.

On 1/7/09, Mahesh Vaghela mah...@indianic.com wrote:
 To remove application

 go to command prompt

 go up to your tools directory

 than use this commands:

  adb shell
 cd data
 cd app
 ls

 ls will list all your application installed.

 than..

 rm Your application name along with Package name









 On Wed, Jan 7, 2009 at 4:40 PM, Apparao Mulpuri
 apparao.for...@gmail.comwrote:


 How can we remove the already installed apps from the Emulator?

 Thanks,
 Apparao Mulpuri.

 


 


--~--~-~--~~~---~--~~
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] spinner blues

2009-01-08 Thread madcoder

I have tried putting a spinner in an app, both from books and several
online tutorials, and it keeps locking up.  It seems like my emulator
doesn't like when I set the adapter the the array list.  I even made a
test project just to try the spinner itself, but to no avail.  I'm
doing the same code that others say work, but it doesn't for me.  Any
ideas?

Here's the main XML:

?xml version=1.0 encoding=utf-8?
LinearLayout xmlns:android=http://schemas.android.com/apk/res/
android
android:orientation=vertical
android:layout_width=fill_parent
android:layout_height=fill_parent

TextView
android:id=@+id/test_result
android:layout_width=fill_parent
android:layout_height=wrap_content
android:text=@string/hello
/
Spinner android:id=@+id/spin
android:layout_width=fill_parent
android:layout_height=wrap_content
android:drawSelectorOnTop=true
/
/LinearLayout


...the code:


import java.util.ArrayList;
import java.util.List;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.widget.ArrayAdapter;
import android.widget.Spinner;
import android.widget.TextView;

public class SpinTest extends Activity {

TextView testResult;

private ListString allUnits;
Spinner spin;
ArrayAdapter String adapter;

private String[] units = { Carrier, Battle ship, Cruiser,
Destroyer, Frigate, Submarine, Boomer };

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

testResult = (TextView)findViewById(R.id.test_result);
Log.d(onCreate, testResult id found);

spin =(Spinner)findViewById(R.id.spin);
Log.d(onCreate, spinner id found);

allUnits = new ArrayListString();
for(String s: units ){
allUnits.add(s);
}
Log.d(onCreate, arraylist created);

adapter = new ArrayAdapter String (this,
android.R.layout.simple_spinner_item, allUnits);
Log.d(onCreate,new adapter made);

adapter.setDropDownViewResource
(android.R.layout.simple_spinner_dropdown_item);
Log.d(onCreate, adapter layout set);

spin.setAdapter(adapter);
Log.d(onCreate, spinner adapter set);

setContentView(R.layout.main);
}
}


...and finally, the last portion of the log:


01-09 12:17:15.376: WARN/ActivityThread(176): Application
com.mylib.SpinTest is waiting for the debugger on port 8100...
01-09 12:17:15.384: INFO/System.out(176): Sending WAIT chunk
01-09 12:17:15.427: INFO/dalvikvm(176): Debugger is active
01-09 12:17:15.585: INFO/System.out(176): Debugger has connected
01-09 12:17:15.605: INFO/System.out(176): waiting for debugger to
settle...
01-09 12:17:15.804: INFO/System.out(176): waiting for debugger to
settle...
01-09 12:17:16.004: INFO/System.out(176): waiting for debugger to
settle...
01-09 12:17:16.237: INFO/System.out(176): waiting for debugger to
settle...
01-09 12:17:16.454: INFO/System.out(176): waiting for debugger to
settle...
01-09 12:17:16.495: DEBUG/dalvikvm(52): GC freed 3217 objects / 211888
bytes in 537ms
01-09 12:17:16.654: INFO/System.out(176): waiting for debugger to
settle...
01-09 12:17:16.864: INFO/System.out(176): waiting for debugger to
settle...
01-09 12:17:17.065: INFO/System.out(176): waiting for debugger to
settle...
01-09 12:17:17.125: INFO/ActivityManager(52): Start proc
com.android.alarmclock for broadcast
com.android.alarmclock/.AlarmInitReceiver: pid=186 uid=1 gids={}
01-09 12:17:17.184: INFO/ActivityManager(52): processNextBroadcast:
waiting for ProcessRecord{4348b1b8 186:com.android.alarmclock/1}
01-09 12:17:17.284: INFO/System.out(176): waiting for debugger to
settle...
01-09 12:17:17.335: INFO/jdwp(186): received file descriptor 10 from
ADB
01-09 12:17:17.424: DEBUG/PhoneApp(91): [CallNotifier] onMwiChanged():
false
01-09 12:17:17.444: DEBUG/PhoneApp(91): [CallNotifier] onCfiChanged():
false
01-09 12:17:17.485: INFO/System.out(176): waiting for debugger to
settle...
01-09 12:17:17.684: INFO/System.out(176): waiting for debugger to
settle...
01-09 12:17:17.704: WARN/StkAppInstaller(91): Could not change STK app
state
01-09 12:17:17.754: INFO/ARMAssembler(52): generated
scanline__0077:03515104__ [ 27 ipp] (41 ins) at
[0x227f48:0x227fec] in 3006597 ns
01-09 12:17:17.764: DEBUG/TelephonyProvider(91): Setting numeric
'310260' to be the current operator
01-09 12:17:17.894: INFO/System.out(176): waiting for debugger to
settle...
01-09 12:17:17.974: INFO/ActivityThread(186): Publishing provider
com.android.alarmclock: com.android.alarmclock.AlarmProvider
01-09 12:17:18.094: INFO/System.out(176): waiting for debugger to
settle...
01-09 12:17:18.295: DEBUG/MobileDataStateTracker(52): CONNECTED event
did 

[android-beginners] Re: MediaPlayer Volume Range

2009-01-08 Thread Marc Lester Tan
So should we report that? Any reaction, google employees?

-M


On Fri, Jan 9, 2009 at 11:48 AM, Dave Sparks davidspa...@android.comwrote:


 I took a quick look at the code, and it looks like we're not clamping
 the values. If I'm reading the code correctly - not easy because there
 are a lot of layers between the Java client and the audio output - it
 looks like some nasty wrapping effects will occur if you use values
 higher than 1.0. I would consider that a bug in the code.

 I suggest sticking to values between 0 and 1.

 On Jan 8, 3:41 am, Marc Lester Tan mail...@gmail.com wrote:
  Thanks Dave. Although when I tried putting 100 in the setVolume method
 
  clickSound.setVolume(100, 100);
 
  The volume level in the emulator seems to be louder when compared to 1.0.
  Any idea?
 
  -Marc
 
  On Thu, Jan 8, 2009 at 10:39 AM, Dave Sparks davidspa...@android.com
 wrote:
 
 
 
   The range is 0 to 1. You can use any increment you want to create a
   logarithmic volume scale, just make full volume 1.0. Multiply be a
   scalar less than 1.0 to get the next lower volume. Multiply that
   volume by the same scalar to get the next one. Repeat until you have
   enough values.
 
   The number you choose for your multiplier will vary according to
   purpose. For example, the Android music volume control is much finer
   grained (32 steps?) than the notification volume control (8 steps?).
   To get a smooth fade, you probably want to use 1dB or less (1dB =
   ~0.89).
 
   On Jan 7, 3:04 am, Marc Lester Tan mail...@gmail.com wrote:
Hi folks,
 
I just want to ask if somebody knows the usable range for the
   MediaPLayer's
volume levels? The doc just says it is a raw scalar and the UI should
   scale
logarithmically. An example would be helpful.
 
Thanks in advance.
 
-Marc
 


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