Re: [android-beginners] OutputStream on assets file

2010-07-28 Thread Mark Murphy
On Thu, Jul 29, 2010 at 12:15 AM, Bret Foreman  wrote:
> What happens if I open an OutputStream on a file in the assets folder?

It creates a rupture in the space-time continuum, exterminating all
life except for tax collectors (who are invincible).

Or, possibly, it just crashes, because assets are not modifiable.

Pick your poison.

:-)

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

_Android Programming Tutorials_ Version 2.9 Available!

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


[android-beginners] Map Key

2010-07-28 Thread NBS
Hi all,

I am trying to upload a simple map application or market.
But I am not sure about the map key.
Now I am using a generated map key on my system to work.
But I dont know what this value will be if I have to upload to the market.

Thanking you.
Regards
Bhaban

-- 
Bhaban Nongmaithem (바반)
Zenitum Inc.

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


[android-beginners] OutputStream on assets file

2010-07-28 Thread Bret Foreman
What happens if I open an OutputStream on a file in the assets folder?
Can I write over it? What happens to the file size if I write less
data than the original size?

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


[android-beginners] ContentProvider failing on insert

2010-07-28 Thread martinmike2
Hello, what i cam trying to do is this:

1. Check for db on startup (no problem)
2. If no db, create one (no problem)
3. input some data into the db (problem)
4. save the db (not there yet)


The exception is being thrown when i call cp.insert

I have stepped through the code line by line and the line that throws
the exception, every time, is:

SQLiteDatabase db = mOpenHelper.getWritableDatabase();

in the insert override.

I'm not sure why this is throwing an exception, seems like a pretty
normal call to me.


Here is my Code:


MainWindow.java

package com.vortex.rules;

import com.vortex.rules.Rule.Rules;
import android.app.Activity;
import android.net.Uri;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.content.ContentProvider;
import android.content.ContentResolver;
import android.content.ContentValues;
import android.database.Cursor;


