[android-beginners] change scroll speed in gallery.

2010-07-16 Thread murali raju
Hi,

Can i change the scroll speed in gallery view? i want a constant change in
the gallery views irrespective of the speed the user fligs it.

-- 
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: Database handling - when do you open and close

2010-07-16 Thread YuviDroid
mmm I'm not really sure what you are trying to achieve. Exactly, at what
times do you want to open/close the db? The db should stay open while your
application is running? So, even when you switch among activities (yours
activities)?


On Thu, Jul 15, 2010 at 6:36 PM, Bender  wrote:

> @YuviDroid
>
> I'm trying the following at the moment: the open() only gets called in
> both onCreate() methods with:
>
>mDb = new DbAdapter(this);
>if(mDb.getDatabase() == null || !mDb.getDatabase().isOpen()) {
>  mDb.open();
>}
>
> The problem I'm having with this is, that there is always a new
> DbAdapter created which is fine when the activity is created the first
> time. But this way "mDb.getDatabase() == null" will be always true
> because its a new mDb.
>
> So I either need to find a way to check if the database is opened
> without "mDb" or need to remember mDb even if the activity is stopped.
>
> @Kostya Vasilyev
>
> I tried that, but then my app crashes while switching between
> activities. When I was searching for the error I put logs in the
> open() and close() methods by my DbAdapter and I could see the
> following:
>
>  * open()  (app, activity1 started)
>  * open()  (i hit a button in activity1, activity2 is starting and
> open is called within onStart)
>  * close()  (activity1 is stopped, in onStop close is called)
>
> When I go back to activity1 it throws an exception because the
> database is closed. -.-
>
> --
> 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
>



-- 
YuviDroid
http://android.yuvalsharon.net

-- 
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: Flurry and AppWidgets

2010-07-16 Thread whitemice
Hi Jake
Assuming you are talking about Android Home Screen Widgets, I had the
same issue which I blogged here:
http://blog.zedray.com/2010/05/01/tracking-a-android-home-screen-widget/

I still haven't gotten a response from Flurry, so I suggest you
consider the Google Analytics API.  While this offers fewer features
relevant for application developers, it does provide a dispatch()
method which allows you to manually workaround the widget life cycle
issue.  Let me know how this works for you.

Regards
Mark


On Jul 7, 10:49 pm, Jake Colman  wrote:
> I am familiar with using Flurry with Activities and calling
> FlurryAgent.onStartSession() in the activity's onStart() method and
> calling FlurryAgent.onEndSession in the activity's onStop() method.
> What would be the best way to do the same thing if I want to use Flurry
> with my appwidget?  Should I use the onEnabled()/onDisabled() methods or
> should I use onUpdate() since the user may never delete my appwidget and
> I won't know he's still using it?  Or maybe onUpdate() and onDisabled()
> but then I won't be matching my start/end sessions.  If my appwidget has
> a configuration activity or some other displayed activity I can
> obviously use flurry there.  But how about in the appwidget itself?
>
> --
> Jake Colman -- Android Tinkerer

-- 
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] SQL and SQLite

2010-07-16 Thread Mikey
SQL is Structured Query Language, a language for writing queries to an RDBMS

SQLite is a lightweight implementation of an RDBMS that runs on Android (among 
other places) and uses SQL to return data.

HTH,

Mikey

On 16 Jul 2010, at 07:54, Raul Martinez wrote:

> Are SQL and SQLite the same thing? If not what's the difference
> 
> 
> -- 
> 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: SQL and SQLite

2010-07-16 Thread DanH
Yes, SQL is a "standard" for a database query language and API, and
SQLite is an (open source, portable) implementation of that standard.
Some would quibble about how well SQLite adheres to the standard, but
one can also say the same of most other implementations (there are
lots of "dialects"), and SQLite is something of a de-facto standard.
One nice  thing about it is that a SQLite database is portable between
platforms, meaning, eg, you can construct a database on your PC and
transfer it as a single file to your phone.

On the bad side, SQLite is so "loose" in its standard interpretation
of the standard that a query script for SQLite is nowhere near
guaranteed to run on another SQL implementation.

SQLite is also not that good for really large databases, but you
wouldn't run such a large database on a phone.

On Jul 16, 1:54 am, Raul Martinez  wrote:
> Are SQL and SQLite the same thing? If not what's the difference

-- 
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: Using SQLite update DB

2010-07-16 Thread DanH
Just a hint:  SQLite generates some pretty good diagnostic messages.
I'm assuming (I've not used SQLite on Android) that the message info
is in the SQLiteException.  You need to print that out and report the
message when asking for help.

On Jul 16, 1:31 am, Bhaban N  wrote:
> Dear All,
> I am trying to use SQLite on my application.
> But I am not able to get how to use update method.
> My sql statement is like this.
>  "update poi set visitcount=1 where cate=1 AND name='신사2점(7호)'";
>
> I try to use execSQL but it has some problem so I want to use update
> method.
> its like
>
> myDB.update(table, values, whereClause, whereArgs);
> what will be the values on this method parameter.
>
> Please suggest me if anyone has the solution.
>
> regards
> NBS

-- 
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: Flurry and AppWidgets

2010-07-16 Thread Jake Colman

Mark,

Your blog postings hit the nail directly on the head!  I guess I'll do
as you suggest and see what Google Analytics can do for me.

Thanks.

...Jake


> "w" == whitemice   writes:

   w> Hi Jake

   w> Assuming you are talking about Android Home Screen Widgets, I had
   w> the same issue which I blogged here:
   w> http://blog.zedray.com/2010/05/01/tracking-a-android-home-screen-widget/

   w> I still haven't gotten a response from Flurry, so I suggest you
   w> consider the Google Analytics API.  While this offers fewer
   w> features relevant for application developers, it does provide a
   w> dispatch() method which allows you to manually workaround the
   w> widget life cycle issue.  Let me know how this works for you.

   w> Regards
   w> Mark

   w> On Jul 7, 10:49 pm, Jake Colman  wrote:

   >> I am familiar with using Flurry with Activities and calling
   >> FlurryAgent.onStartSession() in the activity's onStart() method
   >> and calling FlurryAgent.onEndSession in the activity's onStop()
   >> method.  What would be the best way to do the same thing if I want
   >> to use Flurry with my appwidget?  Should I use the
   >> onEnabled()/onDisabled() methods or should I use onUpdate() since
   >> the user may never delete my appwidget and I won't know he's still
   >> using it?  Or maybe onUpdate() and onDisabled() but then I won't
   >> be matching my start/end sessions.  If my appwidget has a
   >> configuration activity or some other displayed activity I can
   >> obviously use flurry there.  But how about in the appwidget
   >> itself?
   >> 
   >> --
   >> Jake Colman -- Android Tinkerer

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

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

   w> To unsubscribe from this group, send email to
   w> android-beginners+unsubscr...@googlegroups.com
   w> For more options, visit this group at
   w> http://groups.google.com/group/android-beginners?hl=en

-- 
Jake Colman -- Android Tinkerer

-- 
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: Flurry and AppWidgets

2010-07-16 Thread Jake Colman

Mark,

So you call dispatch() from a service upon every call to onUpdate?

...Jake


> "w" == whitemice   writes:

   w> Hi Jake

   w> Assuming you are talking about Android Home Screen Widgets, I had
   w> the same issue which I blogged here:
   w> http://blog.zedray.com/2010/05/01/tracking-a-android-home-screen-widget/

   w> I still haven't gotten a response from Flurry, so I suggest you
   w> consider the Google Analytics API.  While this offers fewer
   w> features relevant for application developers, it does provide a
   w> dispatch() method which allows you to manually workaround the
   w> widget life cycle issue.  Let me know how this works for you.

   w> Regards
   w> Mark


-- 
Jake Colman -- Android Tinkerer

-- 
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] HUGE PROBLEM - I really need help: after trying to retrieve videos from sd card, the app disappeared from the emulator entirely

2010-07-16 Thread kivy
Hi there,

I was working on the code below, trying to load all available videos
from the emulator sdcard into my gridview, I compiled and wanted to
test it, but the app has disappeared entirely from my emulator... what
can I do or better what have I done wrong in the code that could cause
a problem like that...???
I could really need some help, so if anyone may see what I have done
wrong, please tell, because I have no idea what's wrong...Thanks in
advance...

package com.mobilevideoeditor.moved;

import java.util.ArrayList;

