[android-beginners] Re: database

2010-08-08 Thread DanH
You can build the database on any platform (perhaps using a tool like
SQLite Expert) and upload it to Android.  The trick is that you have
get it from wherever you upload it into the app's database directory
(plus add a few extra records that Android wants).  Some info here:

http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/

On Aug 8, 10:59 am, Tanay M. Kapoor tmkap...@gmail.com wrote:
 i need to add a large amount of data to an android database i have
 created. Is there any tool i can use to do this instead of making an
 activity to write and manually add the data. My application need only
 display the data not add new thigns to the datdbase.
 Please help...

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

ATTENTION: Android-Beginners will be permanently disabled on August 9 2010. For 
more information about this change, please read [http://goo.gl/xkfl] or visit 
the Group home page.

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] Farewell, we hardly knew ye

2010-08-07 Thread DanH
May it rest in peace.

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

ATTENTION: Android-Beginners will be permanently disabled on August 9 2010. For 
more information about this change, please read [http://goo.gl/xkfl] or visit 
the Group home page.

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: SQLiteConstraintException: error code 19: constraint failed when deleting from sqlite

2010-07-29 Thread DanH
SELECT RAISE(FAIL,'album has songs cannot be deleted'));

On Jul 29, 5:43 am, manigault manig...@gmail.com wrote:
 Hi all, i have simple relation between songs and albums one to many.
 I created the album table like this
 CREATE TABLE albums
 (id INTEGER PRIMARY KEY ASC,
 name TEXT,
 additional TEXT)

 My song table is like this
 StringBuilder sqlQuery = new StringBuilder();
 CREATE TABLE songs
 (id INTEGER PRIMARY KEY ASC,
 album_fk INTEGER NOT NULL,
 title TEXT,
 url TEXT,
 duration BIGINT NOT NULL)

 and i have trigger to check when i wan't to delete an album if there
 are songs in it
 CREATE TRIGGER trigger_on_delete
 BEFORE DELETE ON albums
 FOR EACH ROW BEGIN
 SELECT RAISE(FAIL,'album has songs cannot be deleted'));
 WHERE (SELECT album_fk FROM songs WHERE album_fk = OLD.id) IN NOT
 NULL;)
 END

 and everything is ok and its working fine. But sometimes i got this
 error
 Exception: android.database.sqlite.SQLiteConstraintException: error
 code 19: constraint failed
 Stack Trace :
 android.database.sqlite.SQLiteStatement.native_execute(Native Method)
 android.database.sqlite.SQLiteStatement.execute(SQLiteStatement.java:
 66)
 when i am trying to delete an album. I know what #define
 SQLITE_CONSTRAINT  19   /* Abort due to constraint violation */ stands
 for but i can't what constraints can be violated when deleting an
 album.
 I can't reproduce this so i can't debug it to find out what's the
 problem any ideas what could go wrong and cause such error. I've tried
 playing with string encoding but i think that's not the problem.

-- 
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: InstantiationException when starting IntentService

2010-07-29 Thread DanH
InstantiationException occurs when an exception is thrown out of a
constructor.  Generally there should be another exception reported as
causing the InstantiationException, and the stack trace should point
to the specific lines that are in error.  Stack trace is your friend,
and you should be grateful -- their are poor children programming on
Symbian devices who have no stack trace.

On Jul 29, 11:24 am, Wall-E bashee...@gmail.com wrote:
 I am trying to start an IntentService inside my Broadcast Receiver
 ( so inside of onReceive() ):

     public class SmsMessageReceiver extends BroadcastReceiver
     {
         .
         .
         .
         public void onReceive(.)
         {
              .
              .
              .
              Intent mServiceIntent = new Intent(context,
 SmsParserService.class );
              mServiceIntent.putExtra(phoneNumber, fromAddress);
              mServiceIntent.putExtra(smsMessage,
 message.getMessageBody());
                context.startService(mServiceIntent);
         }

     }

     So if I change the IntentService class to a regular Service class,
 although it has funny behavior, it still goes into the
 onStartCommand(...) and onCreate() methods, but for the IntentService,
 before going into any of those methods it throws an
 InstantiationException and in the detailMessage it just says
 com.tvismobile.SmsParserService which is what my Service is labeled
 as in the Manifest file.

 Is there something special you have to do to get IntentService
 started?

 Any help is appreciated.

-- 
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: Keeping some data in memory during onDestroy-onCreate

2010-07-29 Thread DanH
1) Display the values on the screen and have the user write them down.

2) Learn how to write to a file.

3) Use a constantly-running server to store them.

On Jul 29, 10:37 am, Bret Foreman bret.fore...@gmail.com wrote:
 I want to monitor the velocity of a phone. I can do this by looking at
 accelerometer data over the last 30 seconds, saving about one sample
 every 0.1 seconds (300 samples) and applying a sliding filter to the
 data. If I create a service to do this, what's the best way to
 preserve the state of the filter (600 doubles) between an onDestroy
 and a subsequent onCreate? I can set up an SQLite table to hold the
 values but that's a lot of extra coding and processing overhead. Is
 there a better way?

-- 
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: Unable to deploy apps to AVD using Eclipse

2010-07-27 Thread DanH
Looks like the app is loaded.  See if you can find it through the
menu.