public class MainWindow extends Activity {

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

/**
 * Check for DB, if none, d/l from web server (playing with
idea)
 */
Uri first_use = Rules.CONTENT_URI;
ContentResolver cr = getContentResolver();
Cursor c = cr.query(first_use, null, null, null, null);
if(c == null){
ContentProvider cp = new CoreRulesProvider();
if (cp.onCreate()) {
ContentValues values = new ContentValues();
values.put(Rules._ID, 1);
values.put(Rules.TERM, "Player");
values.put(Rules.TEXT, "You, the person reading these 
rules,
are a Player.");
cp.insert(Rules.CONTENT_URI, values);
}
}



RulesContentProvided.java

package com.vortex.rules;


import android.content.ContentProvider;
import android.content.ContentUris;
import android.content.ContentValues;
import android.content.Context;
import android.content.UriMatcher;
import android.content.res.Resources;
import android.database.Cursor;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.database.sqlite.SQLiteQueryBuilder;
import android.net.Uri;
import android.text.TextUtils;
import android.util.Log;

import java.util.HashMap;

import com.vortex.rules.Rule.Rules;

/**
 * Provides access to a database of rules.  Each rule has a TERM, the
RULE itself, and a creation date and modified data.
 * @author Michael Martin
 *
 */

public class CoreRulesProvider extends ContentProvider {

private static final String TAG = "CoreRulesProvider";

private static final String DATABASE_NAME = "core_rules.db";
private static final int DATABASE_VERSION = 2;
private static final String RULES_TABLE_NAME = "rules";

private static HashMap sRulesProjectionMap;
private static HashMap sLiveFolderProjectionMap;

private static final int RULES = 1;
private static final int RULE_ID = 2;
private static final int LIVE_FOLDER_RULES = 3;

private static final UriMatcher sUriMatcher;

/**
 * This class helps open, create, and upgrade the database file.
 */
private static class DatabaseHelper extends SQLiteOpenHelper {

DatabaseHelper(Context context) {
super(context, DATABASE_NAME, null, DATABASE_VERSION);
}

@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL("CREATE TABLE " + RULES_TABLE_NAME + " ("
+ Rules._ID + " INTEGER PRIMARY KEY,"
+ Rules.TERM + " TEXT,"
+ Rules.TEXT + " LONGTEXT"
+ ");");
}

@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int
newVersion) {
Log.w(TAG, "Upgrading database from version " + 
oldVersion + " to "
+newVersion + ", which will destroy all 
old data");
db.execSQL("DROP TABLE IF EXISTS rules");
onCreate(db);
}
}
/**
 * END OF DatabaseHelper CLASS!
 */

private DatabaseHelper mOpenHelper;

@Override
publ

Re: [android-beginners] Google Image on Google map

2010-07-28 Thread Mark Murphy
2010/7/28 NBS :
> The problem is it shows as blank space. Instead of drawing anything.
> Please have a look to the attached Image file.

Android is having difficulty loading that tile for some reason. It
should not be a problem in your code. With luck, the map server will
respond properly for that tile sometime in the future.

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

_Android Programming Tutorials_ Version 2.9 Available!

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


[android-beginners] Re: How can my app let people pick a picture that I use as background in my app?

2010-07-28 Thread cellurl
Can you elaborate a bit please? Intent covers so much material.
Thank you very much!
Jim


On Jul 25, 10:36 am, Paul Turchenko  wrote:
> Use intent to pick a picture and start activity for result
>
> On Jul 24, 10:47 pm, cellurl  wrote:
>
> > How do I launch some external application to show phone pictures and
> > let users pick one?
>
> > The picture will serve as a background in my app.
> > So all in all, I just need their selection. e.g. the path/name once
> > they have chosen it.
>
> > Something simple would be nice ;-)
>
> > thanks
> > jim

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


Re: [android-beginners] Problems using AlertDialog in a onReceive() method

2010-07-28 Thread Mark Murphy
On Wed, Jul 28, 2010 at 8:26 PM, Brad Taylor  wrote:
> Would I create a whole new
> Activity class that creates the AlertDialog.

No, you would create a whole new Activity class that displays what you
want to display. If you want it to look like an AlertDialog, add the
following attribute to your  element in the manifest:

android:theme="@android:style/Theme.Dialog"

http://developer.android.com/guide/topics/ui/themes.html#ApplyATheme

> Then in my receiver class call the startActivity()?

Yes.

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

_Android Programming Tutorials_ Version 2.9 Available!

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


Re: [android-beginners] Problems using AlertDialog in a onReceive() method

2010-07-28 Thread Brad Taylor
Thanks for the quick reply Mark. I am unsure what you mean by using a
dialog-themed Activity and startActivity(). I have added a Alarm in my mainclass

// Schedule the alarm!

AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);

if (isOn) {

// Set alarm

am.setRepeating(AlarmManager.RTC_WAKEUP,
pickedDateAndTime.getTimeInMillis(), 6, sender);

} else {

// Cancel alarm

am.cancel(sender);

Toast.makeText(AlarmClock.this, "Alarm cancelled",

Toast.LENGTH_LONG).show();

}


Then in my Manifest I added my Reciever Class in like this





Then I have the Receiver Code below. I am unsure how to go about adding a
dialog-themed Activity and startActivity. Would I create a whole new
Activity class that creates the AlertDialog. Then in my receiver class call
the startActivity()?


Once again thanks!


--Brad



On Wed, Jul 28, 2010 at 4:39 PM, Mark Murphy wrote:

> On Wed, Jul 28, 2010 at 7:24 PM, Brad Taylor  wrote:
> > I new to the SDK and have intermediate Java skills and I am having an
> issue
> > with adding an AlertDialog to a Receiver I have created.
>
> Try using a dialog-themed Activity and startActivity() instead.
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com | http://github.com/commonsguy
> http://commonsware.com/blog | http://twitter.com/commonsguy
>
> _Android Programming Tutorials_ Version 2.9 Available!
>
> --
> 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
>

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


Re: [android-beginners] Problems using AlertDialog in a onReceive() method

2010-07-28 Thread Mark Murphy
On Wed, Jul 28, 2010 at 7:24 PM, Brad Taylor  wrote:
> I new to the SDK and have intermediate Java skills and I am having an issue
> with adding an AlertDialog to a Receiver I have created.

