[android-developers] save to sd

2010-08-26 Thread charles berman
I am struggling with this, if the image doesnt exist hello.jpg it does
create a new file, but when i execute the line of  FileOutputStream out =
new FileOutputStream(file);, i get a filenotfoundexception.

public static Bitmap getImage(String fileUrl)
{
Bitmap bitmap = null;
 InputStream in = null;
URL url;
 // Check to see if image allready exists
String imgName = fileUrl.substring(fileUrl.lastIndexOf(/)+1);
 String sdPath = /Barfly/+imgName;
 File imgFile = new File(sdPath);
 if (imgFile.exists())
{
 bitmap =  BitmapFactory.decodeFile(sdPath);
}
else
 {
try {
url = new URL(fileUrl);
 URLConnection ucon = url.openConnection();
in  = ucon.getInputStream();
 bitmap = BitmapFactory.decodeStream(in);
in.close();
File path = Environment.getExternalStorageDirectory();
 File dir = File(path,Barfly);

File file = new File(dir,imgName);
 boolean result = file.mkdirs();
result = file.createNewFile();
  try
{

 FileOutputStream out = new FileOutputStream(file);
bitmap.compress(Bitmap.CompressFormat.JPEG, 90, out);
}
catch (Exception e) {
   e.printStackTrace();
}
  }
catch (MalformedURLException e)
 {
 e.printStackTrace();
 }
catch (FileNotFoundException e)
{
 e.printStackTrace();
}
 catch (IOException e)
{
}
 catch (Exception e)
{
e.printStackTrace();
 }
}
 return bitmap;
 }
Charles Berman
313.790.9851

www.charlesberman.com

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] multi select listbox

2010-08-16 Thread charles berman
is there the ability to create a multi select listbox for preferences? or
has someone seen some sample code that could be used to do the same thing? I
would need to customize it but currently am stuck with only one choice when
i should allow the user to have several.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] webview issues with listview.

2010-08-16 Thread charles berman
Im having some problems with my application and while i think i know what is
causing it, im not completely sure how to fix it.

my application searches a website and adds entries to a database and then
displays the users in a listview with a cursoradaptor.

when the entries are first displayed, i get an sql finalize error. I thought
maybe i had something to do with my cursoradaptor but it never shows its
head until after i exit my newview or bind view and even then, it is only
displayed once.

my other idea was that maybe it has something to do with the fact that im
using a webview. I used the webview because allthough it seems quicker to
load the profile images to the listview. I do have issues because the images
arent all loaded at once, and once i scroll down, the new images are
displayed and some of the first images until the real image for the user is
downloaded ( i dont really know how to describe that correctly)

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Cursor Finalize

2010-08-10 Thread charles berman
i am extending  a CursorAdaptor  and the first time that newview is called,
i constantly come up with a cursor finalize error that i am having a
difficult time tracking down.


Ill supply all of the info that i can, but i dont know where to start other
than


@Override
public View newView(Context context, Cursor cursor, ViewGroup parent) {


 final View view = mInflater.inflate(R.layout.entry_row, parent,
false);

  return view;

}

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Cursor Finalize

2010-08-10 Thread charles berman
yes it is. It only faults out the first time that this is called as well


On Tue, Aug 10, 2010 at 10:42 AM, Kostya Vasilyev kmans...@gmail.comwrote:

 The place to start is logcat output, up to and including Caused by line
 and its output.

 Is mInflater initialized ?

 -- Kostya

 10.08.2010 18:20, charles berman пишет:

 i am extending a CursorAdaptor and the first time that newview is called,
 i constantly come up with a cursor finalize error that i am having a
 difficult time tracking down.


 Ill supply all of the info that i can, but i dont know where to start
 other than


 @Override
 public View newView(Context context, Cursor cursor, ViewGroup parent) {


 final View view = mInflater.inflate(R.layout.entry_row, parent, false);

 return view;

 }
 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?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 Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] either im only registering textview and webview clicks or im not getting my listitemclick

2010-08-02 Thread charles berman
i may get flamed for this question, but help me do it right. I was
downloading images from a website and putting them into a database, and then
displaying them in an imageview. well to reduce the size of my database, i
changed from an imageview to a webview and now only do a
Webview.Loaddata(ImageLink). all of this is contained within a listactivity.
my problem seems to be that for whatever reason now i dont seem to be
capturing the Listclick event any longer