import android.app.Activity;
import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.provider.MediaStore;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.ImageView;




public class EditGalleryView extends Activity {
Uri[] vidUris;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.videogrid);

GridView vGrid=(GridView) findViewById(R.id.vgrid);
vGrid.setAdapter(new VideoAdapter(this));

Uri uri = MediaStore.Video.Media.EXTERNAL_CONTENT_URI;

Log.d("EditGalleryView", "uri:"+uri);
String[] projection = {
MediaStore.Video.Media.DESCRIPTION,
MediaStore.Video.Media.DATA
};

Cursor c = this.managedQuery(uri, projection, null, null,
MediaStore.Video.Media.DATE_ADDED);
 Log.d("EditGalleryView", "vids available:"
+c.getCount());

 ArrayList experimentVids = new
ArrayList();


 if (c.getCount() != 0) {
 c.moveToFirst();
 
experimentVids.add(Uri.parse(c.getString(1)));
 while (c.moveToNext()) {
 
experimentVids.add(Uri.parse(c.getString(1)));

  }
  }
 Log.d("ClassName", "experimentVids.length:"
+experimentVids.size());
  if 
(experimentVids.size() != 0)
{
vidUris = new
Uri[experimentVids.size()];
  for (int i = 
0; i <
experimentVids.size(); i++) {
  
vidUris[i] =
experimentVids.get(i);
  }
  
Log.d("EditGalleryView",
"vidUris:"+vidUris.length);
  }
  }


public class VideoAdapter extends BaseAdapter {
private Context mContext;

public VideoAdapter(Context c) {
mContext = c;
}

public int getCount() {
//return mThumbIds.length;
return vidUris.length;
}

public Object getItem(int position) {
//return null;
return position;
}

public long getItemId(int position) {
//return 0;
return position;
}

// create a new ImageView for each item referenced by the Adapter
public View getView(int position, View convertView, ViewGroup
parent) {
   ImageView imageView;
if (convertView == null) {  // if it's not recycled,
initialize some attributes
imageView = new ImageView(mContext);
imageView.setImageURI(vidUris[position]);
imageView.setLayoutParams(new GridView.LayoutParams(85,
85));
imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
imageView.setPadding(8, 8, 8, 8);
} else {
imageView = (ImageView) convertView;
}

  //  imageView.setImageResource(mThumbIds[position]);
return imageView;
}

   /* // references to our images
private Integer[] mThumbIds = {
R.drawable.sample_2, R.drawable.sample_3,
R.drawable.sample_4, R.drawable.sample_2,
R.drawable.sample_6, R.drawable.sample_3,
R.drawable.sample_4, R.drawable.sample_1,

};*/

}

}

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

Re: [android-beginners] Re: addContentView obscures events

2010-07-16 Thread Justin Anderson
What exactly are you trying to accomplish?  Are you trying to get the same
sort of effect that the browser or google maps has with the zoom in/out
buttons (in that they show up on top of the current view)?

The google maps source definitely isn't available, but if the browser source
is then you could see how it is implemented in there by getting at the
source and seeing what is done...

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


On Tue, Jul 13, 2010 at 12:58 AM, Chris  wrote:

> Actually I just realized that's not quite what I'm looking for because
> the overlay will always draw above the buttons on the base view. I
> guess I'm looking for some way to get the overlay between the base (in
> this case a camera preview or an image) and some UI components. Any
> thoughts?
>
> -Chris
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Beginners" group.
>
> NEW! Try asking and tagging your question on Stack Overflow at
> http://stackoverflow.com/questions/tagged/android
>
> To unsubscribe from this group, send email to
> android-beginners+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-beginners?hl=en
>

-- 
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: Managing an SQLite cursor in a ListActivity

2010-07-16 Thread hiubs
can you post some code?

On 14 jul, 20:21, Bret Foreman  wrote:
> I have a ListActivity that selects a cursor from an SQLite table in
> order to build the list. The cursor is created inside
> ListActivity.onCreate and closed inside ListActivity.onDestroy. I also
> call startManagingCursor right after I generate the cursor, which I
> thought would take care of the cursor life-cycle. When one of the list
> elements is selected, a new view is started. At that time I see the
> following error message in the log: "I/dalvikvm(  852): Ljava/lang/
> IllegalStateException;: Finalizing cursor android.
> database.sqlite.sqlitecur...@43baa7e0 on ShippingEvents that has not
> been deactivated or closed.
>
> Is this a real error? If so, what is happening and how can I correct
> it?

-- 
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: Creating a populated sqlite database

2010-07-16 Thread Rodney Lendore
The database will in the end contain about 100 rows and 3 columns. But this
database will not be written to by the user simply read from to gain some
generic information, depending on which buttons a user clicks.

Thanks

On Mon, Jul 12, 2010 at 9:23 PM, Justin Anderson wrote:

> Unless the database is going to be quite large, I would just create it in
> code the first time you start up the app... How large are you anticipating
> this database is going to be?
>
>
>
> --
> There are only 10 types of people in the world...
> Those who know binary and those who don't.
> --
>
>
> On Mon, Jul 12, 2010 at 1:56 PM, DanH  wrote:
>
>> Certainly in Java code you can create it, or in C++, or with a stand-
>> alone PC tool such as SQLite Expert.  SMOP.
>>
>> Dunno about /res.
>>
>> On Jul 8, 4:30 pm, Rodney Lendore  wrote:
>> > Hi,
>> >
>> > I am trying to create a pre-populated sqlite database to be shipped with
>> my
>> > application. The database is to contain three columns.
>> >
>> > | ID | Name | URL |
>> >
>> > and possibly several hundred rows. Is there a way I can create this in
>> /res
>> > or java code smartly ? Forgive me I am fairly new to Java and have
>> little
>> > experience with SQL.
>> >
>> > Thanks very much in advance for you help
>> >
>> > Rodney
>>
>> --
>> 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] List content observers

2010-07-16 Thread Froens
Hi there

I'm building an app that uses content observers.
My problem is, that I tend to register my content observers multiple
times. This causes my application to log events several times.
How do I find out, if my content observer is already registered?

- Frederik

-- 
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: Managing an SQLite cursor in a ListActivity

2010-07-16 Thread hiubs
Hello Bret, can you post some code?

On 14 jul, 20:21, Bret Foreman  wrote:
> I have a ListActivity that selects a cursor from an SQLite table in
> order to build the list. The cursor is created inside
> ListActivity.onCreate and closed inside ListActivity.onDestroy. I also
> call startManagingCursor right after I generate the cursor, which I
> thought would take care of the cursor life-cycle. When one of the list
> elements is selected, a new view is started. At that time I see the
> following error message in the log: "I/dalvikvm(  852): Ljava/lang/
> IllegalStateException;: Finalizing cursor android.
> database.sqlite.sqlitecur...@43baa7e0 on ShippingEvents that has not
> been deactivated or closed.
>
> Is this a real error? If so, what is happening and how can I correct
> it?

-- 
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] non-chat bluetooth example

2010-07-16 Thread Affan



I need to send and receive data from an Android client to a Bluetooth
SPP server on a non-android platform (not decided, but possibly
Arduino with C code).

I am mostly trying to correctly read from the serial iostream provided
by the bluetooth socket and convert that into a Java class (to use as
a structure). while packaging a delimted byte stream is easy, I am not
quite sure about the serial io reading from the io stream (i.e. is
there a maximum byte size it will read? does it split the file sent
from the serial port and i have to manually combine later?).

Now, bit shifting and using something like ByteStream can make it
work, I was wondering if there is a serialization or mashalling stub
code that is already available on Android. Furthermore, the received
(at android) structure can have variable size strings, so
serialization becomes an even greater challenge, if done manually.

An example code doing non-chat (or string based) comms over bluetooth
in SPP (serial port profile) in android would be perfect (some sort of
protocol frames that are exchanged). I have googled this , but either
my google-fu has gone bad, or there just isnt any such example at the
top of search lists.

-- 
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] List Activity Listener Not Working

2010-07-16 Thread Saket Srivastav
List activity listener is not listening.

lv.setOnItemClickListener(new OnItemClickListener() {

public void onItemClick(AdapterView arg0, View arg1, int position,
long arg3) {
System.out.println("ARG 2 = "+position);
Intent i = new Intent(MenuList.this, SICalculator.class);
startActivity(i);
 }
});

any reasons why the list item click listener is not working???


   Regards