On Jul 27, 10:45 am, Abduaziz Hasan affa...@gmail.com wrote:
 I give up

 I tried and tried and tried but nothing is coming :(

 this is the log from my Win7 machine:

 ___
 [2010-07-27 18:12:47 - TestAnd] Android Launch!
 [2010-07-27 18:12:47 - TestAnd] adb is running normally.
 [2010-07-27 18:12:47 - TestAnd] Performing gosi.gest.Testme activity launch
 [2010-07-27 18:12:47 - TestAnd] Automatic Target Mode: launching new
 emulator with compatible AVD 'my_avd'
 [2010-07-27 18:12:47 - TestAnd] Launching a new emulator with Virtual Device
 'my_avd'
 ___

 Ubuntu machine
 ___
 [2010-07-27 08:40:05 - MyFirstAndroid] Android Launch!
 [2010-07-27 08:40:05 - MyFirstAndroid] adb is running normally.
 [2010-07-27 08:40:05 - MyFirstAndroid] Performing com.and.StartForm activity
 launch
 [2010-07-27 08:40:05 - MyFirstAndroid] Automatic Target Mode: launching new
 emulator with compatible AVD 'my_avd'
 [2010-07-27 08:40:05 - MyFirstAndroid] Launching a new emulator with Virtual
 Device 'my_avd'
 [2010-07-27 08:40:38 - MyFirstAndroid] New emulator found: emulator-5554
 [2010-07-27 08:40:38 - MyFirstAndroid] Waiting for HOME
 ('android.process.acore') to be launched...
 [2010-07-27 08:41:25 - MyFirstAndroid] WARNING: Application does not specify
 an API level requirement!
 [2010-07-27 08:41:25 - MyFirstAndroid] Device API version is 8 (Android 2.2)
 [2010-07-27 08:41:25 - MyFirstAndroid] HOME is up on device 'emulator-5554'
 [2010-07-27 08:41:25 - MyFirstAndroid] Uploading MyFirstAndroid.apk onto
 device 'emulator-5554'
 [2010-07-27 08:41:25 - MyFirstAndroid] Installing MyFirstAndroid.apk...
 [2010-07-27 08:42:07 - MyFirstAndroid] Success!
 [2010-07-27 08:42:07 - MyFirstAndroid] Starting activity com.and.StartForm
 on device
 [2010-07-27 08:42:10 - MyFirstAndroid] ActivityManager: Starting: Intent {
 act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER]
 cmp=com.and/.StartForm }
 

 As you can see that the Win7 doesn't deploy the app.

 On Tue, Jul 27, 2010 at 2:57 AM, Sam Hobbs s...@samhobbs.org wrote:
  Evidently there are two versions of DEP; the earlier version is done using
  software and a newer version that uses hardware. The hardware version exists
  only in 64-bit processors and is used only by 64-bit Windows.

  DEP can prevent code from being executed that is in memory designated as
  data. It makes sense that a DEP would be a problem for a VM. DEP can be
  enabled/disabled for specific processes.

  I hope the following helps.

  A description of the differences between 32-bit versions of Windows Vista
  and 64-bit versions of Windows Vista
 http://support.microsoft.com/kb/946765

  Data Execution Prevention
 http://msdn.microsoft.com/en-us/library/aa366553(VS.85).aspx

  A detailed description of the Data Execution Prevention (DEP) feature in
  Windows XP Service Pack 2, Windows XP Tablet PC Edition 2005, and Windows
  Server 2003
 http://support.microsoft.com/kb/875352

  DanH wrote:

  Note that a lot of things (like Data Execution Protection) appear to
  be unique to the 64-bit version of Windoze, so folks with 32-bit
  machines will have no problem.

  --
  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.comandroid-beginners%2bunsubscr...@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: problem with r,java

2010-07-26 Thread DanH
R.java should be in the gen directory of your project, and further
nested (if you observe it in the file system) by the directories of
your project path.

If you installed the Android add-on for Eclipse R.java should be
automatically created, but I don't recall if it's created immediately
after you create the project, or during the first build you do.

Of course, the R.java file is generated from the several files in the
res directory, so if there's something wrong there it may not be
generated.

On Jul 26, 1:56 am, G Ganesh ganesh.in.andr...@gmail.com wrote:
 Hi,
      I am new to android. I am now familiar on how to create project
 and know what are the files that will b generated. I know that the
 file, r.java will be created automatically when a project is being
 created but i cant find r,java file when i create a new project.Witout
 creating this r.java i find more error on my code side.

      I even closed and opened the project several times and even
 closed and opened  my eclipse IDE too but i could'nt find the way to
 it. I even tried with answer that came from forums but no way still i
 am fuzzing with it.
 I am using eclipse 3.5

      pls give me the best of the answer and the reason too.Any help or
 reference is appreciated on this

-- 
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: JNI in android

2010-07-26 Thread DanH
You shouldn't have a void* in any of the JNI C interfaces.  If you
need a void* that Java code can pass around you should wrapper the
value with a Java object.

Callback would be handled with the invocation interface.

On Jul 26, 1:26 am, sowmya ajaychalas...@gmail.com wrote:
 Hi
  I want to port c library in android for that i am writing native
 interface
 my c library contains generic pointers like void* .how can i define
 these in java jni files .do i need to define as byte[] and typecast
 in .cpp ?
 Also i want to know how to handle the callbacks from c library in jni

-- 
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: Unable to deploy apps to AVD using Eclipse

2010-07-26 Thread DanH
Also, I have run Eclipse under Administrator role which in turn will
invoke any process as trusted.

Norton seems to mistrust Administrator stuff more than ordinary user
stuff.

Note that a lot of things (like Data Execution Protection) appear to
be unique to the 64-bit version of Windoze, so folks with 32-bit
machines will have no problem.

