[android-beginners] Re: ActivityNotFoundException and txt files

2010-07-17 Thread Harald
ok, thank you. I thourth that File Editor was a build in Android text
editor since I have 3 File Manager program installed and they all
open .txt files i the File Editor program.


On 17 Jul., 03:07, Mark Murphy mmur...@commonsware.com wrote:
 On Fri, Jul 16, 2010 at 8:26 PM, Harald harald.kron...@gmail.com 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/commonsguyhttp://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-17 Thread DanH
That's not been my impression, and when I browse an Android class file
with a hex editor it says CAFEBABE.

On Jul 16, 11:48 pm, kypriakos demet...@ece.neu.edu wrote:
 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 demet...@ece.neu.edu 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


Re: [android-beginners] Re: Including libraries in project

2010-07-17 Thread Kostya Vasilyev
During compilation, Android tools use standard Java .class format, as 
you found out.


However, during application packaging (I think) they are converted into 
Dalvik's special format, .dex, which does not use Sun's Java bytecode.


If you list the contents of an .apk file, you will see one .dex file 
instead of multiple .class files, as would be the case with a regular 
Java application.


http://en.wikipedia.org/wiki/Dalvik_(software)

-- Kostya

17.07.2010 17:06, DanH пишет:

That's not been my impression, and when I browse an Android class file
with a hex editor it says CAFEBABE.

On Jul 16, 11:48 pm, kypriakosdemet...@ece.neu.edu  wrote:
   

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, kypriakosdemet...@ece.neu.edu  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
   
   



--
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] I have a problem with android2.2 Launcher2.apk

2010-07-17 Thread LG ZHU
hi,all

I have a problem with android2.2  Launcher2.apk ,  I  find it also on
emulator .
why I cant not move focus on launcher panel  homebutton  when use mouse roll
down or down focus.

after  I do like this

   1. adb pull Launcher2.apk from /system/app
   2. delete Launcher2.apk  from emulator
   3. adb push Launcher2.apk in /system/app

 it will be ok like this ,I can move focus on this icon .like this image


why ?  please help me. when i make a  system.imgit also like  this
problem.

I must  adb pull Launcher2.apk  after  adb push this apk , it can be work ok
. or it can not move focus .

-- 
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-17 Thread DanH
It seems a little odd that Android is supposedly open, yet Dalvik is
essentially undocumented.

On Jul 17, 8:13 am, Kostya Vasilyev kmans...@gmail.com wrote:
 During compilation, Android tools use standard Java .class format, as
 you found out.

 However, during application packaging (I think) they are converted into
 Dalvik's special format, .dex, which does not use Sun's Java bytecode.

 If you list the contents of an .apk file, you will see one .dex file
 instead of multiple .class files, as would be the case with a regular
 Java application.

 http://en.wikipedia.org/wiki/Dalvik_(software)

 -- Kostya

 17.07.2010 17:06, DanH пишет:



  That's not been my impression, and when I browse an Android class file
  with a hex editor it says CAFEBABE.

  On Jul 16, 11:48 pm, kypriakosdemet...@ece.neu.edu  wrote:

  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, kypriakosdemet...@ece.neu.edu  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

 --
 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] Notification.FLAG_NO_CLEAR not working as expected

2010-07-17 Thread Bret Foreman
I'm setting my notification like this:

notification.defaults |= Notification.FLAG_NO_CLEAR;

I expect this to mean that pressing the clear button in the expanded
notification screen will not clear this notification. But the button
still clears the notification.

I think this may be a permissions problem in my manifest. I currently
have a uses permission android.permission.VIBRATE set. Do I need any
other permissions to make a notification sticky?

-- 
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] Help, please - How to display videos as thumbs?

2010-07-17 Thread Victoria Busse
Hey I just saw that I forgot s.th. within  getCount(), so I changed it to

 public int getCount() {
   //return mThumbIds.length;
  if(vidUris!=null){
   return vidUris.length;}
   return 0;
   }

The thing now is that I still cannot see any videos displayed in my
GridView, but I get a message saying: Sorry, but this video cannot be
played!

As I don't want to play the videos but only display them in the GridView
like in an directory, do I maybe have to use MediaStore.Video.Thumbnails
instead, which I just found when I googled a little...though I don't know
what I should do with it in my code...if someone could help me out here,
that would be really really great... Thanks