Saket Srivastav

-- 
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: Creating a populated sqlite database

2010-07-16 Thread Justin Anderson
If I were doing it I would just create it in code...  It is quite a small
database.

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


On Thu, Jul 15, 2010 at 8:42 AM, Rodney Lendore wrote:

> The database will in the end contain about 100 rows and 3 columns. But this
> database will not be written to by the user simply read from to gain some
> generic information, depending on which buttons a user clicks.
>
> Thanks
>
> On Mon, Jul 12, 2010 at 9:23 PM, Justin Anderson 
> wrote:
>
>> Unless the database is going to be quite large, I would just create it in
>> code the first time you start up the app... How large are you anticipating
>> this database is going to be?
>>
>>
>>
>> --
>> There are only 10 types of people in the world...
>> Those who know binary and those who don't.
>> --
>>
>>
>> On Mon, Jul 12, 2010 at 1:56 PM, DanH  wrote:
>>
>>> Certainly in Java code you can create it, or in C++, or with a stand-
>>> alone PC tool such as SQLite Expert.  SMOP.
>>>
>>> Dunno about /res.
>>>
>>> On Jul 8, 4:30 pm, Rodney Lendore  wrote:
>>> > Hi,
>>> >
>>> > I am trying to create a pre-populated sqlite database to be shipped
>>> with my
>>> > application. The database is to contain three columns.
>>> >
>>> > | ID | Name | URL |
>>> >
>>> > and possibly several hundred rows. Is there a way I can create this in
>>> /res
>>> > or java code smartly ? Forgive me I am fairly new to Java and have
>>> little
>>> > experience with SQL.
>>> >
>>> > Thanks very much in advance for you help
>>> >
>>> > Rodney
>>>
>>> --
>>> 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
>

-- 
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: Creating a populated sqlite database

2010-07-16 Thread Kostya Vasilyev

Rodney,

Just one more option - write a small Android app to create the database, 
then pull it from the device using "adb pull" and place into the "real"

project as an asset.

-- Kostya

16.07.2010 23:31, Justin Anderson ?:
If I were doing it I would just create it in code...  It is quite a 
small database.


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


On Thu, Jul 15, 2010 at 8:42 AM, Rodney Lendore 
mailto:rodney.lend...@gmail.com>> wrote:


The database will in the end contain about 100 rows and 3 columns.
But this database will not be written to by the user simply read
from to gain some generic information, depending on which buttons
a user clicks.

Thanks

On Mon, Jul 12, 2010 at 9:23 PM, Justin Anderson
mailto:janderson@gmail.com>> wrote:

Unless the database is going to be quite large, I would just
create it in code the first time you start up the app... How
large are you anticipating this database is going to be?



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


On Mon, Jul 12, 2010 at 1:56 PM, DanH mailto:danhi...@ieee.org>> wrote:

Certainly in Java code you can create it, or in C++, or
with a stand-
alone PC tool such as SQLite Expert.  SMOP.

Dunno about /res.

On Jul 8, 4:30 pm, Rodney Lendore
mailto:rodney.lend...@gmail.com>> wrote:
> Hi,
>
> I am trying to create a pre-populated sqlite database to
be shipped with my
> application. The database is to contain three columns.
>
> | ID | Name | URL |
>
> and possibly several hundred rows. Is there a way I can
create this in /res
> or java code smartly ? Forgive me I am fairly new to
Java and have little
> experience with SQL.
>
> Thanks very much in advance for you help
>
> Rodney

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


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



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


[android-beginners] Re: Java Keyword This and Button Listeners.

2010-07-16 Thread Keith Roberts
 setOnClickListener actually takes the callback method that will be
invoked when the user presses the button interface as an argument, so
it doesn't take a view  Basically you're saying "this" is just a
reference to the current object you're in.  So if you're in a specific
method and you use this, it tells the complier to pass in class
variables not the local ones because the instance of the class would
be outside of the method??  also, if your class contains multiple
instances how does the complier know which one "this" is referring
too?

On Jul 13, 1:47 am, Justin Anderson  wrote:
> *> I know that the keyword "this" refers to an instance variable or can
> invoke a constructor*
> That is not what the keyword "this" references.  It references the instance
> of the class you are currently in...
>
> *> but I don't understand how passing "this" as the arg for
> setOnClickListener () works?Could someone explain?*
> Take a look at the argument list for setOnClickListener...  One of the
> arguments is probably a View.  So, when you are calling setOnClickListener
> and you are in a class that inherits View, you pass "this" because "this"
> is-a View instance.  It wouldn't work if you were calling setOnClickListener
> from a class that didn't eventually inherit from View.
>
> Hope that helps... sounds to me like you may want to brush up a little bit
> on Java.
>
> --
> There are only 10 types of people in the world...
> Those who know binary and those who don't.
> --
>
>
>
> On Mon, Jul 12, 2010 at 8:50 PM, Keith Roberts  wrote:
> > Hey all,
>
> > I know that the keyword "this" refers to an instance variable or can
> > invoke a constructor, but I don't understand how passing "this" as the
> > arg for setOnClickListener () works?Could someone explain?
>
> > Thanks,
>
> > keith
>
> > --
> > 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 > i...@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: Java Keyword This and Button Listeners.

2010-07-16 Thread DanH
setOnClickListener takes a reference (pointer) to an object as its
argument.  That object must implement the onClick() method.  So when a
click occurs, the onClick method of that object (that specific
instance of that class) is called.  Using "this" just directs that the
onClick method of the current object be used if a click occurs.

Another way to understand "this":

public class MyClass {
 public void myMethod(Object someObj) {
  if (someObj == this) {
   System.out.println("someObj == this");
  }
  else {
   System.out.println("someObj != this");
  }
}

public class MyOtherClass {
  public void doSomething() {
   MyClass theInstance = new MyClass();
   MyClass notTheInstance = new MyClass();
   theInstance ->myMethod(theInstance);  // This will print "=="
   theInstance ->myMethod(notTheInstance);  // This will print "!="
   theInstance ->myMethod(this);  // This will print "!="
  }
}

On Jul 16, 2:43 pm, Keith Roberts  wrote:
>  setOnClickListener actually takes the callback method that will be
> invoked when the user presses the button interface as an argument, so
> it doesn't take a view  Basically you're saying "this" is just a
> reference to the current object you're in.  So if you're in a specific
> method and you use this, it tells the complier to pass in class
> variables not the local ones because the instance of the class would
> be outside of the method??  also, if your class contains multiple
> instances how does the complier know which one "this" is referring
> too?
>
> On Jul 13, 1:47 am, Justin Anderson  wrote:
>
> > *> I know that the keyword "this" refers to an instance variable or can
> > invoke a constructor*
> > That is not what the keyword "this" references.  It references the instance
> > of the class you are currently in...
>
> > *> but I don't understand how passing "this" as the arg for
> > setOnClickListener () works?Could someone explain?*
> > Take a look at the argument list for setOnClickListener...  One of the
> > arguments is probably a View.  So, when you are calling setOnClickListener
> > and you are in a class that inherits View, you pass "this" because "this"
> > is-a View instance.  It wouldn't work if you were calling setOnClickListener
> > from a class that didn't eventually inherit from View.
>
> > Hope that helps... sounds to me like you may want to brush up a little bit
> > on Java.
>
> > --
> > There are only 10 types of people in the world...
> > Those who know binary and those who don't.
> > --
>
> > On Mon, Jul 12, 2010 at 8:50 PM, Keith Roberts  wrote:
> > > Hey all,
>
> > > I know that the keyword "this" refers to an instance variable or can
> > > invoke a constructor, but I don't understand how passing "this" as the
> > > arg for setOnClickListener () works?Could someone explain?
>
> > > Thanks,
>
> > > keith
>
> > > --
> > > 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 > >  i...@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: Creating a populated sqlite database

2010-07-16 Thread DanH
Certainly with only 100 rows you could write the SQL script containing
the create table command and 100 insert commands and then use
something like SQLite Expert to execute the script and create the DB.
Or you could just write a straight Java application to execute the
commands and create the DB.  The SQLite file that results in all cases
is "portable".

But for only 100 rows and 3 columns it's hardly worth messing with SQL
-- you can just create an array containing the data and search that,
or load up the data in a HashTable or some such.

On Jul 15, 9:42 am, Rodney Lendore  wrote:
> The database will in the end contain about 100 rows and 3 columns. But this
> database will not be written to by the user simply read from to gain some
> generic information, depending on which buttons a user clicks.
>
> Thanks
>
> On Mon, Jul 12, 2010 at 9:23 PM, Justin Anderson 
> wrote:
>
> > Unless the database is going to be quite large, I would just create it in
> > code the first time you start up the app... How large are you anticipating
> > this database is going to be?
>
> > --
> > There are only 10 types of people in the world...
> > Those who know binary and those who don't.
> > --
>
> > On Mon, Jul 12, 2010 at 1:56 PM, DanH  wrote:
>
> >> Certainly in Java code you can create it, or in C++, or with a stand-
> >> alone PC tool such as SQLite Expert.  SMOP.
>
> >> Dunno about /res.
>
> >> On Jul 8, 4:30 pm, Rodney Lendore  wrote:
> >> > Hi,
>
> >> > I am trying to create a pre-populated sqlite database to be shipped with
> >> my
> >> > application. The database is to contain three columns.
>
> >> > | ID | Name | URL |
>
> >> > and possibly several hundred rows. Is there a way I can create this in
> >> /res
> >> > or java code smartly ? Forgive me I am fairly new to Java and have
> >> little
> >> > experience with SQL.
>
> >> > Thanks very much in advance for you help
>
> >> > Rodney
>
> >> --
> >> 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


Re: [android-beginners] List Activity Listener Not Working

2010-07-16 Thread TreKing
On Fri, Jul 16, 2010 at 1:38 PM, Saket Srivastav  wrote:

> any reasons why the list item click listener is not working???
>

Probably

Try 
this instead.

-
TreKing  - Chicago
transit tracking app for Android-powered devices

-- 
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] Including libraries in project