On Jul 26, 1:10 pm, Abduaziz Hasan affa...@gmail.com wrote:
 @Sam

 Thank you for your support.

 I have tried different configurations and disabled the antivirus and the
 firewall though I doubt this is related to anyone of them.

 @DanH

 Yes that is right, but considering the large number of developers who are
 using the SDK without any problem leave me with one option and that is a
 problem with the configuration.

  BTW my antivirus is Avast home. Also, I have run Eclipse under
 Administrator role which in turn will invoke any process as trusted. Yet no
 results :(

 I will delete everything from my computer and start everything fresh as my
 Ubuntu is very slow under VMware.

 2010/7/26 Kostya Vasilyev kmans...@gmail.com

  No problems with NOD32 here either.

  Running Windows 7 64bit.

  --
  Kostya Vasilyev --http://kmansoft.wordpress.com

  26.07.2010 1:10 пользователь Sam Hobbs s...@samhobbs.org написал:

  Many people have had problems with Norton. It was pre-installed in my
  system but I cleared it out of my system and installed Microsoft Security
  Essentials, which is free. I am not recommending anything except to say that
  I have had no problems that I am aware of related to AV software and I have
  not modified the installation of the AV software for Eclipse or the Android
  emulator or whatever.

  In my previous system, I used avast and I used various virtual systems and
  I had no problem with avast.

  DanH wrote:

   BTW, I'm using Norton Internet Security.  I've turned off Insight,
    Antispy...

  --
  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.comandroid-beginners%2bunsubscr...@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: Unable to deploy apps to AVD using Eclipse

2010-07-25 Thread DanH
Could be a problem with blanks in the path.  Lots of tools have
trouble with that, especially cross-platform tools.

On Jul 25, 4:01 am, Abduaziz Hasan affa...@gmail.com wrote:
 Hi Kostya

 Actually, my whole OS is in English so this will eliminate the possibility.

 BTW, can this be related to Windows 7? I mean is there anyone who is using
 Windows 7 and not having the problem?

 Regards,

 On Sun, Jul 25, 2010 at 10:36 AM, Kostya Vasilyev kmans...@gmail.comwrote:

   Abduaziz,

  Does your Windows home directory have non-English characters?
  (C:\Users\your name)?

  I found that in this case (mine has Russian characters), the emulator has
  various problems. I use the command line to create the emulator in some
  other directory that has only English characters (e.g. android create avd
  -p D:\Android\emulators\avd_1.6_qvga).

  -- Kostya

  25.07.2010 1:24, Abduaziz Hasan пишет:

   Dear DanH

   Thank you for your reply.

   When I first started my AVD I waited for some time until it was
  initialzed and I was at the home screen. The problem is that my app didn't
  deploy as I did the same on Ubuntu and it started the once the AVD was
  initialized.

   As for the second comment, it actually popped up once the AVD started
  under Ubuntu but not Windows. So this might be a Windows case.

   Thanx and regards,

  On Sat, Jul 24, 2010 at 11:26 PM, DanH danhi...@ieee.org wrote:

  First off, the first time you start an AVD after creating it you have
  to wait a VERY LONG TIME for it to configure itself completely.

  Secondly, I have found that, contrary to the docs, the application
  does not pop up of its own accord once loaded, but instead you have
  to press the Menu (I think) button.  This may be something peculiar to
  my config, but I suspect it's dependent on the particular AVD you
  choose.

  On Jul 24, 1:35 pm, Abduaziz Hasan affa...@gmail.com wrote:
   Hi all,

   I am new to Android development and have a very long experience in Java
   technology development. When trying to develop for Android, using
  Eclipse
   and Android SDK, I have had a problems with deploying the apps, or
   simulating them, using the AVD. The problem is when I run the
  application,
   through Eclipse, the AVD device booted normally but my applications
  don't
   get deploy.

   I have tried to solve it by changing almost everything in the run
   configuration and the Android preference. I even deleted the Android SDK
  and
   installed it again but with no use.

   My environment setup is:
   - Windows 7
   - Eclipse Helios
   - Android sdk r06
   - Android plugin for Eclipse 0.9.7.v201

   Now I have tried the same setup on Ubuntu 10.04 and it is working fine.

   Anyone had a similar problem?

    --
  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.comandroid-beginners%2bunsubscr...@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.comandroid-beginners%2bunsubscr...@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: Unable to deploy apps to AVD using Eclipse

2010-07-25 Thread DanH
Very good point.  I find that most extra antivirus features must be
turned off for most device emulators to function (and even some simple
compile setups).  Seems like AV software often suspects any code it's
never seen before as being a virus, and obviously all the code you
write falls into that category.  So leave the firewall running, and
the scheduled scan, but turn off all the live antivirus junk.

On Jul 25, 9:47 am, Kostya Vasilyev kmans...@gmail.com wrote:
 Maybe...

 Why don't you try creating a new AVD using the command line, and make sure
 there are no spaces or non-english characters in its pathname?

 Also, do you run an antivirus? I use NOD32 and don't have any issues with
 it. Just for test purposes, you could try disabling yours.

 --
 Kostya Vasilyev --http://kmansoft.wordpress.com

 25.07.2010 18:42 пользователь Abduaziz Hasan affa...@gmail.com написал:

 One note:

 I am trying to deploy the app using the adb install  command but I noticed
 that the adb didn't find the avd device that I created using eclipse. I
 tried to list the devices registered using adb devices but no device was
 found although I have one my_avd.

 Might this be the cause of the problem??

 On Sun, Jul 25, 2010 at 5:24 PM, Abduaziz Hasan affa...@gmail.com wrote:

  My path doesn't e...

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


[android-beginners] Re: Android based application for healthcare

2010-07-24 Thread DanH
What you propose is complex but doable.  For the pacemaker simulator,
note that you should not try to control the pacemaker (too complex and
too much liability) but should treat it as a read only source of
information.  (Though it's not entirely clear why you need a
connection to the pacemaker at all.)  Most modern units have an
ability to communicate with an outside sensor (to read out
incidents, etc), though likely this ability is turned off most of
the time to conserve battery life -- a significant issue.

The EMR sensor is something that you'd have to buy or invent.  I'm no
expert with EMR and don't know how complex such a device might be.  It
could be that developing a compact unit that is sensitive in the right
bands (and won't be upset by ordinary cellphones and the like) will be
difficult.  And of course you have to connect the sensor to the phone
somehow -- this has been done through the microphone input or through
the removable memory chip interface in some cases.  I don't know if
there are any phones out there with more general I/O abilities.

There's also the issue of battery life on the phone, since this would
be a constant-running application.  That could probably be easily
fixed, though, with a piggyback battery.

Finally, the sensitivity of pacemakers to EMR has been greatly reduced
over the years, to where now it's not nearly the issue it was 20-30
years ago.  So there's some question as to the market for your device.

But it sounds like an idea worth pursuing a little further, at least.
You'll learn a lot regardless of the outcome.

On Jul 23, 9:34 pm, AAJ sethuraman.ak...@gmail.com wrote:
 hey all,
 We are graduate student, currently working on our masters project on
 an android platform for a healthcare domain. Since there are not many
 pacemaker reated applications on an android phone, we decided to work
 on the same. Our project scenario is something like this-

 Pacemaker patients are not suppose to get exposed to EMR affected
 areas. The pacemaker will immediately stop functioning if exposed to
 EMR. So our application will be alerting the patients based on the
 intensity of the EMR . So here, we will be using-
 1. A pacemaker simulator which will periodically check the heartbeat
 and if the heart does not function properly, the pacemaker will
 regulate it.
 2. The handset has an in-built sensor, which can sense the intensity
 of the EMR.
 3. Also using Google maps we can pin the nearby locations which has
 high intensity EMR.

 Now, some of the things that we have to do-
 1. Implement the pacemaker simulator, since we are not able to access
 the source code for the already available ones.
 2. Implement the EMR sensor , to sense the EMR intensity.
 3. Alert the patient as soon as he/she enters the danger zone.
 4. Also show all the nearby EMR affected areas.

 Our questions are-
 1. Is the project feasible ?? As a masters project can we go ahead and
 start working on this.
 2. How do we find out all the EMr affected areas nearby ? Which means
 how do we connect Google maps API with the sensor program ??

 It would be great if you could help us out with these questions. We
 are really looking forward to working on an Android platform .

 Thanks
 AAJ.

-- 
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: Windows 7 issue? gen [in HelloAndroid] does not exist

2010-07-24 Thread DanH
Have you tried manually creating the gen directory?  It's worth a
shot.

On Jul 22, 10:28 am, Anil anil.r...@gmail.com wrote:
 I have been trying to get it up and running on Windows 7 but have had
 issues.
 Running Hello Android fails. Yes, I build, clean, build.
 Java 1.6.20, Eclipse 3.5.2, Windows 7 (it is 64 bit but I installed
 the 32 bit Java and 32 bit Eclipse).
 Error Log:

 !ENTRY org.eclipse.jdt.ui 4 10001 2010-07-22 09:16:32.010
 !MESSAGE Internal Error
 !STACK 1
 Java Model Exception: Java Model Status [gen [in HelloAndroid] does
 not exist]
         at
 org.eclipse.jdt.internal.core.JavaElement.newJavaModelException(JavaElement.java:
 502)
         at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:
 246)
         at
 org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:
 515)
         at
 org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:
 252)
         at
 org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:
 238)
         at
 org.eclipse.jdt.internal.core.PackageFragmentRoot.getKind(PackageFragmentRoot.java:
 477)
         at
 org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.processDelta(PackageExplorerContentProvider.java:
 645)
         at
 org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.handleAffectedChildren(PackageExplorerContentProvider.java:
 791)
         at
 org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.processDelta(PackageExplorerContentProvider.java:
 734)
         at
 org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.handleAffectedChildren(PackageExplorerContentProvider.java:
 791)
         at
 org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.processDelta(PackageExplorerContentProvider.java:
 734)
         at
 org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.elementChanged(PackageExplorerContentProvider.java:
 124)
         at org.eclipse.jdt.internal.core.DeltaProcessor
 $3.run(DeltaProcessor.java:1557)
         at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
         at
 org.eclipse.jdt.internal.core.DeltaProcessor.notifyListeners(DeltaProcessor.java:
 1547)
         at
 org.eclipse.jdt.internal.core.DeltaProcessor.firePostChangeDelta(DeltaProcessor.java:
 1381)
         at
 org.eclipse.jdt.internal.core.DeltaProcessor.fire(DeltaProcessor.java:
 1357)
         at
 org.eclipse.jdt.internal.core.DeltaProcessor.resourceChanged(DeltaProcessor.java:
 1958)
         at
 org.eclipse.jdt.internal.core.DeltaProcessingState.resourceChanged(DeltaProcessingState.java:
 470)
         at org.eclipse.core.internal.events.NotificationManager
 $2.run(NotificationManager.java:291)
         at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
         at
 org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:
 285)
         at
 org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:
 149)
         at
 org.eclipse.core.internal.resources.Workspace.broadcastPostChange(Workspace.java:
 313)
         at
 org.eclipse.core.internal.resources.Workspace.aboutToBuild(Workspace.java:
 244)
         at org.eclipse.core.internal.resources.Project$1.run(Project.java:
 513)
         at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:
 1800)
         at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:
 1782)
         at
 org.eclipse.core.internal.resources.Project.internalBuild(Project.java:
 502)
         at org.eclipse.core.internal.resources.Project.build(Project.java:94)
         at
 org.eclipse.ui.internal.ide.dialogs.CleanDialog.doClean(CleanDialog.java:
 312)
         at org.eclipse.ui.internal.ide.dialogs.CleanDialog
 $1.runInWorkspace(CleanDialog.java:154)
         at
 org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:
 38)
         at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
 !SUBENTRY 1 org.eclipse.jdt.core 4 969 2010-07-22 09:16:32.010
 !MESSAGE gen [in HelloAndroid] does not exist