Try using a dialog-themed Activity and startActivity() instead.

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

_Android Programming Tutorials_ Version 2.9 Available!

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


[android-beginners] Problems using AlertDialog in a onReceive() method

2010-07-28 Thread Brad Taylor
Hello Everyone,

I new to the SDK and have intermediate Java skills and I am having an issue
with adding an AlertDialog to a Receiver I have created. The application is
a basic alarm clock and I am using the following code as the receiving
class. I want to use an AlertDialog instead of Toast so that I can have a
snooze and an off button. It seems to be creating the AlertBox fine but when
I try to show it the program blows up. Below is the code I am trying to use,
any help is much appreciated!

Thanks,
Brad

public class RepeatingAlarm extends BroadcastReceiver {


 @Override

public void onReceive(Context context, Intent intent) {

try {

// Do something when alarm goes off

AlertDialog.Builder alertbox = new AlertDialog.Builder(context);

alertbox.setMessage("Its time to get up");

// add a neutral button to the alert box and assign a click listener

alertbox.setNeutralButton("Ok",

new DialogInterface.OnClickListener() {


 // click listener on the alert box

public void onClick(DialogInterface arg0, int arg1) {

// the button was clicked do something


 }

});


 alertbox.show();


 } catch (Exception e) {

Log.e("AlarmClock.java", "ERROR: ", e);

}


 MediaPlayer mp = MediaPlayer.create(context, R.raw.duck);

mp.start();


 }


}

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


Re: [android-beginners] Directory names

2010-07-28 Thread Mark Murphy
On Wed, Jul 28, 2010 at 11:39 AM, kypriakos  wrote:
> I have been experimenting with the file system that the emulator
> presents and I noticed that although I can create files with 'normal'
> names (ex. test, src), I don't seem to be able to create dotted
> names, such as .test, .src. Is there a restriction on dir names
> (other than the common rules that apply on most OSs)?

You can create them. You can't see them. Directories with leading
periods are normally suppressed from directory listings. This has been
standard Linux behavior for a very long time.

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

_Android Programming Tutorials_ Version 2.9 Available!

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


[android-beginners] Re: Contents of dex

2010-07-28 Thread fadden
On Jul 27, 9:03 pm, Mark Murphy  wrote:
> On Tue, Jul 27, 2010 at 11:50 PM, kypriakos  wrote:
> > is there a way to view what is enclosed (file list) in the dex file?
>
> http://dedexer.sourceforge.net/

Also "dexdump" (which comes installed on development devices) and
http://code.google.com/p/smali/ .

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


[android-beginners] Re: [Q] Make the activity blur/dim with startActivityForResult?

2010-07-28 Thread CyanBlue
I've searched/waited quite a few days already and felt I should really
give up...  So, a few more days won't kill me...  :)

Oh, FYI, the above code works great on the Dialog...  It just does not
work with the activity...

Appreciate your help, Justin...

CyanBlue

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


Re: [android-beginners] Re: The content of the adapter has changed but ListView did not receive a notification

2010-07-28 Thread Justin Anderson
No problem.  Glad you got it solved!

--
There are only 10 types of people in the world...
Those who know binary and those who don't.
--


On Wed, Jul 28, 2010 at 2:02 PM, nimusi  wrote:

> Thanks, Justin, that has solved the problem.
>
> On 27 July, 22:00, Justin Anderson  wrote:
> > Use startActivityForResult instead of startActivity.  Then when you get
> back
> > to the listView you can add the item and update there.  There are some
> very
> > specific things you need to do to get startActivityForResult to work
> > properly and return the stuff you want to return to the main activity, so
> > you may want to search StackOverflow and this group for
> > startActivityForResult...
> >
> > Hope that helps,
> > Justin
> >
> > --
> > There are only 10 types of people in the world...
> > Those who know binary and those who don't.
> > --
> >
> >
> >
> > On Tue, Jul 27, 2010 at 2:35 PM, nimusi  wrote:
> > > I have an app in which the main activity is a listview.  Clicking on
> > > an item in the list item opens a new activity which is a detail view
> > > of that item.  The detail view has navigate buttons which traverse
> > > through the list displaying details for the currently selected item.
> > > This is working as expected.
> >
> > > Users need to be able to add, edit and delete items.  In the main
> > > activity I have an 'Add Item' menu item which allows the user to add
> > > an item.  The detail view has an 'Add Item' button.
> >
> > > I thought I would be able to reuse the code for both cases by opening
> > > a dialog in a helper class which accepts a new item and updates the
> > > list view (and also the detail view if that was where it was called
> > > from).  This is raising an Exception 'The content of the adapter has
> > > changed but ListView did not receive a notification'.
> >
> > > Having googled this I am told that I cannot update the UI thread in a
> > > sub-thread.  Does this mean that I have to replicate the add item code
> > > in each activity? Or am I going about this in the wrong way and I
> > > should be doing something else.
> >
> > > NiMuSi
> > >http://www.nimusi.net/blog
> >
> > > --
> > > 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- Hide quoted
> text -
> >
> > - Show quoted text -
>
> --
> 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
>

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


[android-beginners] Re: The content of the adapter has changed but ListView did not receive a notification

2010-07-28 Thread nimusi
Thanks, Justin, that has solved the problem.

On 27 July, 22:00, Justin Anderson  wrote:
> Use startActivityForResult instead of startActivity.  Then when you get back
> to the listView you can add the item and update there.  There are some very
> specific things you need to do to get startActivityForResult to work
> properly and return the stuff you want to return to the main activity, so
> you may want to search StackOverflow and this group for
> startActivityForResult...
>
> Hope that helps,
> Justin
>
> --
> There are only 10 types of people in the world...
> Those who know binary and those who don't.
> --
>
>
>
> On Tue, Jul 27, 2010 at 2:35 PM, nimusi  wrote:
> > I have an app in which the main activity is a listview.  Clicking on
> > an item in the list item opens a new activity which is a detail view
> > of that item.  The detail view has navigate buttons which traverse
> > through the list displaying details for the currently selected item.
> > This is working as expected.
>
> > Users need to be able to add, edit and delete items.  In the main
> > activity I have an 'Add Item' menu item which allows the user to add
> > an item.  The detail view has an 'Add Item' button.
>
> > I thought I would be able to reuse the code for both cases by opening
> > a dialog in a helper class which accepts a new item and updates the
> > list view (and also the detail view if that was where it was called
> > from).  This is raising an Exception 'The content of the adapter has
> > changed but ListView did not receive a notification'.
>
> > Having googled this I am told that I cannot update the UI thread in a
> > sub-thread.  Does this mean that I have to replicate the add item code
> > in each activity? Or am I going about this in the wrong way and I
> > should be doing something else.
>
> > NiMuSi
> >http://www.nimusi.net/blog
>
> > --
> > 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- Hide quoted text -
>
> - Show quoted text -

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


[android-beginners] My column '_id' does not exist?

2010-07-28 Thread Mitch
I'm having trouble with something that works in the Notepad example.
Here's the code from the NotepadCodeLab/Notepadv1Solution:

String[] from = new String[] { NotesDbAdapter.KEY_TITLE };
int[] to = new int[] { R.id.text1 };

SimpleCursorAdapter notes = new SimpleCursorAdapter(this,
R.layout.notes_row, c, from, to);

This code seems to work fine.  But just to be clear, I ran the adb
utility and run sqlite3 I inspected the schema as follows:

sqlite> .schema
CREATE TABLE android_metadata (locale TEXT);
CREATE TABLE notes (_id integer primary key autoincrement, title text
not null, body text not null);

All seems good to me.


-
Now on to My App, which as far as I can see is basically the same with
a few minor changes.  I've simplified and simplified my code, but the
problem persists.

String[] from = new String[] { "x" };
int[] to = new int[] { R.id.x };

SimpleCursorAdapter adapter = null;
try
{
adapter = new SimpleCursorAdapter(this, R.layout.circle_row,
cursor, from, to);
}
catch (RuntimeException e)
{
Log.e("Circle", e.toString(), e);
}