2010-07-16 Thread kypriakos

Hi all,

I managed to compile the imported application (the trick was not to
just
throw the lib directory in the project but to also build a library out
of  the
jars and present that in the project class path). However, I am
noticing
in DDMS (and in debug perspective) when I launch the app that one of
the
threads quits and complains that:
"Failed resolving Lcom/myApp/PeerToPeerAdapter: interface 211 Lnet/
wlib/PeerGen".

I can see the net/lib/PeerGen in the jar files included in the library
that
is in the classpath. Afterall it compiles fine. Why does it complain
at runtime? Doesn't the Android plugin package what it needs in the
dex,
apk and res_ files before it deploys the app in the emulator?
I could not find anything on this in the resources so I am wondering
if
anyone had this issue before - It could be trivial and I am missing
something
very obvious.

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] Detecting version of Android at runtime

2010-07-16 Thread Bret Foreman
I'm about to implement a hack to work around a bug in Android 2.1. I'd
like that hack to be inactive in 2.2 where the bug is (reportedly)
fixed. How can I test at runtime for the version of Android that the
phone is running? In case anyone is interested, here's the hack:

https://sites.google.com/a/bug-br.org.br/android/technical-documents/sensors-and-standby-mode

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] The Force Close Error is suddenly back...

2010-07-16 Thread Victoria
Hi,

I am trying to load videos from my emulated sdcard into my implemented
GridView, it worked fine before, when I used the GridView example from
Google...but now I get a Force close error when I try to open the app.

The entire app works (or rather should work) like this a TabView is
launched that includes 2 tabs (GalleryView.java and main.xml), each
tab loads a GridView (EditGalleryView.java and ShareGalleryView.java).
Before I tried loading videos into the gridView I simply used the
GridView example as starting point. Now on basis of this example I am
trying to load videos into my GridView from the sdcard, which
apparently seems to cause a Force Close Error.

If someone could help me find the problem that's causing this, it
would be great because I really don't know what's wrong now ...
Thanks in Advance

Here is the code I use:

The Manifest.xml:

http://schemas.android.com/apk/res/android";
  package="com.mobilevideoeditor.moved"
  android:versionCode="1"
  android:versionName="1.0">

   



 
   




   




   





The GalleryView.java:

package com.mobilevideoeditor.moved;

import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.widget.TabHost;

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

Resources res = getResources(); // Resource object to get
Drawables
TabHost tabHost = getTabHost();  // The activity TabHost
TabHost.TabSpec spec;  // Reusable TabSpec for each tab
Intent intent;  // Reusable Intent for each tab

// Create an Intent to launch an EditGallery for the tab (to be
reused)
intent = new Intent().setClass(this, EditGalleryView.class);

// Initialize a TabSpec for each tab and add it to the TabHost
spec = tabHost.newTabSpec("edit").setIndicator("Edit",
  res.getDrawable(R.layout.ic_tab_edit))
  .setContent(intent);
tabHost.addTab(spec);

intent = new Intent().setClass(this, ShareGalleryView.class);
spec = tabHost.newTabSpec("share").setIndicator("Share",
  res.getDrawable(R.layout.ic_tab_share))
  .setContent(intent);
tabHost.addTab(spec);

tabHost.setCurrentTab(0);
}
}

The EditGalleryView.java (which seems to cause my problem):

package com.mobilevideoeditor.moved;

import java.util.ArrayList;

import android.app.Activity;
import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.provider.MediaStore;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.VideoView;




public class EditGalleryView extends Activity {
Uri[] vidUris;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.videogrid);

GridView vGrid=(GridView) findViewById(R.id.vgrid);
vGrid.setAdapter(new VideoAdapter(this));

Uri uri = MediaStore.Video.Media.EXTERNAL_CONTENT_URI;

Log.d("EditGalleryView", "uri:"+uri);
 String[] projection = {
MediaStore.Video.Media.DESCRIPTION,
MediaStore.Video.Media.DATA
};

Cursor c = this.managedQuery(uri, projection, null, null,
MediaStore.Video.Media.DATE_ADDED);
 Log.d("EditGalleryView", "vids available:"
+c.getCount());

 ArrayList experimentVids = new
ArrayList();


 if (c.getCount() != 0) {
 c.moveToFirst();
 //
experimentVids.add(Uri.parse(c.getString(1)));
 while (c.moveToNext()) {
 
experimentVids.add(Uri.parse(c.getString(1)));

  }
  }
 Log.d("ClassName",
"experimentVids.length:" +experimentVids.size());
  if
(experimentVids.size() != 0) {
vidUris = new
Uri[experimentVids.size()];
  for (int i = 0;
i < experimentVids.size(); i++) {
  vidUris[i] =
experimentVids.get(i);
  }
 
Log.d("EditGalleryView", "vidUris:"+vidUris.length);

Re: [android-beginners] The Force Close Error is suddenly back...

2010-07-16 Thread Kostya Vasilyev

Victoria,

The cause of this exception appears in logcat:

07-16 19:40:45.124: ERROR/AndroidRuntime(225): Caused by:
java.lang.NullPointerException
07-16 19:40:45.124: ERROR/AndroidRuntime(225): at
com.mobilevideoeditor.moved.EditGalleryView
$VideoAdapter.getCount(EditGalleryView.java:73)

Looks like vidUris is null.

Set a breakpoint and debug - looks like adapter's getCount() gets called 
before the information (vidUris) becomes available.


-- Kostya

17.07.2010 0:49, Victoria пишет:

Hi,

I am trying to load videos from my emulated sdcard into my implemented
GridView, it worked fine before, when I used the GridView example from
Google...but now I get a Force close error when I try to open the app.

The entire app works (or rather should work) like this a TabView is
launched that includes 2 tabs (GalleryView.java and main.xml), each
tab loads a GridView (EditGalleryView.java and ShareGalleryView.java).
Before I tried loading videos into the gridView I simply used the
GridView example as starting point. Now on basis of this example I am
trying to load videos into my GridView from the sdcard, which
apparently seems to cause a Force Close Error.

If someone could help me find the problem that's causing this, it
would be great because I really don't know what's wrong now ...
Thanks in Advance

Here is the code I use:

The Manifest.xml:

http://schemas.android.com/apk/res/android";
   package="com.mobilevideoeditor.moved"
   android:versionCode="1"
   android:versionName="1.0">
 

 

 

 
  

 
 
 
 

 
 
 
 

 




The GalleryView.java:

package com.mobilevideoeditor.moved;

import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.widget.TabHost;

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

 Resources res = getResources(); // Resource object to get
Drawables
 TabHost tabHost = getTabHost();  // The activity TabHost
 TabHost.TabSpec spec;  // Reusable TabSpec for each tab
 Intent intent;  // Reusable Intent for each tab

 // Create an Intent to launch an EditGallery for the tab (to be
reused)
 intent = new Intent().setClass(this, EditGalleryView.class);

 // Initialize a TabSpec for each tab and add it to the TabHost
 spec = tabHost.newTabSpec("edit").setIndicator("Edit",
   res.getDrawable(R.layout.ic_tab_edit))
   .setContent(intent);
 tabHost.addTab(spec);

 intent = new Intent().setClass(this, ShareGalleryView.class);
 spec = tabHost.newTabSpec("share").setIndicator("Share",
   res.getDrawable(R.layout.ic_tab_share))
   .setContent(intent);