-- 
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: Unable to deploy apps to AVD using Eclipse

2010-07-24 Thread DanH
First off, the first time you start an AVD after creating it you have
to wait a VERY LONG TIME for it to configure itself completely.

Secondly, I have found that, contrary to the docs, the application
does not pop up of its own accord once loaded, but instead you have
to press the Menu (I think) button.  This may be something peculiar to
my config, but I suspect it's dependent on the particular AVD you
choose.

On Jul 24, 1:35 pm, Abduaziz Hasan affa...@gmail.com wrote:
 Hi all,

 I am new to Android development and have a very long experience in Java
 technology development. When trying to develop for Android, using Eclipse
 and Android SDK, I have had a problems with deploying the apps, or
 simulating them, using the AVD. The problem is when I run the application,
 through Eclipse, the AVD device booted normally but my applications don't
 get deploy.

 I have tried to solve it by changing almost everything in the run
 configuration and the Android preference. I even deleted the Android SDK and
 installed it again but with no use.

 My environment setup is:
 - Windows 7
 - Eclipse Helios
 - Android sdk r06
 - Android plugin for Eclipse 0.9.7.v201

 Now I have tried the same setup on Ubuntu 10.04 and it is working fine.

 Anyone had a similar problem?

-- 
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: Android based application for healthcare