When I run my app, I get a RuntimeException and the following prints
in LogCat from my Log.e() statement:

LogCat Message:
java.lang.IllegalArgumentException: column '_id' does not exist

So, back to sqlite3 to see what's different about my schema:

sqlite> .schema
CREATE TABLE android_metadata (locale TEXT);
CREATE TABLE circles (_id integer primary key autoincrement, sequence
integer, radius real, x real, y real);

I don't see how I'm missing the '_id'.

Can anyone point out what I've done wrong?

One thing that's different between my app and the Notepad example is
that I started by creating my application from scratch using the
Eclipse wizard while the sample app comes already put together.  Is
there some sort of environmental change I need to make for a new app
to use a sqlite database?

Hopefully this is easy to spot by someone that's not a newbie like
me.  Thanks.

Mitch

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


[android-beginners] Media Recorder Error codes

2010-07-28 Thread Carlos Junior
Hi everybody, I'd like to know the meaning of error's code in
MediaRecorder. Sometimes the application launch a 802 or 803 number
error, I did not see the meaning of this number in the API of this
class. Only this codes are included on API:

public static final int MEDIA_RECORDER_INFO_UNKNOWN = 1;

public static final int MEDIA_RECORDER_INFO_MAX_DURATION_REACHED =
800;

public static final int MEDIA_RECORDER_INFO_MAX_FILESIZE_REACHED =
801;

What's the meaning of a 802 or 803 error? This codes were caught in
onInfo method:

public void onInfo(MediaRecorder mr, int what, int extra) {};



Att,
Carlos Maciel.

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


Re: [android-beginners] Re: Loading images in android

2010-07-28 Thread Justin Anderson
And I would probably do a little reading to better understand the Android
platform...
http://developer.android.com/guide/index.html
http://developer.android.com/resources/faq/commontasks.html
http://developer.android.com/resources/faq/framework.html

Read everything above... it will help you solve lots of problems.
--
There are only 10 types of people in the world...
Those who know binary and those who don't.
--


2010/7/28 Kostya Vasilyev 

> The code below replaces the activity's content view (the root of view
> hierarchy) with a new LinearLayout.
>
> If you want to keep your existing layout around, do this:
>
> 1 - declare a LinearLayout placeholder in your layout xml file, give it an
> ID.
>
> 2 - instead of creating a new LinearLayout, get it by calling findViewById.
>
> 3 - don't call setContentView
>
> -- Kostya
>
> 28.07.2010 8:13, ethan пишет:
>
>  This is the code that i used :
>>
>> LinearLayout mLinearLayout;
>> mLinearLayout = new LinearLayout(this);
>>
>> ImageView i = new ImageView(this);
>> i.setImageResource(R.drawable.cow_icon);
>> i.setAdjustViewBounds(true); // set the ImageView bounds to match
>> the Drawable's dimensions
>> i.setLayoutParams(new
>> Gallery.LayoutParams(LayoutParams.WRAP_CONTENT,
>> LayoutParams.WRAP_CONTENT));
>>
>> //Add the ImageView to the layout and set the layout as the
>> content view
>> mLinearLayout.addView(i);
>> setContentView(mLinearLayout);
>>
>>
>> With this code, i can see the image getting didplayed but it goes on a
>> different layout. It doesnt display on the current layout.
>> Is there a way i can display this in the current layout ?
>>
>>
>> On Jul 27, 12:18 pm, Kostya Vasilyev  wrote:
>>
>>
>>> You could use one image view and several different images with varying
>>> number of flowers.
>>>
>>> Or create the required number of image views from code, all using the
>>> same
>>> image.
>>>
>>> Or declare four image views in your layout and manage their visibility
>>> from
>>> code.
>>>
>>> --
>>> Kostya Vasilyev --http://kmansoft.wordpress.com
>>>
>>> 27.07.2010 21:11 пользователь "ethan"  написал:
>>>
>>> Ok. So in this case, is there a way to dynamically create imageviews
>>> from the code (not xml) based on number of images to display ?
>>> Or should i just statically create 4 imageviews and only populate them
>>> based on the number of flowers i want to display ?
>>>
>>> On Jul 27, 10:52 am, Justin Anderson  wrote:
>>>
>>>
>>>
 No... displaying the number...
 On Tue, Jul 27, 2010 at 8:25 AM, ethan  wrote:


> You are correct.
>
>

>>>
 In...
> 
> 
> >
>
>
 
>>> 
>>> >
>>>
>>>
>>>
>>>
>>>
  For more options, visit this group at
> http://groups.google.com/group/androi...
>
>

>>
>
>
> --
> Kostya Vasilev -- WiFi Manager + pretty widget --
> http://kmansoft.wordpress.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
>

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


Re: [android-beginners] Bringing activity to front -Urgent help

2010-07-28 Thread Justin Anderson
Well... what info do you have from the crash?  Looking at the logcat info
should tell you what the problem is...  You will want to look for the words
"caused by" in the log.

--
There are only 10 types of people in the world...
Those who know binary and those who don't.
--


On Tue, Jul 27, 2010 at 10:14 PM, Revathi K J Ramanan <
revathiramana...@gmail.com> wrote:

> Hi,
>
> I have two resized activities ,say alarm clock and settings,running on
> my android screen.
> Both can be seen in the screen as they are resized.
>
> Say alarm clock is the active window and settings is inactive.
> Now I want to make the settings active by clicking the settings region
> in the screen.
> Just like in windows how we make the back window active,I want the
> same functionality achieved.
>
> I tried with the flag,FLAG_ALT_FUCUSABLE_IM and FLAG_NOT_TOUCH_MODAL.
>
> For about 2 or 3 times I am able to bring the activity to front and
> then the emulator crashes.
>
>
> Please help me with ur inputs.
>
> Regards,
>
> Revathi K J
>
> --
> 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
>

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


Re: [android-beginners] Re: [Q] Make the activity blur/dim with startActivityForResult?

2010-07-28 Thread Justin Anderson
I couldn't see anything wrong offhand...

I will try to load it up in Eclipse when I get a chance and see if I can
figure out what is wrong.  It might be a couple days though...

--
There are only 10 types of people in the world...
Those who know binary and those who don't.
--


On Tue, Jul 27, 2010 at 9:04 PM, CyanBlue  wrote:

> Thank you for the reply, Justin...  :)
>
> I tried those suggestions and nothing seem to be working or I might be
> blind...
>
> Is there any way you can take a look at the file and see what I am
> missing?
>   http://www.mediafire.com/?pzm6w9e7ikcy3cx
>
> Thank you very much...
>
> CyanBlue
>
> --
> 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
>

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


[android-beginners] Slider Drawer Problem - disappearing slider

2010-07-28 Thread Victoria Busse
Hi there,

I am currently working on a video editing view for my app and I wanted to
include a sliding drawer with different video editing functions, but I
already ran into a problem with the slider itself because when tap it to
open, it opens fine, but when I tap it a second time to close it again, it
disappears entirely (the slider image moves off the screen). As I haven't
found anything similar I am hoping that someone here can help. Thank you in
advance.

Here is what I do to create the slider:

 ...

 

 

 

 
 


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


[android-beginners] Directory names

2010-07-28 Thread kypriakos

Hi again,

I have been experimenting with the file system that the emulator
presents and I noticed that although I can create files with 'normal'
names (ex. test, src), I don't seem to be able to create dotted
names, such as .test, .src. Is there a restriction on dir names
(other than the common rules that apply on most OSs)?

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


[android-beginners] Re: Contents of dex

2010-07-28 Thread kypriakos

Great thanks Mark.

On Jul 28, 12:03 am, Mark Murphy  wrote:
> On Tue, Jul 27, 2010 at 11:50 PM, kypriakos  wrote:
> > is there a way to view what is enclosed (file list) in the dex file?
>
> http://dedexer.sourceforge.net/
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> _Android Programming Tutorials_ Version 2.9 Available!

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


[android-beginners] How to add shared library in apk

2010-07-28 Thread androidbeginner
Hi All

I want to port c library for this i have built static c library and
added jni files and built the shared library .all these i have done in
target .i want to create separate apk now .Is it possible? If so where
should i add these libraries and how to fetch them

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