tabHost.addTab(spec);

 tabHost.setCurrentTab(0);
}
}

The EditGalleryView.java (which seems to cause my problem):

package com.mobilevideoeditor.moved;

import java.util.ArrayList;

import android.app.Activity;
import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.provider.MediaStore;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.VideoView;




public class EditGalleryView extends Activity {
 Uri[] vidUris;
 public void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 setContentView(R.layout.videogrid);

 GridView vGrid=(GridView) findViewById(R.id.vgrid);
 vGrid.setAdapter(new VideoAdapter(this));

 Uri uri = MediaStore.Video.Media.EXTERNAL_CONTENT_URI;

 Log.d("EditGalleryView", "uri:"+uri);
  String[] projection = {
 MediaStore.Video.Media.DESCRIPTION,
 MediaStore.Video.Media.DATA
 };

 Cursor c = this.managedQuery(uri, projection, null, null,
 MediaStore.Video.Media.DATE_ADDED);
  Log.d("EditGalleryView", "vids available:"
+c.getCount());

  ArrayList  experimentVids = new
ArrayList();


  if (c.getCount() != 0) {
  c.moveToFirst();
  //
experimentVids.add(Uri.parse(c.getString(1)));
  while (c.moveToNext()) {

experimentVids.add(Uri.parse(c.getString(1)));

   }
   }
  Log.d("ClassName",

Re: [android-beginners] Re: Java Keyword This and Button Listeners.

2010-07-16 Thread Justin Anderson
I would seriously recommend reading up a little more on Object Oriented
programming... The "this" keyword is an extremely basic and extremely
essential concept for OO programming.  It is used in Java, C++, C#, and many
other OO programming languages.  If an OO language doesn't have the "this"
keyword it usually has a different keyword like "self" that means and does
the same thing.

Much of your confusion is a direct result of not understanding the "this"
concept...  Once you understand it, many other things will become much more
clear.

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


On Fri, Jul 16, 2010 at 2:00 PM, DanH  wrote:

> setOnClickListener takes a reference (pointer) to an object as its
> argument.  That object must implement the onClick() method.  So when a
> click occurs, the onClick method of that object (that specific
> instance of that class) is called.  Using "this" just directs that the
> onClick method of the current object be used if a click occurs.
>
> Another way to understand "this":
>
> public class MyClass {
>  public void myMethod(Object someObj) {
>  if (someObj == this) {
>   System.out.println("someObj == this");
>  }
>  else {
>   System.out.println("someObj != this");
>  }
> }
>
> public class MyOtherClass {
>  public void doSomething() {
>   MyClass theInstance = new MyClass();
>   MyClass notTheInstance = new MyClass();
>   theInstance ->myMethod(theInstance);  // This will print "=="
>   theInstance ->myMethod(notTheInstance);  // This will print "!="
>   theInstance ->myMethod(this);  // This will print "!="
>   }
> }
>
> On Jul 16, 2:43 pm, Keith Roberts  wrote:
> >  setOnClickListener actually takes the callback method that will be
> > invoked when the user presses the button interface as an argument, so
> > it doesn't take a view  Basically you're saying "this" is just a
> > reference to the current object you're in.  So if you're in a specific
> > method and you use this, it tells the complier to pass in class
> > variables not the local ones because the instance of the class would
> > be outside of the method??  also, if your class contains multiple
> > instances how does the complier know which one "this" is referring
> > too?
> >
> > On Jul 13, 1:47 am, Justin Anderson  wrote:
> >
> > > *> I know that the keyword "this" refers to an instance variable or can
> > > invoke a constructor*
> > > That is not what the keyword "this" references.  It references the
> instance
> > > of the class you are currently in...
> >
> > > *> but I don't understand how passing "this" as the arg for
> > > setOnClickListener () works?Could someone explain?*
> > > Take a look at the argument list for setOnClickListener...  One of the
> > > arguments is probably a View.  So, when you are calling
> setOnClickListener
> > > and you are in a class that inherits View, you pass "this" because
> "this"
> > > is-a View instance.  It wouldn't work if you were calling
> setOnClickListener
> > > from a class that didn't eventually inherit from View.
> >
> > > Hope that helps... sounds to me like you may want to brush up a little
> bit
> > > on Java.
> >
> > > --
> > > There are only 10 types of people in the world...
> > > Those who know binary and those who don't.
> > > --
> >
> > > On Mon, Jul 12, 2010 at 8:50 PM, Keith Roberts 
> wrote:
> > > > Hey all,
> >
> > > > I know that the keyword "this" refers to an instance variable or can
> > > > invoke a constructor, but I don't understand how passing "this" as
> the
> > > > arg for setOnClickListener () works?Could someone explain?
> >
> > > > Thanks,
> >
> > > > keith
> >
> > > > --
> > > > 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 i...@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 q

Re: [android-beginners] Detecting version of Android at runtime

2010-07-16 Thread Justin Anderson
http://developer.android.com/reference/android/os/Build.VERSION.html

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


On Fri, Jul 16, 2010 at 2:36 PM, Bret Foreman wrote:

> I'm about to implement a hack to work around a bug in Android 2.1. I'd
> like that hack to be inactive in 2.2 where the bug is (reportedly)
> fixed. How can I test at runtime for the version of Android that the
> phone is running? In case anyone is interested, here's the hack:
>
>
> https://sites.google.com/a/bug-br.org.br/android/technical-documents/sensors-and-standby-mode
>
> 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
>

-- 
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] The Force Close Error is suddenly back...

2010-07-16 Thread Victoria Busse
Hey thanks for the fast reply :), I am sorry for the next question but I am
really new to all this: how do I set breakpoints??

On Fri, Jul 16, 2010 at 9:58 PM, Kostya Vasilyev  wrote:

> Victoria,
>
> The cause of this exception appears in logcat:
>
>
> 07-16 19:40:45.124: ERROR/AndroidRuntime(225): Caused by:
> java.lang.NullPointerException
> 07-16 19:40:45.124: ERROR/AndroidRuntime(225): at
> com.mobilevideoeditor.moved.EditGalleryView
> $VideoAdapter.getCount(EditGalleryView.java:73)
>
> Looks like vidUris is null.
>
> Set a breakpoint and debug - looks like adapter's getCount() gets called
> before the information (vidUris) becomes available.
>
> -- Kostya
>
> 17.07.2010 0:49, Victoria пишет:
>
>  Hi,
>>
>> I am trying to load videos from my emulated sdcard into my implemented
>> GridView, it worked fine before, when I used the GridView example from
>> Google...but now I get a Force close error when I try to open the app.
>>
>> The entire app works (or rather should work) like this a TabView is
>> launched that includes 2 tabs (GalleryView.java and main.xml), each
>> tab loads a GridView (EditGalleryView.java and ShareGalleryView.java).
>> Before I tried loading videos into the gridView I simply used the
>> GridView example as starting point. Now on basis of this example I am
>> trying to load videos into my GridView from the sdcard, which
>> apparently seems to cause a Force Close Error.
>>
>> If someone could help me find the problem that's causing this, it
>> would be great because I really don't know what's wrong now ...
>> Thanks in Advance
>>
>> Here is the code I use:
>>
>> The Manifest.xml:
>> 
>> http://schemas.android.com/apk/res/android";
>>   package="com.mobilevideoeditor.moved"
>>   android:versionCode="1"
>>   android:versionName="1.0">
>> 
>>> android:label="@string/app_name"
>> android:theme="@android:style/
>> Theme.NoTitleBar">
>> 
>> >
>>
>>>
>>>
>> 
>>  
>>> android:label="@string/app_name"
>> android:theme="@android:style/
>> Theme.NoTitleBar">
>> 
>> > android:name="android.intent.action.SEND"/>
>> 
>> 
>>> android:label="@string/app_name"
>> android:theme="@android:style/
>> Theme.NoTitleBar">
>> 
>> > android:name="android.intent.action.MAIN" />
>> > android:name="android.intent.category.LAUNCHER" />
>> 
>>
>> 
>> > android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
>> > android:name="android.permission.READ_EXTERNAL_STORAGE"/>
>> 
>>
>> The GalleryView.java:
>>
>> package com.mobilevideoeditor.moved;
>>
>> import android.app.TabActivity;
>> import android.content.Intent;
>> import android.content.res.Resources;
>> import android.os.Bundle;
>> import android.widget.TabHost;
>>
>> public class GalleryView extends TabActivity {
>> /** Called when the activity is first created. */
>> @Override
>> public void onCreate(Bundle savedInstanceState) {
>> super.onCreate(savedInstanceState);
>> setContentView(R.layout.main);
>>
>> Resources res = getResources(); // Resource object to get
>> Drawables
>> TabHost tabHost = getTabHost();  // The activity TabHost
>> TabHost.TabSpec spec;  // Reusable TabSpec for each tab
>> Intent intent;  // Reusable Intent for each tab
>>
>> // Create an Intent to launch an EditGallery for the tab (to be
>> reused)
>> intent = new Intent().setClass(this, EditGalleryView.class);
>>
>> // Initialize a TabSpec for each tab and add it to the TabHost
>> spec = tabHost.newTabSpec("edit").setIndicator("Edit",
>>   res.getDrawable(R.layout.ic_tab_edit))
>>   .setContent(intent);
>> tabHost.addTab(spec);
>>
>> intent = new Intent().setClass(this, ShareGalleryView.class);
>> spec = tabHost.newTabSpec("share").setIndicator("Share",
>>   res.getDrawable(R.layout.ic_tab_share))
>>   .setContent(intent);
>> tabHost.addTab(spec);
>>
>> tabHost.setCurrentTab(0);
>> }
>> }
>>
>> The EditGalleryView.java (which seems to cause my problem):
>>
>> package com.mobilevideoeditor.moved;
>>
>> import java.util.ArrayList;
>>
>> import android.app.Activity;
>> import android.content.Context;
>> import android.database.Cursor;
>> import android.net.Uri;
>> import android.os.Bundle;
>> import android.provider.MediaStore;
>> import android.util.Log;
>> import android.view.View;
>> import android.view.ViewGroup;
>> import android.widget.BaseAdapter;
>> import android.widget.GridView;
>> import android.widget.VideoView;
>>
>>
>>
>>
>> public class EditGalleryView extends Activity {
>> Uri[] vidUris

Re: [android-beginners] The Force Close Error is suddenly back...

2010-07-16 Thread TreKing
On Fri, Jul 16, 2010 at 4:31 PM, Victoria Busse  wrote:

> I am sorry for the next question but I am really new to all this: how do I
> set breakpoints??


Why are you sorry?

I could tell you how to set a break point. Or I could tell you that simple
Google search lead me to this, where you can find the answer yourself. It's
really that simple.

http://help.eclipse.org/helios/index.jsp

-
TreKing  - Chicago
transit tracking app for Android-powered devices

-- 
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] The Force Close Error is suddenly back...