2010-07-24 Thread DanH
The cellphone does, in general, have a sensor that consists of the
cellphone radio.  This is, as I understand it, a multi-function radio
that uses software techniques to simulate the electronics that would
be present in a more conventional design, and it is in theory capable
of all sorts of tricks.  But that software is very complex and almost
certainly not accessible to the app programmer, so you'd have very
little chance of hijacking it to do your sensing, unless you could
somehow get one of the phone engineers involved.

And like I said, you DON'T want to control the pacemaker -- that will
send any potential real investors running the other direction (BIG
liability issues).  At most you want to just passively read the unit.

On Jul 24, 10:42 am, Akila Sethuraman sethuraman.ak...@gmail.com
wrote:
 Thanks all for your inputs. But now, your answers have triggered some more
 questions-
 1. Just like Mr.Dan has proposed, we are planning to implement a simple
 pacemaker. Its basic function would be to periodically check the heartbeat
 and see if it is irregular. If the heartbeat is say 50 per minute, then the
 pacemaker would regulate it to 72 . Isn't that sufficient ??
 2. Also, i would like to know, why do i need an external sensor. Most of the
 cellphones do have a sensor  in-built which can sense the EMR. So, in that
 case , cant I use the in-built sensor ??

 Thanks for your time and suggestions.

 On Sat, Jul 24, 2010 at 7:37 AM, Bret Foreman bret.fore...@gmail.comwrote:



  As for connecting sensors to the phone, your best bet will be USB
  based sensors. Almost the entire sensor market has gone over to these
  devices because of their easy connection to PCs. The only hitch will
  be getting access to the hardware I/O specifications of the sensor so
  you can talk to it. Most sensor companies provide ready-made software
  and don't publish the I/O specs. You'll need to find one who is
  willing to work with you. The good news is that there are many of them
  out there and they are hungry to get their hardware into new
  applications.

  As for the specific sensor, you need to get a physicist involved in
  your project. The human body is mostly water and the penetration of
  radio waves is inversely related to frequency. This is well studied
  and will tell you which bands are going to concern your system. The
  good news is that low frequencies (the most penetrating) are easy to
  demodulate with modern high speed A/D systems (like the ones you will
  have in your USB sensor). You need to get a signal processing expert
  to help you with that part but modern Android phones have enough
  processing power to handle the task, as I've found in my own work.
  You'll also need some analog electronics for the front end to boost
  the signal enough to demodulate it. Get an electrical engineer to help
  you with that.

  Overall it sounds like a fun project. In general, I recommend
  consulting experts whenever you can rather than stumbling around. Most
  are very generous with their time when helping students. Good luck,
  and let me know if you get the system working well enough for a demo.
  I know a huge number of venture capitalists who are always on the
  lookout for investment opportunities.

  --
  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.comandroid-beginners%2bunsubscr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/android-beginners?hl=en

 --
 Regards,
 Akila

-- 
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: Android based application for healthcare

2010-07-24 Thread DanH
Yeah, I completely forgot about USB.  On some (non-Android) phones
it's not accessible to the app, so it didn't come to mind.

