[android-beginners] Any MediaPlayer success?

2008-10-15 Thread David Farler
Has anyone had any success with the MediaPlayer class? I haven't been able
to play a single 3gp file. I've also tried a few MPEG-4 files. I've
downloaded maybe 30+ random small files from the internet. They play fine in
PC players (I'm testing with VLC) but no luck on the emulator. I've tried
files as small as a few kb up to 5MB.

Is there a place to find out the expected file structures for MediaPlayer?

Also, does anyone have any video files recorded with MediaRecorder on an
actual G1? I'd like to examine the recorded file structure in detail with a
hex editor. Thanks!

David

--~--~-~--~~~---~--~~
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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: Prevent uninstallation of application in Android

2008-10-05 Thread David Farler
Even if this were possible -- and I don't think it is -- can you give one
good reason why a user should let you do this?


On Sun, Oct 5, 2008 at 8:15 AM, denismo [EMAIL PROTECTED] wrote:


 Hello,

 I've got an unusual requirement - I need to PREVENT users from
 uninstalling my application from their Android platform (not emulator
 but the future devices). Is there an official way for doing this? An
 unofficial?

 If that's not possible exactly, perhaps it may be possible to:
 - remove/hide the application from the installed applications list
 - abort uninstallation by throwing an error from some standard class
 - prevent uninstallation of only some types/configurations of
 applications?
 - automatically force reinstall of uninstalled application?
 - invoke some class in the application before being uninstalled so
 that it can send SMS/access a web site to notify someone about this?

 Thanks.

 Denis

 


--~--~-~--~~~---~--~~
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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: Using the Log class

2008-10-03 Thread David Farler
Zach,
If you are stepping through your program and it crashes, then it has crashed
on the line you are on. Or, you can just debug, let run to crash, and read
the call stack. Look at the top of the stack. This is where it crashed. If
it's not your code, then check for layout/xml problems.

Check out Eclipse's excellent debugger tutorials (videos included!)
http://eclipsetutorial.sourceforge.net/debugger01/lesson01.html

Other Eclipse debugger tutorials (7 in all)
http://sourceforge.net/project/showfiles.php?group_id=200662package_id=251688

I highly recommend you learn to use the debugger frontward and backward. It
will save you a lot of time and headache.

David




On Fri, Oct 3, 2008 at 2:42 AM, Zachary Becker [EMAIL PROTECTED] wrote:

 Wow I am awake now, I spent 20 minutes trying to figure that out and it
 isn't even in a function. Ok time for bed.


 On Thu, Oct 2, 2008 at 11:41 PM, Zachary Becker [EMAIL PROTECTED] wrote:

 I am trying to debug this activity. And so far I have tried to avoid using
 the debugger features in Eclipse because I can't figure out how they work. I
 can step through my activity untill it crashes but it doesn't tell me what
 line of code is causing the error or anything. So, I was going to try
 sending messages to the Log thingy that is there when you are debugging.

 From what I gather you do that using Log class.

 Such as Log.d(myApp, my message);

 But when I use that Eclipse tells me I have a syntax error.

 It is getting late so I might just be tired and totally missing something.
 But I figured id ask if anyone could help.

 Here is a screeny of the message.

 http://zrbecker.com/error.jpg

 Thanks in advanced.



 


--~--~-~--~~~---~--~~
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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: With no previous programming knowledge / experience, how do I get started creating an app?

2008-10-01 Thread David Farler
The Eclipse plugin can be bypassed, if you really wanted to. But I wouldn't
recommend it. As an IDE (Integrated Development Environment), Eclipse
manages your projects for you in many ways. To forgo it would mean using the
command line for everything.The SDK is completely independent of the Plugin.
Make no mistake, you are actually typing Java in there. It is being compiled
as Java with the installed Java JDK. The SDK tools then convert it to
Dalvik. The plugin makes it pretty and easy for you. See the tools folder
in the android sdk folder -- this is all being accessed by Eclipse through
the Android Development Tools (ADT) Plugin.

Actually, when you become more experienced, you may short-cut right to the
command line for things like debugging. But, I find the Eclipse debugger to
be quite nice.

Finally, I quote Google on Installing the SDK:
If you will be using the Eclipse IDE as your environment for developing
Android applications, you can install a custom plugin called Android
Development Tools (ADT), which adds integrated support for Android projects
and tools. The ADT plugin includes a variety of powerful extensions that
make creating, running, and debugging Android applications faster and
easier.
(http://code.google.com/android/intro/installing.html)http://code.google.com/android/intro/installing.html


David





On Wed, Oct 1, 2008 at 12:24 AM, Morisato13 [EMAIL PROTECTED] wrote:


 I'm sorry, but what exactly does the eclipse plugin do? There's a
 tidbit about it in the FAQs stating that it makes creating apps for
 Android easier, but what does it actually do that makes it easier? Is
 it the conversion tool that converts Java to Dalvik? Is it a GUI that
 does coding in Java without actually typing out Java code (kind of
 like VB where you have windows and such and you move them around and
 set value having it do the real coding behind the scenes)? Or is it
 something completely different?

 On Sep 30, 9:38 am, David Farler [EMAIL PROTECTED] wrote:
  You are correct. First, your files are compiled as true java class files.
  The Java bytecode gets converted to the dex format by the dx utility.
 So,
  while it's not technically Java at the end, all of the rules of
  programming java should apply. This is why using Eclipse is such a huge
  plus. It's Java language integration is very good.
  If you want to get on a Java forum, you can try Sun's Java forum:
 
  Java Beginners:http://forums.sun.com/forum.jspa?forumID=54
 
  Java Programming in General:http://forums.sun.com/forum.jspa?forumID=31
 
  Cheers,
  David
 
  On Tue, Sep 30, 2008 at 3:50 AM, Morisato13 [EMAIL PROTECTED]
 wrote:
 
   Thanks. I'm reading #4 right now.
 
   Now I was watching the featured video on the andriod home page with
   Jason Chen, and one of the questions in the QA section of the video
   made Jason clarify that Android is not Java, applications are written
   in Java programming language, but Android is Dalvic bicode... now,
   with that said, is there anything that I would learn while learning
   Java that does not or can not be applied to programming applications
   for Android? I'm guessing no because from my guess, what happens is
   you code in Java and it gets baked into whatever Dalvic bicode is for
   android to recognize it... but I just want someone who knows to
   answer.
 
   Also, are there any forums that specifically help noobs with noob java/
   programming questions? I'd ask them here but it seems this forum is
   really for Android related questions.
 
   On Sep 29, 3:52 am, David Farler [EMAIL PROTECTED] wrote:
Hi Morisato,
Since you'll be programming in Java for Android, I recommend you
 start
practicing with it. Java is a good place to start in many cases.
 Check
   out
the following books from your library or college library:
 
1. Absolute Java by Walter Savitch (3rd edition)
2. Java Foundations: Introduction to Program Design and Data
 Structures
   by
John Lewis
3. Also check out this free online course offered by MIT (you don't
 have
   to
register):
Introduction to Computer Science and Programming
  http://ocw.mit.edu/OcwWeb/Electrical-Engineering-and-Computer-Science.
 ..
4. A free online book: Thinking in Java by Bruce Eckel:
  http://www.mindview.net/Books/TIJ/
5. And don't forget the official Java API:
  http://java.sun.com/javase/6/docs/api/
 
All of these resources should get you started. Remember that
 programming
   is
more than just memorization. Try to use first principles by
 understanding
how a computer (or virtual machine in this case) is doing its job.
 Once
   you
understand the core of it, you can program in any language.
 
All of the suggestions above assume no previous knowledge (except
 number
   5,
but take a look at it anyway). Don't get discouraged. Programming can
 be
hard, but remember that sometimes people make it hard because they
 don't
remember what it's like to be a beginner. You should

[android-beginners] Re: Preferences Error

2008-09-30 Thread David Farler
That sounds like a problem with eclipse. Did you install from repositories?
I recommend upgrading to Eclipse 3.4 Ganymede directly from the
eclipse.orgwebsite. Just keep the extracted eclipse folder wherever is
convenient for
you. Also, apt-get remove your current eclipse installation before starting
any serious work. Your Java JDK should be sufficient.
Follow these instructions for installation with 3.4 and you should be good
to go. I have tested on vanilla Hardy.
http://code.google.com/android/intro/installing.html

Best,
David



On Tue, Sep 30, 2008 at 1:04 AM, nzkronic [EMAIL PROTECTED] wrote:


 Hi all,

 I get the following error when opening the android section of the
 elcipse preferences window.

 Unable to create the selected preference page.

 org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter
 $TerminatingClassNotFoundException

 Details

 Unable to create the selected preference page.
 An error has occured while automatically activating bundle
 com.android.ide.eclipse.adt (581)


 Any help here is appreciated.
 Using Ubuntu 8.04
 JDK = java-6-sun-1.6.0.06
 Eclipse 3.41


 


--~--~-~--~~~---~--~~
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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: Help creating .bash_profile (Mac)

2008-09-30 Thread David Farler
Hi Nathan,
First of all, adding the tools folder to the path is optional. It will just
allow you to run the command-line tools in that folder without having to
cd there.

Files that start with a . are hidden in Unix and Linux based operating
systems.

Bash is the shell that is used by many Unix and Linux distributions,
including Mac OS X. I recommend you read:

Using the OS X Leopard Command Line (
http://www.informit.com/articles/article.aspx?p=1144082seqNum=1)
http://www.informit.com/articles/article.aspx?p=1144082seqNum=1
and

Bash By Example
(http://www.ibm.com/developerworks/library/l-bash.html)
http://www.ibm.com/developerworks/library/l-bash.html

and get comfortable working with it. It will greatly enhance your powers.
(And who doesn't want their power enhanced?)  Also, you may want to do some
googling for bash tutorials in Mac OS X in general.

Unless you have a customized Finder, you will need to open the Terminal
application in Applications/Utilities. You probably won't be able to see
dot-files in the Finder. Once you have Terminal running, you'll have a
'bash' command line at your home folder I think. Once there,

ls -a

And see if there is a .bash_profile in your home folder. If there isn't:

touch .bash_profile

This will create a blank file if there is none. Then,

open -e .bash_profile

This will open it in TextEdit. Add the following line:

export PATH=${PATH}:*your_sdk_dir*/tools

Where your_sdk_dir is the full path to the android sdk folder (type
carefully, removebrackets).

For example, if the android folder is in the eclipse folder on your Desktop,
it would be:

export PATH=${PATH}:/Users/David/Desktop/eclipse/
android-sdk-mac_x86-1.0_r1/tools

Save and quit.

When you are ready to continue installing the android SDK, keep reading:
http://code.google.com/android/intro/installing.html

Cheers and may your powers be enhanced greatly,
David



On Mon, Sep 29, 2008 at 10:57 PM, nathan [EMAIL PROTECTED] wrote:


 Hello Android Beginners group,

 I would like to try and develop simple apps for android but I am
 unfamiliar with terminal on macs (or any other shell system) I only
 know simple commands like cd, ls and mkdir. Could someone please help
 me with the command lines that I need to use to create a bash profile
 like the installation guide @ code.google.com/android recommends I do?

 


--~--~-~--~~~---~--~~
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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: Background Image for a (semi-transparent) List

2008-09-29 Thread David Farler
Hi Sascha,
I'm not an expert yet at this, but I did look into your problem. Perhaps you
are forgetting to use the ListActivity's own ListView? Code below should
work.


package com.android.hello;

import android.app.ListActivity;
import android.os.Bundle;
import android.widget.ArrayAdapter;

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

   String[] someStringArrayThatShouldWork = {Test1, Test2, Test3};

   ArrayAdapterString aAdapter = new ArrayAdapterString(this,
android.R.layout.simple_list_item_1, someStringArrayThatShouldWork);
   getListView().setAdapter(aAdapter);
   }
}



Hope this helps,
David






On Mon, Sep 29, 2008 at 11:09 AM, [EMAIL PROTECTED] 
[EMAIL PROTECTED] wrote:


 Hi fellows,

 first of all, please don't hit me for asking stupid question. :) I'm
 quite a novice when it comes to Java (J2EE, J2ME, J2SE), but I'm a
 totally n00b when it comes to android. The tutorials are very helpful
 although I needed several tries to get a ListActivity working (using a
 ListAdapter)... my approach to just display an array of Strings didn't
 work... That should have been the easiest solution, since I have a
 fixed number of items to display in the list...

 This is what I did:

 private String[] someStringArrayThatShouldWork = {Test1, Test2};

 in the onCreate method:

 setListAdapter(new ArrayAdapterString(this,
android.R.layout.simple_list_item_1,
 someStringArrayThatShouldWork));
 getListView().setTextFilterEnabled(true);

 I received an exception whenever I wanted to start the app. Is there
 anything else I need? That exception was something like need ID for
 TextView or something...

 But basically I'd like to have something like that:

 A list, which is semi-transparent printed on a background image! That
 background image should change when ever the device is rotated to it's
 widescreen outfit. You should see the background image and also the
 list entrie about it. (65% opacity)

 Can someone give me some hints where to start... I've already checked
 the API demos... But I didn't even get the simple List (String Array
 example) to work... :)

 Regards and thank you very much in advance,

 Sascha

 


--~--~-~--~~~---~--~~
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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: Background Image for a (semi-transparent) List

2008-09-29 Thread David Farler
Actually, Zach, I pasted everything you sent me and I also got your No
Items! message. The problem is with your row.xml.
Try this:

row.xml:
TextView xmlns:android=http://schemas.android.com/apk/res/android;
android:id=@android:id/text1 android:paddingTop=2dip
 android:paddingBottom=3dip android:layout_width=fill_parent
android:layout_height=wrap_content /
:

This is similar to Android's simple_list_item_1 layout.
Then, remove the line:

setContentView(R.layout.main);

The content view is already being set when connecting this class to the
ArrayAdapter. Resetting it to main will make it blank.

Hope this helps,
David




On Mon, Sep 29, 2008 at 3:43 PM, Zachary Becker [EMAIL PROTECTED] wrote:

 I am having a similar issue.

 I tried you suggestion but my list just shows up empty.

 I think my problem might be in my XML.


 Here is my code

 simplelist.java
 ===
 package zach.test.simplelist;

 import android.app.ListActivity;
 import android.os.Bundle;
 import android.widget.ArrayAdapter;

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

 String[] StringArray = { Hello, World!, Foo Bar, Blah Blah
 Blah };
 ArrayAdapterString StringAdapter = new ArrayAdapterString(this,
 R.layout.row, StringArray);
 // setListAdapter(StringAdapter);// crashes program on startup
 getListView().setAdapter(StringAdapter);// program starts fine,
 but list shows empty

 setContentView(R.layout.main);
 }
 }

 main.xml
 ===
 ?xml version=1.0 encoding=utf-8?
 LinearLayout xmlns:android=http://schemas.android.com/apk/res/android;
   android:layout_width=wrap_content
   android:layout_height=wrap_content
 ListView android:id=@+id/android:list
   android:layout_width=wrap_content
   android:layout_height=wrap_content /
 TextView android:id=@+id/android:empty
   android:layout_width=wrap_content
   android:layout_height=wrap_content
   android:text=No Items! /
 /LinearLayout

 row.xml
 =
 ?xml version=1.0 encoding=utf-8?
 TextView xmlns:android=http://schemes.android.com/apk/res/android;
   android:id=@+id/text1
   android:layout_width=wrap_content
   android:layout_height=wrap_content /


 On Mon, Sep 29, 2008 at 11:12 AM, David Farler [EMAIL PROTECTED] wrote:

 Hi Sascha,
 I'm not an expert yet at this, but I did look into your problem. Perhaps
 you are forgetting to use the ListActivity's own ListView? Code below should
 work.


 package com.android.hello;

 import android.app.ListActivity;
 import android.os.Bundle;
 import android.widget.ArrayAdapter;

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