On Sat, Jul 17, 2010 at 11:15 AM, Victoria victoriasarabu...@gmail.comwrote:

 Hi there,

 I am looking for a way to display the videos as thumbnails from my
 sdcard in a GridView. The way I tried doesn't seem to work, they don't
 show in the emulator...but I have no idea where I have done something
 wrong. If someone could give me a hand here, that would be great.
 Thank you very much in advance. Cheers.

 This is the code I am using to access the videos:

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());

 ArrayListUri experimentVids = new
 ArrayListUri();


 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;
   if(vidUris!=null){
return vidUris.length;}
return 0;
}


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) {
   VideoView videoView;
if (convertView == null) {  // if it's not recycled,
 initialize some attributes
videoView = new VideoView(mContext);
videoView.setVideoURI(vidUris[position]);
videoView.setLayoutParams(new
 GridView.LayoutParams(85, 85));
   //
 videoView.setScaleType(VideoView.ScaleType.CENTER_CROP);
videoView.setPadding(8, 8, 8, 8);
} else {

[android-beginners] Tabs + framelayout children

2010-07-17 Thread tim
Hi,

   I'm playing around with APIDemo's Views-Tabs-Content by Intent.
It seems that when I switched to a tab, there is a new additional
FrameLayout child which contains the tab content. So if I clicked on
Tab1, then it'll add one child to FrameLayout, then Tab2, adds the 2nd
child and so on. Say I have all 3 children in FrameLayout, how do i
know if I click on Tab1, which FrameLayout child does it corresponds
to?

Thanks,
-Tim

-- 
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] If and How to get video thumbnails

2010-07-17 Thread Victoria
Hi,
I am working on a video app. And I have created a GridView that shall
display any video stored on the sdcard. Currently it only displays the
name of the video file.

I wanted to ask if and how it would be possible instead of showing
only the name to also display thumbs (or a frame preview) of the
videos ?!?

I would be grateful for any help...thanks.



 I wanted to ask if and how it would be possible instead of showing
only the name to also display thumbs (or a frame preview) of the
videos ?!?

I would be grateful for any help...thanks.

This is the code I have used so far:

package com.mobilevideoeditor.moved;

import android.app.Activity;
import android.content.Context;
import android.database.Cursor;
import android.os.Bundle;
import android.provider.MediaStore;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.TextView;




public class EditGalleryView extends Activity {
private Cursor videocursor;
private int video_column_index;
int count;

public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.videogrid);



init_phone_video_grid();




}

private void init_phone_video_grid() {
System.gc();
String[] proj = {
MediaStore.Video.Media._ID,
MediaStore.Video.Media.DISPLAY_NAME,
MediaStore.Video.Media.DATA
};

videocursor =
managedQuery(MediaStore.Video.Media.EXTERNAL_CONTENT_URI, proj, null,
null, null);
count = videocursor.getCount();
GridView vGrid=(GridView) findViewById(R.id.vgrid);
vGrid.setAdapter(new VideoAdapter(this));
}


public class VideoAdapter extends BaseAdapter {
private Context vContext;

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

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


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) {
  System.gc();
  TextView tv = new
TextView(vContext.getApplicationContext());
  String id = null;
  if (convertView == null) {
video_column_index =
 
videocursor.getColumnIndexOrThrow(MediaStore.Video.Media.DISPLAY_NAME);
videocursor.moveToPosition(position);
id = videocursor.getString(video_column_index);

tv.setText(id);
  } else
tv = (TextView) convertView;
  return tv;
}



}

-- 
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-17 Thread kypriakos

Really? That would make me feel much better. But older postings and
some
sources supported that in general external jars may not work under
Android
and that their corresponding source should be compiled with its SDK
before
they can be used - which throws reusability out of the window. In any
case,
then it makes no sense as to why the classes are not visible in the
emulator
even though I (finally) managed to include the jars in the apk -
having them in
the classpath does not do it. Including them in the assets dir will ..
unless
someone else knows of a better way to do it ( I did use the export and
order
and no it doesn't work).

Thanks Dan

On Jul 17, 9:06 am, DanH danhi...@ieee.org wrote:
 That's not been my impression, and when I browse an Android class file
 with a hex editor it says CAFEBABE.

 On Jul 16, 11:48 pm, kypriakos demet...@ece.neu.edu wrote: 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 demet...@ece.neu.edu 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