On Jul 24, 9:37 am, Bret Foreman bret.fore...@gmail.com wrote:
 As for connecting sensors to the phone, your best bet will be USB
 based sensors. Almost the entire sensor market has gone over to these
 devices because of their easy connection to PCs. The only hitch will
 be getting access to the hardware I/O specifications of the sensor so
 you can talk to it. Most sensor companies provide ready-made software
 and don't publish the I/O specs. You'll need to find one who is
 willing to work with you. The good news is that there are many of them
 out there and they are hungry to get their hardware into new
 applications.

 As for the specific sensor, you need to get a physicist involved in
 your project. The human body is mostly water and the penetration of
 radio waves is inversely related to frequency. This is well studied
 and will tell you which bands are going to concern your system. The
 good news is that low frequencies (the most penetrating) are easy to
 demodulate with modern high speed A/D systems (like the ones you will
 have in your USB sensor). You need to get a signal processing expert
 to help you with that part but modern Android phones have enough
 processing power to handle the task, as I've found in my own work.
 You'll also need some analog electronics for the front end to boost
 the signal enough to demodulate it. Get an electrical engineer to help
 you with that.

 Overall it sounds like a fun project. In general, I recommend
 consulting experts whenever you can rather than stumbling around. Most
 are very generous with their time when helping students. Good luck,
 and let me know if you get the system working well enough for a demo.
 I know a huge number of venture capitalists who are always on the
 lookout for investment opportunities.

-- 
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: Why it is so difficult to generate gen file

2010-07-22 Thread DanH
To help others, you should say what you found (if it's not too
embarrassing).

On Jul 22, 1:15 am, Shaista Naaz shaistanaa...@gmail.com wrote:
 Hey Hi,

 I got it up and running. Thanks,

 Shaista

 On Thu, Jul 22, 2010 at 11:34 AM, Shaista Naaz shaistanaa...@gmail.comwrote:



  Hi,
  I am a beginner trying to learn Android. I am trying to run Hello Android
  sample code but am facing one problem with generation of gen file.
  Sometimes it works after I do repeated clean, rebuild and build
  automatically on and off.

  I have installed android-sdk_r06-windows, eclipse-java-galileo-win32 and
  jdk-6u21-windows-i586.
  While creating Hello Android I am selecting Android 1.1 as SDK. I have
  given PATH variable of SDK only not for java.
  And I am working on Windows.

  If my simple Hello Android succeeds in generating R.java and then I make
  any changes in the main.xml and string.xml then again gen cannot be created.
  I am following file

  file:///D:/Android/android-sdk_r06-windows/android-sdk-windows/docs/resources/tutorials/hello-world.html

  Any help is highly appreciated.

  Thanks,
  Shaista

-- 
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: Updating XML files

2010-07-21 Thread DanH
I think the best approach is to read it in as a Document and operate
on that with xpath stuff.  Not good for large documents, but
reasonable for medium/small ones.

On Jul 21, 7:31 am, Emmen Farooq farooq.em...@gmail.com wrote:
 Hi all and thank you for all your help ,

 I have understood SAX parser and got it to work to read xml file , and
 have understood the concept of Xstrem for creating xml files , but Im
 null with the concept of updating only a certain part of an xml file
 with android , i mean a file exists and I wd like to update only a
 certain tag , any help would be appreciated
  many thanks indeed

-- 
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: updating an xml file

2010-07-20 Thread DanH
This is probably a job for DOM.

On Jul 20, 2:08 am, Emmen Farooq farooq.em...@gmail.com wrote:
 I have an xml file on my hard drive,   that already has and element
 name , now when I change it through the application I want it to be
 written to the xml , i.e. the name is updated in the xml , when the
 user changes it in the aplication , please help / advise ?

-- 
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: stubborn error wont go away

2010-07-20 Thread DanH
Yeah, same here, but they are handy in some cases.

On Jul 19, 11:18 pm, Justin Anderson janderson@gmail.com wrote:
 * Yeah, the ability to define a class inline like that is a very powerful 
 feature of Java, but it can be very confusing since the {}
  and () get nested so deeply and get so distantly separated.

 *
 Personally, I tend to avoid inline classes for that very reason...

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

 On Mon, Jul 19, 2010 at 5:17 PM, DanH danhi...@ieee.org wrote:
  Yeah, the ability to define a class inline like that is a very
  powerful feature of Java, but it can be very confusing since the {}
  and () get nested so deeply and get so distantly separated.

  On Jul 19, 1:31 pm, Justin Anderson janderson@gmail.com wrote:
   Your call to setOnClickListener is missing a closing parentheses... which
  is
   why you get the error telling you to insert one.

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

   On Mon, Jul 19, 2010 at 12:18 PM, martinmike2 martinmi...@gmail.com
  wrote:
I should probably give some info background here.

The code is listening for a button click to call a private function
searched(String sTERM).

Im just starting app development and learning java at the same time.
not sure what im doing wrong.

--
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.comandroid-beginners%2bunsubscr...@googlegroups.com
  android-beginners%2bunsubscr...@googlegroups.comandroid-beginners%252bunsubscr...@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.comandroid-beginners%2bunsubscr...@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: Eclipse: Easy way to refactor/rename package?

2010-07-19 Thread DanH
Do you have Rename under File?  I'm pretty sure it's the same
function.  Just highlight the project to rename that, the package to
rename that.