String[] someStringArrayThatShouldWork = {Test1, Test2,
 Test3};

ArrayAdapterString aAdapter = new ArrayAdapterString(this,
 android.R.layout.simple_list_item_1, someStringArrayThatShouldWork);
getListView().setAdapter(aAdapter);
}
 }



 Hope this helps,
 David






 On Mon, Sep 29, 2008 at 11:09 AM, [EMAIL PROTECTED] 
 [EMAIL PROTECTED] wrote:


 Hi fellows,

 first of all, please don't hit me for asking stupid question. :) I'm
 quite a novice when it comes to Java (J2EE, J2ME, J2SE), but I'm a
 totally n00b when it comes to android. The tutorials are very helpful
 although I needed several tries to get a ListActivity working (using a
 ListAdapter)... my approach to just display an array of Strings didn't
 work... That should have been the easiest solution, since I have a
 fixed number of items to display in the list...

 This is what I did:

 private String[] someStringArrayThatShouldWork = {Test1, Test2};

 in the onCreate method:

 setListAdapter(new ArrayAdapterString(this,
android.R.layout.simple_list_item_1,
 someStringArrayThatShouldWork));
 getListView().setTextFilterEnabled(true);

 I received an exception whenever I wanted to start the app. Is there
 anything else I need? That exception was something like need ID for
 TextView or something...

 But basically I'd like to have something like that:

 A list, which is semi-transparent printed on a background image! That
 background image should change when ever the device is rotated to it's
 widescreen outfit. You should see the background image and also the
 list entrie about it. (65% opacity)

 Can someone give me some hints where to start... I've already checked
 the API demos... But I didn't even get the simple List (String Array
 example) to work... :)

 Regards and thank you very much in advance,

 Sascha

[android-beginners] Re: For the REAL beginners!

2008-09-29 Thread David Farler
Eclipse, my friend. Eclipse.
http://code.google.com/android/intro/installing.html

On Mon, Sep 29, 2008 at 9:32 PM, tedpants [EMAIL PROTECTED] wrote:


 I'm planning on programming very simple Android programs on my laptop
 during free time.  Does anybody have the best solution for what IDE I
 should be using to make it easy and inexpensive?  I've downloaded
 Jbuilder and JDK 6 and the Android SDK but am having trouble setting
 up all the command line instructions and integration.  Is there a
 simpler way?

 


--~--~-~--~~~---~--~~
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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---