Re: [android-beginners] need help validating if application works on specific devices

2010-07-28 Thread Phone Pony
Thanks for the quick reply. What I understand is there is no generic way to
write an application that simplifies or enhances message sending experience.
I will abandon supporting this project and just keep it working on my N1. If
anyone feels like making it work on their device you are invited to do so.

On Wed, Jul 28, 2010 at 11:14 AM, Mark Murphy wrote:

> On Wed, Jul 28, 2010 at 3:51 AM, Phone Pony  wrote:
> > you are invited to look at the code, and hopefully you can find
> > what is wrong with these specific devices.
>
> Uri SmsContentUri = Uri.parse("content://sms");
>
> This is not part of the Android SDK. It is an undocumented feature of
> an optional Android application. It will fail to work on some devices.
> It may fail to work on future versions of Android. You were told not
> to use it:
>
>
> http://android-developers.blogspot.com/2010/05/be-careful-with-content-providers.html
>
> > So much for "write once, run anywhere"
>
> If you use undocumented unsupported APIs, you will have problems. Do
> not use undocumented or unsupported APIs, and you will have better
> luck.
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com | http://github.com/commonsguy
> http://commonsware.com/blog | http://twitter.com/commonsguy
>
> _Android Programming Tutorials_ Version 2.9 Available!
>
> --
> 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
>

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


Re: [android-beginners] Language change to Hindi

2010-07-28 Thread Shaista Naaz
Thanks Mark for redirecting me to correct link. I am new to Android so did
not know where to post such questions.
And Michael I did not get the essence of what you are trying to say.

Regards,
Shaista

On Wed, Jul 28, 2010 at 6:01 AM, michael furman
wrote:

> hi Shaista  do you know that your name very close to Shiester?
> It's a German word...  The answer lies therein.  Hope this helps...
> Mike
>
> On Tue, Jul 27, 2010 at 2:01 AM, Shaista Naaz wrote:
>
>> Is there way of changing the phone language to Hindi. I am trying in
>> eclipse.
>>
>> Please kindly suggest.
>>
>> Thanks,
>> Shaista Naaz
>>
>> --
>> 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
>>
>
>  --
> 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
>

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


[android-beginners] image with panning and zooming

2010-07-28 Thread zaheer ahmad
hi,

I would like a minimal sample android app that can display an image (bigger
than the screen size) and allow it to pan and zoom. is there an example for
the same.
Thanks in advance for any inputs.

Zaheer

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


Re: [android-beginners] need help validating if application works on specific devices

2010-07-28 Thread Mark Murphy
On Wed, Jul 28, 2010 at 3:51 AM, Phone Pony  wrote:
> you are invited to look at the code, and hopefully you can find
> what is wrong with these specific devices.

Uri SmsContentUri = Uri.parse("content://sms");

This is not part of the Android SDK. It is an undocumented feature of
an optional Android application. It will fail to work on some devices.
It may fail to work on future versions of Android. You were told not
to use it:

http://android-developers.blogspot.com/2010/05/be-careful-with-content-providers.html

> So much for "write once, run anywhere"

If you use undocumented unsupported APIs, you will have problems. Do
not use undocumented or unsupported APIs, and you will have better
luck.

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

_Android Programming Tutorials_ Version 2.9 Available!

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


[android-beginners] need help validating if application works on specific devices

2010-07-28 Thread Phone Pony
Hi,

I've created and published a widget called in the market by the name
"Frequent Contacts Widget", sources can be found at
http://code.google.com/p/frequentcontacts/ . Mu problem is that it
works on my N1, and on the emulator, but some users complain that is
doesn't work on their HTC incredible, HTC desire, and motor droid.
I've opened bugs on these issues, but since I don't have these devices
It is very hard to solve. If anyone is interested in seeing a very
small application that sends SMS, makes calls and has a not trivial
widget you are invited to look at the code, and hopefully you can find
what is wrong with these specific devices. I'm not even sure there is
a problem with the devices in general, since I don't know if it works
on them at all. So much for "write once, run anywhere"

Thanks,
Oren

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