On Jul 19, 1:50 pm, Nick Richardson richardson.n...@gmail.com wrote:
 Xavier,

 I had read about that option while searching around... but i do not have
 that option under Android Tools.  I've checked for updates of the plugin
 through Eclipse and it appears that i am running the latest version (Android
 Development Tools 0.9.7.v201005071157-36220).  Is there a newer version than
 this?  If so, Eclipse doesn't want to grab it 
 fromhttps://dl-ssl.google.com/android/eclipse/.

 Is it possible that the rename option is not available on a Mac?  (I doubt
 it).  Is there a specific version of ADT that i need in order to have this
 option show up?

 The options i have available under Android Tools are:
 * New Test Project
 * New Resource File
 * Export Signed Application Package
 * Export Unsigned Application Package
 * Fix Project Properties



 On Mon, Jul 19, 2010 at 11:12 AM, Xavier Ducrohet x...@android.com wrote:
  - Right click project
  - Choose Android Tools  Rename application package

  This will go and change everything that needs changing.

  Now, for your specific case of having 2 versions of your app, I
  recommend splitting your project in a common library and 2
  applications projects.
  See here for more details:

 http://developer.android.com/guide/developing/eclipse-adt.html#librar...

  On Mon, Jul 19, 2010 at 10:55 AM, Nick Richardson
  richardson.n...@gmail.com wrote:
   Thanks for the replies,
   I did use the refactor option to rename the package and the project, but
   then there were a few updates that were needed in the manifest, and one
   other place i can't remember now.
   I was simply wondering if there was an automated way to make all these
   changes at once using the ADT plugin, or if i was going to have to do
  this
   manually every time i have an update to my app.
   //Nick
   On Sun, Jul 18, 2010 at 10:47 AM, Mark H. Nichols code.pr...@gmail.com
   wrote:

   On Jul 18, 2010, at 3:41 AM, Nick Richardson wrote:

Hopefully simple question:

I would like to create a second copy of my app and release it as a
  free
version.  I have copied my project to a new one in eclipse, but now i
  would
like to rename the project and package to upload to the market.

Is there an easy way using ADT or otherwise that will do this for me?
   I
found a few posts online with reference to right clicking the project
  and
selecting Rename from Android Tools, but i do not have that
  option.

If there's not an automated way, what are the steps i need to be sure
  to
take to insure that everything is renamed correctly before i upload?

   If you are using Eclipse, you can use the Refactor tool to do what you
   want. Right-click on the project to be renamed, select Refactor from the
   object menu, and then rename from there.

   Mark

   --
   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.comandroid-beginners%2bunsubscr...@googlegroups.com
   For more options, visit this group at
  http://groups.google.com/group/android-beginners?hl=en

   --
   //Nick Richardson
   //richardson.n...@gmail.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.comandroid-beginners%2bunsubscr...@googlegroups.com
   For more options, visit this group at
  http://groups.google.com/group/android-beginners?hl=en

  --
  Xavier Ducrohet
  Android SDK Tech Lead
  Google Inc.

  Please do not send me questions directly. 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.comandroid-beginners%2bunsubscr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/android-beginners?hl=en

 --
 //Nick Richardson
 //richardson.n...@gmail.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

[android-beginners] Re: stubborn error wont go away

2010-07-19 Thread DanH
Yeah, the ability to define a class inline like that is a very
powerful feature of Java, but it can be very confusing since the {}
and () get nested so deeply and get so distantly separated.

On Jul 19, 1:31 pm, Justin Anderson janderson@gmail.com wrote:
 Your call to setOnClickListener is missing a closing parentheses... which is
 why you get the error telling you to insert one.

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

 On Mon, Jul 19, 2010 at 12:18 PM, martinmike2 martinmi...@gmail.com wrote:
  I should probably give some info background here.

  The code is listening for a button click to call a private function
  searched(String sTERM).

  Im just starting app development and learning java at the same time.
  not sure what im doing wrong.

  --
  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.comandroid-beginners%2bunsubscr...@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: Eclipse: Easy way to refactor/rename package?

2010-07-18 Thread DanH
File - Rename?  You might have to do it twice -- once on the project
and once on the package.

On Jul 18, 3:41 am, Nick Richardson richardson.n...@gmail.com wrote:
 Hopefully simple question:

 I would like to create a second copy of my app and release it as a free
 version.  I have copied my project to a new one in eclipse, but now i would
 like to rename the project and package to upload to the market.

 Is there an easy way using ADT or otherwise that will do this for me?  I
 found a few posts online with reference to right clicking the project and
 selecting Rename from Android Tools, but i do not have that option.

 If there's not an automated way, what are the steps i need to be sure to
 take to insure that everything is renamed correctly before i upload?

 Thanks,

 --
 //Nick Richardson
 //richardson.n...@gmail.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: Eclipse: Easy way to refactor/rename package?

2010-07-18 Thread DanH
As for steps to insure everything is renamed correctly, that would be
a clean, build, and thorough test -- what you should be doing
anyway, of course.

On Jul 18, 3:41 am, Nick Richardson richardson.n...@gmail.com wrote:
 Hopefully simple question:

 I would like to create a second copy of my app and release it as a free
 version.  I have copied my project to a new one in eclipse, but now i would
 like to rename the project and package to upload to the market.

 Is there an easy way using ADT or otherwise that will do this for me?  I
 found a few posts online with reference to right clicking the project and
 selecting Rename from Android Tools, but i do not have that option.

 If there's not an automated way, what are the steps i need to be sure to
 take to insure that everything is renamed correctly before i upload?

 Thanks,

 --
 //Nick Richardson
 //richardson.n...@gmail.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-18 Thread DanH
Well, that's not exactly it.  The pointer is needed in
setOnClickListener to distinguish that specific instance of the
listener class from the thousand other possible instances in the
machine.  You'll find the analogous pointer in C++ based systems, eg.

And note that it need not be this.  One might very well do:

MyListenerClass listener = new MyListenerClass(some args);
someWidget.setOnClickListener(listener);