XML

?xml version=1.0 encoding=utf-8?

LinearLayout xmlns:android=http://schemas.android.com/apk/res/android;
android:background = @color/ImageColor android:orientation = horizontal
android:layout_width=fill_parent android:layout_height=wrap_content

LinearLayout xmlns:android=http://schemas.android.com/apk/res/android;
android:background = @drawable/bluebg android:orientation = vertical
android:layout_width=wrap_content android:layout_height=wrap_content


WebView android:id=@+id/image android:padding = 5pt
android:color=@color/ImageColor
android:paddingTop =20pt
android:layout_width=80px
android:background = @drawable/myimage
android:layout_height=95px/

/LinearLayout
LinearLayout xmlns:android=http://schemas.android.com/apk/res/android;
android:background = @drawable/bluebg android:orientation = vertical
android:layout_width=fill_parent android:layout_height=wrap_content

TextView android:id=@+id/title android:text=title
 android:paddingRight= 2pt
 android:paddingLeft= 2pt
 android:background = @android:color/transparent
 android:layout_width=fill_parent
 android:layout_height=wrap_content/
/LinearLayout

/LinearLayout


Charles Berman
313.790.9851

www.charlesberman.com

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] listactivity within a layout

2010-07-27 Thread charles berman
I know this may be a pretty simple question, but im having problems trying
to find what im looking for.

I have  written an application that uses a listview activity. but  now that
i think more about it, i would like to have other items included to give the
status of the app, etc that i just want to be displayed and not scrolled so
it wont be entered into the database. does anyone have a good link to an
example for this

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] CursorAdapter Problem

2010-07-26 Thread charles berman
can anyone tell me what im doing wrong with my cursorAdapter?
 its making my display choppy when i scroll. I used to have it within a
getview but was ripped (rightfully so) on IRC several times because thats
not the right place for it. Im still learning and just trying to correctly
wrap my head around things.

http://pastebin.com/Dc5ppHUM

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: CursorAdapter Problem

2010-07-26 Thread charles berman
Brian,

Thank you for the response. I previously had it setup as a
SimpleCursorAdaptor and that is why i was using the getView(). I did as you
suggested,
Charles Berman



On Mon, Jul 26, 2010 at 11:44 AM, blcooley blcoo...@gmail.com wrote:

 For a CursorAdapter, you don't normally Override getView. Instead,
 you'll do all that work in bindView, which takes a Cursor as an
 argument (this Cursor is the one that you provide when you instantiate
 a new CursorAdapter for your ListView).

 So, basically, you can move your implementation of getView into
 bindView and clean it up a bit (e.g., you won't have to instantiate a
 Cursor, just use the one that is passed in), then remove getView from
 your implementation.

 Best regards,
 Brian Cooley

 On Jul 26, 9:50 am, charles berman charles.heath.ber...@gmail.com
 wrote:
  can anyone tell me what im doing wrong with my cursorAdapter?
   its making my display choppy when i scroll. I used to have it within a
  getview but was ripped (rightfully so) on IRC several times because thats
  not the right place for it. Im still learning and just trying to
 correctly
  wrap my head around things.
 
  http://pastebin.com/Dc5ppHUM

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] get ZipCode

2010-07-20 Thread charles berman
is there an easy way to determine the phones current zipcode using the
location provider?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] basic website integration

2010-05-03 Thread charles berman
can someone help to point me into the right direction for a program that i
have been trying to plan..

im trying to log into a website, and have found plenty of information to do
it, but it seems that once i log into it, i dont get any confirmation.

the second task i want to do is to be able to log into the different aspects
of it (search for people) etc, but i dont know what the correct way to do
this would be.

my basic idea is to log into a website, and then to find people in my area,
and populate them to a list. the second part to that task would be to use
the gps or coarse location feature to find out how far we are from each
other.

Im not looking for the solution, but more of a point into the right
direction for these things. i have googled my heart out but have come up
with nothing that is helpful or really point me in the right direction.
maybe im just using the wrong keywords?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en