2010-07-16 Thread TreKing
On Fri, Jul 16, 2010 at 4:41 PM, TreKing  wrote:

> http://help.eclipse.org/helios/index.jsp
>

Stupid Frames:
http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.jdt.doc.user/tasks/task-add_line_breakpoints.htm

-
TreKing  - Chicago
transit tracking app for Android-powered devices

-- 
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] The Force Close Error is suddenly back...

2010-07-16 Thread Victoria Busse
Thanks :) I'll check it now...

On Fri, Jul 16, 2010 at 10:43 PM, TreKing  wrote:

> On Fri, Jul 16, 2010 at 4:41 PM, TreKing  wrote:
>
>> http://help.eclipse.org/helios/index.jsp
>>
>
> Stupid Frames:
>
> http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.jdt.doc.user/tasks/task-add_line_breakpoints.htm
>
>
>
> -
> TreKing  - Chicago
> transit tracking app for Android-powered devices
>
>  --
> 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] chat software , android based

2010-07-16 Thread Sam Hobbs
I have not done any Unix/Linux development and networking is not my 
specialty but chat applications usually use plain old TCP/IP, correct? 
Is plain TCP/IP not available in Android?



Emmen Farooq wrote:

Hi , we need to make a android based chat software , now the scenario
is as follows

let I be user A and I want to use the application under developemnt ,
let the application be called friends circle , now when i log in for
the first time , the app should ask me to sign up and save my data , I
am handling xml , I dont know even what Im trying to ask

On the server I have made a database , that would store the necessary
requirements now i should somehow communicate between an SQL database
and the android phone ,

guide appropriately please



--
Sam Hobbs
Los Angeles, CA

--
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] The Force Close Error is suddenly back...

2010-07-16 Thread Victoria Busse
Okay, I set the breakpoint for getCount(); and this is what I got...

Moved [Android Application]
DalvikVM[localhost:8615]
Moved [Android Application]
DalvikVM[localhost:8615]
Thread [<3> main] (Suspended (entry into method getCount in
EditGalleryView$VideoAdapter))
EditGalleryView$VideoAdapter.getCount() line: 74
GridView.setAdapter(ListAdapter) line: 128
EditGalleryView.onCreate(Bundle) line: 28
Instrumentation.callActivityOnCreate(Activity, Bundle) line: 1047
ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord, Intent)
line: 2459
ActivityThread.startActivityNow(Activity, String, Intent, ActivityInfo,
IBinder, Bundle, Object) line: 2335
LocalActivityManager.moveToState(LocalActivityManager$LocalActivityRecord,
int) line: 127
LocalActivityManager.startActivity(String, Intent) line: 339
TabHost$IntentContentStrategy.getContentView() line: 648
TabHost.setCurrentTab(int) line: 320
TabHost.addTab(TabHost$TabSpec) line: 213
GalleryView.onCreate(Bundle) line: 28
Instrumentation.callActivityOnCreate(Activity, Bundle) line: 1047
ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord, Intent)
line: 2459
ActivityThread.handleLaunchActivity(ActivityThread$ActivityRecord, Intent)
line: 2512
ActivityThread.access$2200(ActivityThread, ActivityThread$ActivityRecord,
Intent) line: 119
ActivityThread$H.handleMessage(Message) line: 1863
ActivityThread$H(Handler).dispatchMessage(Message) line: 99
Looper.loop() line: 123
ActivityThread.main(String[]) line: 4363
Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean)
line: not available [native method]
Method.invoke(Object, Object...) line: 521
ZygoteInit$MethodAndArgsCaller.run() line: 860
ZygoteInit.main(String[]) line: 618
NativeStart.main(String[]) line: not available [native method]
Thread [<13> Binder Thread #2] (Running)
Thread [<11> Binder Thread #1] (Running)

As I am really new to all this, I don't really have clue what it means...
:p

On Fri, Jul 16, 2010 at 10:54 PM, Victoria Busse <
victoriasarabu...@gmail.com> wrote:

> Thanks :) I'll check it now...
>
>
> On Fri, Jul 16, 2010 at 10:43 PM, TreKing  wrote:
>
>> On Fri, Jul 16, 2010 at 4:41 PM, TreKing  wrote:
>>
>>> http://help.eclipse.org/helios/index.jsp
>>>
>>
>> Stupid Frames:
>>
>> http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.jdt.doc.user/tasks/task-add_line_breakpoints.htm
>>
>>
>>
>> -
>> TreKing  - Chicago
>> transit tracking app for Android-powered devices
>>
>>  --
>> 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] The Force Close Error is suddenly back...

2010-07-16 Thread Justin Anderson
Are you using Eclipse?  If you are using Eclipse, you should be able to step
through your code and examine variables and object state and step through
your code one line at a time...


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


On Fri, Jul 16, 2010 at 4:15 PM, Victoria Busse  wrote:

> Okay, I set the breakpoint for getCount(); and this is what I got...
>
> Moved [Android Application]
> DalvikVM[localhost:8615]
> Moved [Android Application]
> DalvikVM[localhost:8615]
>  Thread [<3> main] (Suspended (entry into method getCount in
> EditGalleryView$VideoAdapter))
>  EditGalleryView$VideoAdapter.getCount() line: 74
> GridView.setAdapter(ListAdapter) line: 128
>  EditGalleryView.onCreate(Bundle) line: 28
> Instrumentation.callActivityOnCreate(Activity, Bundle) line: 1047
>  ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord,
> Intent) line: 2459
>  ActivityThread.startActivityNow(Activity, String, Intent, ActivityInfo,
> IBinder, Bundle, Object) line: 2335
>  LocalActivityManager.moveToState(LocalActivityManager$LocalActivityRecord,
> int) line: 127
>  LocalActivityManager.startActivity(String, Intent) line: 339
> TabHost$IntentContentStrategy.getContentView() line: 648
>  TabHost.setCurrentTab(int) line: 320
> TabHost.addTab(TabHost$TabSpec) line: 213
>  GalleryView.onCreate(Bundle) line: 28
> Instrumentation.callActivityOnCreate(Activity, Bundle) line: 1047
>  ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord,
> Intent) line: 2459
>  ActivityThread.handleLaunchActivity(ActivityThread$ActivityRecord,
> Intent) line: 2512
>  ActivityThread.access$2200(ActivityThread, ActivityThread$ActivityRecord,
> Intent) line: 119
>  ActivityThread$H.handleMessage(Message) line: 1863
> ActivityThread$H(Handler).dispatchMessage(Message) line: 99
>  Looper.loop() line: 123
> ActivityThread.main(String[]) line: 4363
>  Method.invokeNative(Object, Object[], Class, Class[], Class, int,
> boolean) line: not available [native method]
>  Method.invoke(Object, Object...) line: 521
> ZygoteInit$MethodAndArgsCaller.run() line: 860
>  ZygoteInit.main(String[]) line: 618
> NativeStart.main(String[]) line: not available [native method]
>  Thread [<13> Binder Thread #2] (Running)
> Thread [<11> Binder Thread #1] (Running)
>
> As I am really new to all this, I don't really have clue what it means...
> :p
>
> On Fri, Jul 16, 2010 at 10:54 PM, Victoria Busse <
> victoriasarabu...@gmail.com> wrote:
>
>> Thanks :) I'll check it now...
>>
>>
>> On Fri, Jul 16, 2010 at 10:43 PM, TreKing  wrote:
>>
>>> On Fri, Jul 16, 2010 at 4:41 PM, TreKing  wrote:
>>>
 http://help.eclipse.org/helios/index.jsp

>>>
>>> Stupid Frames:
>>>
>>> http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.jdt.doc.user/tasks/task-add_line_breakpoints.htm
>>>
>>>
>>>
>>> -
>>> TreKing  - Chicago
>>> transit tracking app for Android-powered devices
>>>
>>>  --
>>> 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


Re: [android-beginners] The Force Close Error is suddenly back...

2010-07-16 Thread Victoria Busse
Alright :) okay I see what you mean now, I guess,  but for most of these
lines I get something like source not found... The JAR of this class file
belongs to container Android 2.1 - update 1 which does not allow
modifications to source attachments on its entries.


On Fri, Jul 16, 2010 at 11:18 PM, Justin Anderson
wrote:

> Are you using Eclipse?  If you are using Eclipse, you should be able to
> step through your code and examine variables and object state and step
> through your code one line at a time...
>
> --
> There are only 10 types of people in the world...
> Those who know binary and those who don't.
> --
>
>
>
> On Fri, Jul 16, 2010 at 4:15 PM, Victoria Busse <
> victoriasarabu...@gmail.com> wrote:
>
>> Okay, I set the breakpoint for getCount(); and this is what I got...
>>
>> Moved [Android Application]
>> DalvikVM[localhost:8615]
>> Moved [Android Application]
>> DalvikVM[localhost:8615]
>>  Thread [<3> main] (Suspended (entry into method getCount in
>> EditGalleryView$VideoAdapter))
>>  EditGalleryView$VideoAdapter.getCount() line: 74
>> GridView.setAdapter(ListAdapter) line: 128
>>  EditGalleryView.onCreate(Bundle) line: 28
>> Instrumentation.callActivityOnCreate(Activity, Bundle) line: 1047
>>  ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord,
>> Intent) line: 2459
>>  ActivityThread.startActivityNow(Activity, String, Intent, ActivityInfo,
>> IBinder, Bundle, Object) line: 2335
>>  LocalActivityManager.moveToState(LocalActivityManager$LocalActivityRecord,
>> int) line: 127
>>  LocalActivityManager.startActivity(String, Intent) line: 339
>> TabHost$IntentContentStrategy.getContentView() line: 648
>>  TabHost.setCurrentTab(int) line: 320
>> TabHost.addTab(TabHost$TabSpec) line: 213
>>  GalleryView.onCreate(Bundle) line: 28
>> Instrumentation.callActivityOnCreate(Activity, Bundle) line: 1047
>>  ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord,
>> Intent) line: 2459
>>  ActivityThread.handleLaunchActivity(ActivityThread$ActivityRecord,
>> Intent) line: 2512
>>  ActivityThread.access$2200(ActivityThread,
>> ActivityThread$ActivityRecord, Intent) line: 119
>>  ActivityThread$H.handleMessage(Message) line: 1863
>> ActivityThread$H(Handler).dispatchMessage(Message) line: 99
>>  Looper.loop() line: 123
>> ActivityThread.main(String[]) line: 4363
>>  Method.invokeNative(Object, Object[], Class, Class[], Class, int,
>> boolean) line: not available [native method]
>>  Method.invoke(Object, Object...) line: 521
>> ZygoteInit$MethodAndArgsCaller.run() line: 860
>>  ZygoteInit.main(String[]) line: 618
>> NativeStart.main(String[]) line: not available [native method]
>>  Thread [<13> Binder Thread #2] (Running)
>> Thread [<11> Binder Thread #1] (Running)
>>
>> As I am really new to all this, I don't really have clue what it means...
>> :p
>>
>> On Fri, Jul 16, 2010 at 10:54 PM, Victoria Busse <
>> victoriasarabu...@gmail.com> wrote:
>>
>>> Thanks :) I'll check it now...
>>>
>>>
>>> On Fri, Jul 16, 2010 at 10:43 PM, TreKing  wrote:
>>>
 On Fri, Jul 16, 2010 at 4:41 PM, TreKing  wrote:

> http://help.eclipse.org/helios/index.jsp
>

 Stupid Frames:

 http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.jdt.doc.user/tasks/task-add_line_breakpoints.htm



 -
 TreKing  - Chicago
 transit tracking app for Android-powered devices

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

Re: [android-beginners] The Force Close Error is suddenly back...

2010-07-16 Thread Kostya Vasilyev
So far so good, you've successfully hit a breakpoint. Now you need to
inspect variables (Google for Eclipse debugging basics).

Also set a breakpoint whee data is handed over to the adapter, and see which
one gets hit first.

BTW, I think adding "if (vidUris != null)" inside getCount() will fix the
crash for now, but still - learning how to debug and understand what the
code actually does during execution is instrumental to any further
development work you plan on doing.
--
Kostya Vasilyev -- http://kmansoft.wordpress.com

17.07.2010 2:15 пользователь "Victoria Busse" 
написал:

Okay, I set the breakpoint for getCount(); and this is what I got...

Moved [Android Application]
DalvikVM[localhost:8615]
Moved [Android Application]
DalvikVM[localhost:8615]
 Thread [<3> main] (Suspended (entry into method getCount in
EditGalleryView$VideoAdapter))
 EditGalleryView$VideoAdapter.getCount() line: 74
GridView.setAdapter(ListAdapter) line: 128
 EditGalleryView.onCreate(Bundle) line: 28
Instrumentation.callActivityOnCreate(Activity, Bundle) line: 1047
 ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord, Intent)
line: 2459
 ActivityThread.startActivityNow(Activity, String, Intent, ActivityInfo,
IBinder, Bundle, Object) line: 2335
 LocalActivityManager.moveToState(LocalActivityManager$LocalActivityRecord,
int) line: 127
 LocalActivityManager.startActivity(String, Intent) line: 339
TabHost$IntentContentStrategy.getContentView() line: 648
 TabHost.setCurrentTab(int) line: 320
TabHost.addTab(TabHost$TabSpec) line: 213
 GalleryView.onCreate(Bundle) line: 28
Instrumentation.callActivityOnCreate(Activity, Bundle) line: 1047
 ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord, Intent)