On Jul 18, 4:53 pm, Sam Hobbs s...@samhobbs.org wrote:
 I am new to Java, but since Justin says that the this reference is
 essentially the same as in C++ and C# I hope my comments are helpful.

 I think one point that was not made clear is that the operating system
 (Android, Linux or whatever) is not written in Java but if it was
 written in Java it would need to call event handlers in a manner that is
 independent of the language. So when Android calls the
 setOnClickListener event handler, it does not have a this reference and
 could not call the event handler with this even if it knew what this is.
 So it is quite common to pass the this as an argument so the event
 handler can access the other members of it's class.

 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

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


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

2010-07-18 Thread DanH
I apologize that I don't know what the Java term is that corresponds
with the C++ term static

The Java term is static.

Both setOnClickListener and the listener's method onClick are instance
methods, not static ones.

The argument to setOnClickListener is the reference of (pointer to)
the object instance that implements onClick.  In some cases it's
convenient for that to be the current class, but in other cases not.
this has no special significance in the setOnClickListener
invocation -- no different from any other reference that might be
supplied.  It simply refers to the current instance in cases where
that's the way the programmer wants to do it.

I've been programming in C++ for 14 years.  Was the lead designer/
developer for the Java implementation in IBM iSeries (which was
written in C++).  I kinda know both languages pretty well.

On Jul 18, 7:51 pm, Sam Hobbs s...@samhobbs.org wrote:
 Except the original question is about this and why it works to use it
 as an argument. My comments explain why the this is missing when an
 event handler is called.

 I apologize that I don't know what the Java term is that corresponds
 with the C++ term static, but in C++ the this pointer is the only
 difference between a static and a non-static function. Providing the
 this pointer in C++ as an argument for a static function allows the
 event handler to do everything that a non-static function does except
 the static function must use the this pointer to qualify references to
 the class.

 Perhaps I misunderstand what you are saying; are you saying that it is
 possible to pass something else in the argument other than the this
 reference? If so then that is not inconsistent with what I said or meant
 to say, but the question was about the this reference.



 DanH wrote:
  Well, that's not exactly it.  The pointer is needed in
  setOnClickListener to distinguish that specific instance of the
  listener class from the thousand other possible instances in the
  machine.  You'll find the analogous pointer in C++ based systems, eg.

  And note that it need not be this.  One might very well do:

  MyListenerClass listener = new MyListenerClass(some args);
  someWidget.setOnClickListener(listener);

  On Jul 18, 4:53 pm, Sam Hobbss...@samhobbs.org  wrote:
  I am new to Java, but since Justin says that the this reference is
  essentially the same as in C++ and C# I hope my comments are helpful.

  I think one point that was not made clear is that the operating system
  (Android, Linux or whatever) is not written in Java but if it was
  written in Java it would need to call event handlers in a manner that is
  independent of the language. So when Android calls the
  setOnClickListener event handler, it does not have a this reference and
  could not call the event handler with this even if it knew what this is.
  So it is quite common to pass the this as an argument so the event
  handler can access the other members of it's class.

  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

  --
  Sam Hobbs
  Los Angeles, CA

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


[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


[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] 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 keithr...@gmail.com 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 janderson@gmail.com 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 keithr...@gmail.com 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.comandroid-beginners%2Bunsubscr
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 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 
 janderson@gmail.comwrote:

  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 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 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.comandroid-beginners%2bunsubscr...@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.comandroid-beginners%2bunsubscr...@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: 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 harald.kron...@gmail.com 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] Re: Implementing a Service - Call down to super?

2010-07-15 Thread DanH
Maybe, maybe not.  It depends on what you want to do.

On Jul 15, 2:46 pm, Jake Colman col...@ppllc.com wrote:
 When extending Service with your own Service, should you be calling down
 to the super implementation of the methods that are being overridden?
 If so, do you do it before or after you've invoked your own code?

 --
 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: Java Keyword This and Button Listeners.

2010-07-13 Thread DanH
Think of this as a reference (ie, pointer) variable, no different
than refForMyObject.  It's just a shorthand for the reference
variable that is used to reference the object you're currently in.
There are a few cases where the Java compiler special-cases its use,
but still the meaning reference variable to the current object is
consistent in all cases.

On Jul 12, 9:50 pm, Keith Roberts keithr...@gmail.com 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
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


[android-beginners] Re: setting age

2010-07-13 Thread DanH
I would guess either a Spinner or a DatePicker (entering the birth
date).  Though one wonders why there isn't a generic NumberPicker or
ItemPicker.

On Jul 9, 8:19 pm, Emmen Farooq farooq.em...@gmail.com wrote:
 Im making an app which would have to get users age , now what would be
 the appropriate control ? I have to make something like a scroll with
 numbers in it , but the user shouldnt  enter from the keyboard  , he
 should have something to select from , many thanks indeed

-- 
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 to get information

2010-07-12 Thread DanH
I guess the first question would be:  Do you have questions specific
to Android, or are you asking, in general, how to do an SQL query
(and, prior to that, how to populate the database)?

On Jul 12, 10:35 am, Curran thecur...@hotmail.co.uk wrote:
 Hi everyone,

 I'm still quite new Android development and need a way to read
 information from a database, which I'm not really sure how to do.
 Essentially my app is a reference for chemistry students, which will
 read and display information about topics. The database needs to be
 pre-prepared (with all the information) but I've got confused how to
 do this in Eclipse, and also how to get this onto a device.

 An an example of what I want it to do (without chemistry jargon, and
 because I'm probably not being too clear :-) ), a user selected the
 option Cat, which then pulls from a database things such as Amount
 of legs, Colour, height etc. I understand this is probably a
 really basic thing, but help would be greatly appreciated :)

 Thanks!

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

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

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


[android-beginners] Re: Creating a populated sqlite database

2010-07-12 Thread DanH
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 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