line: 2459
 ActivityThread.handleLaunchActivity(ActivityThread$ActivityRecord, Intent)
line: 2512
 ActivityThread.access$2200(ActivityThread, ActivityThread$ActivityRecord,
Intent) line: 119
 ActivityThread$H.handleMessage(Message) line: 1863
ActivityThread$H(Handler).dispatchMessage(Message) line: 99
 Looper.loop() line: 123
ActivityThread.main(String[]) line: 4363
 Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean)
line: not available [native method]
 Method.invoke(Object, Object...) line: 521
ZygoteInit$MethodAndArgsCaller.run() line: 860
 ZygoteInit.main(String[]) line: 618
NativeStart.main(String[]) line: not available [native method]
 Thread [<13> Binder Thread #2] (Running)
Thread [<11> Binder Thread #1] (Running)

As I am really new to all this, I don't really have clue what it means...
:p



On Fri, Jul 16, 2010 at 10:54 PM, Victoria Busse <
victoriasarabu...@gmail.com> wrote:
>
> Thanks :...

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

-- 
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] The Force Close Error is suddenly back...

2010-07-16 Thread Victoria Busse
I will definitely read and learn about debugging now...Thanks :)))

The way you said works...

public int getCount() {
//return mThumbIds.length;
   if(vidUris!=null){
 return vidUris.length;}
return 0;
}
...but the videos don't show up, so I still have a problem with retrieving
the videos from the SD card :(

2010/7/16 Kostya Vasilyev 

> So far so good, you've successfully hit a breakpoint. Now you need to
> inspect variables (Google for Eclipse debugging basics).
>
> Also set a breakpoint whee data is handed over to the adapter, and see
> which one gets hit first.
>
> BTW, I think adding "if (vidUris != null)" inside getCount() will fix the
> crash for now, but still - learning how to debug and understand what the
> code actually does during execution is instrumental to any further
> development work you plan on doing.
> --
> Kostya Vasilyev -- http://kmansoft.wordpress.com
>
> 17.07.2010 2:15 пользователь "Victoria Busse" 
> написал:
>
>
> Okay, I set the breakpoint for getCount(); and this is what I got...
>
> Moved [Android Application]
> DalvikVM[localhost:8615]
> Moved [Android Application]
> DalvikVM[localhost:8615]
>  Thread [<3> main] (Suspended (entry into method getCount in
> EditGalleryView$VideoAdapter))
>  EditGalleryView$VideoAdapter.getCount() line: 74
> GridView.setAdapter(ListAdapter) line: 128
>  EditGalleryView.onCreate(Bundle) line: 28
> Instrumentation.callActivityOnCreate(Activity, Bundle) line: 1047
>  ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord,
> Intent) line: 2459
>  ActivityThread.startActivityNow(Activity, String, Intent, ActivityInfo,
> IBinder, Bundle, Object) line: 2335
>  LocalActivityManager.moveToState(LocalActivityManager$LocalActivityRecord,
> int) line: 127
>  LocalActivityManager.startActivity(String, Intent) line: 339
> TabHost$IntentContentStrategy.getContentView() line: 648
>  TabHost.setCurrentTab(int) line: 320
> TabHost.addTab(TabHost$TabSpec) line: 213
>  GalleryView.onCreate(Bundle) line: 28
> Instrumentation.callActivityOnCreate(Activity, Bundle) line: 1047
>  ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord,
> Intent) line: 2459
>  ActivityThread.handleLaunchActivity(ActivityThread$ActivityRecord,
> Intent) line: 2512
>  ActivityThread.access$2200(ActivityThread, ActivityThread$ActivityRecord,
> Intent) line: 119
>  ActivityThread$H.handleMessage(Message) line: 1863
> ActivityThread$H(Handler).dispatchMessage(Message) line: 99
>  Looper.loop() line: 123
> ActivityThread.main(String[]) line: 4363
>  Method.invokeNative(Object, Object[], Class, Class[], Class, int,
> boolean) line: not available [native method]
>  Method.invoke(Object, Object...) line: 521
> ZygoteInit$MethodAndArgsCaller.run() line: 860
>  ZygoteInit.main(String[]) line: 618
> NativeStart.main(String[]) line: not available [native method]
>  Thread [<13> Binder Thread #2] (Running)
> Thread [<11> Binder Thread #1] (Running)
>
> As I am really new to all this, I don't really have clue what it means...
> :p
>
>
>
> On Fri, Jul 16, 2010 at 10:54 PM, Victoria Busse <
> victoriasarabu...@gmail.com> wrote:
> >
> > Thanks :...
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Beginners" gr...
>
>  --
> 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] ActivityNotFoundException and txt files

2010-07-16 Thread Harald
I am trying to open at .txt file in the standard file editor, I tryed
this code but all I get is an ActivityNotFoundException

File root = Environment.getExternalStorageDirectory();
File f = new File(root, "/Android/data/HKKalender/
stdtekster.txt");

try {
Intent intent = new Intent(Intent.ACTION_EDIT);
intent.setDataAndType(Uri.fromFile(f), "text/plain");
startActivity(intent);
} catch (Exception e) { }

-- 
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: ActivityNotFoundException and txt files

2010-07-16 Thread DanH
http://developer.android.com/reference/android/content/ActivityNotFoundException.html
:

"This exception is thrown when a call to startActivity(Intent)  or one
of its variants fails because an Activity can not be found to execute
the given Intent."

On Jul 16, 6:27 pm, Harald  wrote:
> I am trying to open at .txt file in the standard file editor, I tryed
> this code but all I get is an ActivityNotFoundException
>
>                 File root = Environment.getExternalStorageDirectory();
>                 File f = new File(root, "/Android/data/HKKalender/
> stdtekster.txt");
>
>                 try {
>                 Intent intent = new Intent(Intent.ACTION_EDIT);
>                 intent.setDataAndType(Uri.fromFile(f), "text/plain");
>                 startActivity(intent);
>                 } catch (Exception e) { }

-- 
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] Can soundpool be made to play sounds and record them at the same time?

2010-07-16 Thread Traveler
I am working on an Android app that generates sounds. Is it possible
to generate these sounds and record them at the same time using
soundpool? The opject is to send the recording to another Droid after
the initial sounds are generated with my Droid. Thanks for any advice.

-- 
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: ActivityNotFoundException and txt files

2010-07-16 Thread Harald
Is there any way to fix it so that Android know how to open .txt
files, or can I somehow in my code tell Android to use File Editor to
open/edit .txt files.

-- 
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: ActivityNotFoundException and txt files

2010-07-16 Thread Mark Murphy
On Fri, Jul 16, 2010 at 8:26 PM, Harald  wrote:
> Is there any way to fix it so that Android know how to open .txt
> files, or can I somehow in my code tell Android to use File Editor to
> open/edit .txt files.

I do not know what "File Editor" is. If that is some third party text
editor, contact the author to see how to integrate your code with
theirs.

There is no text editor built into Android.

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

_The Busy Coder's Guide to Android Development_ Version 3.1 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: Including libraries in project

2010-07-16 Thread kypriakos

So it is fair to say = Android bytecode != 3rd party code bytecode
(particularly
from IBM or SUN or Axis)? So the reason I am not seeing the libraries
(which
otherwise helped me compile my imported app in Eclipse) in the apk
file
is because they are not recognized by the Android platform? Unless I
obtain
the source code for all those libs and try to compile and fix the
millions of
errors that will probably appear, I won't be able to use them? Is that
a fair
statement? Oh o ...

Thanks

On Jul 16, 4:31 pm, kypriakos  wrote:
> Hi all,
>
> I managed to compile the imported application (the trick was not to
> just
> throw the lib directory in the project but to also build a library out
> of  the
> jars and present that in the project class path). However, I am
> noticing
> in DDMS (and in debug perspective) when I launch the app that one of
> the
> threads quits and complains that:
> "Failed resolving Lcom/myApp/PeerToPeerAdapter: interface 211 Lnet/
> wlib/PeerGen".
>
> I can see the net/lib/PeerGen in the jar files included in the library
> that
> is in the classpath. Afterall it compiles fine. Why does it complain
> at runtime? Doesn't the Android plugin package what it needs in the
> dex,
> apk and res_ files before it deploys the app in the emulator?
> I could not find anything on this in the resources so I am wondering
> if
> anyone had this issue before - It could be trivial and I am missing
> something
> very obvious.
>
> 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