[android-developers] Re: start at boot app gives instantiationException:

2012-02-24 Thread Thomas
Thanks to everyone for contributing to this longish discussion.
Changing the line in the manifest fixed the problem.
As far as debug is concerned I set it in the manifest as Eclipse
didn't seem to set it by default.

The overall project is to use an Android tablet as an embedded
application which means there has to be an
A. external method for powering the tablet on and off (maybe via a
small microcontroller),
B. autostart an application at bootup - which is what this string is
about,
and the last requirement -
C  remove the key unlock screen.

A. external startup is complete  View at  http://tombtalk.net/?p=627
as this is about hardware
B. Start app at bootup is mostly complete thanks to all of your help.
C.  Remove or bypass key slide lock - being researched.  There seems
to be some uncertainty about how to do this.  I'll report back as I
learn stuff.
All of the above available on a small blog.  http://tombtalk.net
Best Tom B



On Feb 23, 5:06 pm, Ted Scott  wrote:
> That's one error and certainly explains the class not found exception.
>
> I'm not sure but you also might need a default category for the activity
> definition.
> 
>
> What do you mean by you have to debug as an Android? Of course you have
> to run the code on a device to debug it. Also you won't be able to
> attach the debugger to your receiver because it will fire before the
> DDMS is attached.
>
> On 2/23/2012 4:50 PM, YuviDroid wrote:
>
>
>
>
>
>
>
> > There's something odd with the package names :S:S:S
>
> > If your BroadcastReceiver package name is "package
> > com.needham.RxBcast;" then also in the manifest you should use the
> > same package:
> > 
>
> > or correct the package name and make it "package com.needham;" and the
> > receiver in the manifest: .
>
> > On Thu, Feb 23, 2012 at 10:32 PM, Thomas  > > wrote:
>
> >     It is the program you sent me.  I noticed that I have to debug as an
> >     Android to get the
> >     Log.d  statements to work.
>
> >     
>
> >     package com.needham.RxBcast;
>
> >     import android.content.BroadcastReceiver;
> >     import android.content.ComponentName;
> >     import android.content.Context;
> >     import android.content.Intent;
> >     import android.util.Log;
>
> >     public class RxBcast extends BroadcastReceiver {
>
> >        private static final String TAG = "RxBcast77";
> >        private static final int NOTE_ID = 1;
>
> >        @Override
> >        public void onReceive(Context c, Intent i) {
> >            // check and handle registerable actions
> >            String act = i.getAction();
> >            Log.d(TAG, "Rxd "+ act );
> >            if( act.equals(i.ACTION_BOOT_COMPLETED) ) {
> >                Intent si = new Intent(c, PiesOfCodActivity.class);
> >                si.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
> >                c.startActivity(si);
> >            }
> >        } // onReceive
>
> >     }
>
> >     *
> >     package com.needham.RxBcast;
>
> >     import android.app.Activity;
> >     import android.os.Bundle;
> >     import android.util.Log;
> >     import android.widget.TextView;
>
> >     public class PiesOfCodActivity extends Activity {
> >        /** Called when the activity is first created. */
>
> >            private static final String TAG = "RxBcast77";
>
> >        public void onCreate(Bundle savedInstanceState) {
>
> >            Log.d(TAG, "POCA777 "+ savedInstanceState );
> >               super.onCreate(savedInstanceState);
> >                    TextView tv = new TextView(this);
> >                    tv.setText("Hello, Pies of Cod!");
> >                    setContentView(tv);
> >        }
> >     }
> >     
> > **
> >     
> >     http://schemas.android.com/apk/res/android";
> >        package="com.needham.RxBcast"
> >        android:versionCode="1"
> >        android:versionName="1.0" >
>
> >     
> >      >     android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
>
> >      >             android:icon="@drawable/ic_launcher"
> >             android:label="@string/app_name" >
> >      >                 android:name=".PiesOfCodActivity"
> >                 android:label="@string/app_name" >
> >     
> >     
>
> >     
> >     
> >     
>
> >     
> >     
> >     
> >     
> >     
> >     
> >     
> >     
> >     
>
> >     
> >     
>
> >     On Feb 23, 2:16 pm, Ted Scott  >     > wrote:
> >     > On 2/23/2012 11:18 AM, Thomas wrote:> I've continued to
> >     experiment.  I wanted to send an attachment file but
> >     > > but here is a portion of the  logcat showing the RxBcast
> >     failing at
> >     > > bootup and after the Emulator is opened then running correctly.
> >     > > look for **  I unlock  emulator
> >     > > The same thing happens on my DroidX

Re: [android-developers] Re: start at boot app gives instantiationException:

2012-02-23 Thread Ted Scott

That's one error and certainly explains the class not found exception.

I'm not sure but you also might need a default category for the activity 
definition.



What do you mean by you have to debug as an Android? Of course you have 
to run the code on a device to debug it. Also you won't be able to 
attach the debugger to your receiver because it will fire before the 
DDMS is attached.


On 2/23/2012 4:50 PM, YuviDroid wrote:

There's something odd with the package names :S:S:S

If your BroadcastReceiver package name is "package 
com.needham.RxBcast;" then also in the manifest you should use the 
same package:



or correct the package name and make it "package com.needham;" and the 
receiver in the manifest: .



On Thu, Feb 23, 2012 at 10:32 PM, Thomas > wrote:


It is the program you sent me.  I noticed that I have to debug as an
Android to get the
Log.d  statements to work.



package com.needham.RxBcast;

import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.util.Log;


public class RxBcast extends BroadcastReceiver {

   private static final String TAG = "RxBcast77";
   private static final int NOTE_ID = 1;

   @Override
   public void onReceive(Context c, Intent i) {
   // check and handle registerable actions
   String act = i.getAction();
   Log.d(TAG, "Rxd "+ act );
   if( act.equals(i.ACTION_BOOT_COMPLETED) ) {
   Intent si = new Intent(c, PiesOfCodActivity.class);
   si.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
   c.startActivity(si);
   }
   } // onReceive

}

*
package com.needham.RxBcast;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;

public class PiesOfCodActivity extends Activity {
   /** Called when the activity is first created. */

   private static final String TAG = "RxBcast77";

   public void onCreate(Bundle savedInstanceState) {


   Log.d(TAG, "POCA777 "+ savedInstanceState );
  super.onCreate(savedInstanceState);
   TextView tv = new TextView(this);
   tv.setText("Hello, Pies of Cod!");
   setContentView(tv);
   }
}

**

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



























On Feb 23, 2:16 pm, Ted Scott mailto:t...@hootinholler.com>> wrote:
> On 2/23/2012 11:18 AM, Thomas wrote:> I've continued to
experiment.  I wanted to send an attachment file but
> > but here is a portion of the  logcat showing the RxBcast
failing at
> > bootup and after the Emulator is opened then running correctly.
> > look for **  I unlock  emulator
> > The same thing happens on my DroidX2 Fails on boot after
keyboard is
> > unlocked and then works correct when started by touching icon.
>
> > ***  Bad stuff here
> > E/AndroidRuntime(  237): FATAL EXCEPTION:
mainE/AndroidRuntime(  237):
> > java.lang.RuntimeException: Unable to instantiate receiver
> > com.needham.PiesOfCod.RxBcast: java.lang.ClassNotFoundException:
> > com.needham.PiesOfCod.RxBcast in loader
dalvik.system.PathClassLoader[/
> > data/app/com.needham.RxBcast-1.apk]E/AndroidRuntime(  237):  
 at

> >
android.app.ActivityThread.handleReceiver(ActivityThread.java:2789)E/
>
> Looks like a configuration issue. Before you started
experimenting, did
> you get the stuff I posted working?
>
> What's in your manifest? What does your project's code tree look
like?

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to
android-developers@googlegroups.com

To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com

For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en




--
YuviDroid
Check out Launch-X  (a 
widget to quickly access your favorite apps and contacts!)

http://android.yuvalsharon.net

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this 

Re: [android-developers] Re: start at boot app gives instantiationException:

2012-02-23 Thread YuviDroid
There's something odd with the package names :S:S:S

If your BroadcastReceiver package name is "package com.needham.RxBcast;"
then also in the manifest you should use the same package:


or correct the package name and make it "package com.needham;" and the
receiver in the manifest: .


On Thu, Feb 23, 2012 at 10:32 PM, Thomas  wrote:

> It is the program you sent me.  I noticed that I have to debug as an
> Android to get the
> Log.d  statements to work.
>
> 
>
> package com.needham.RxBcast;
>
> import android.content.BroadcastReceiver;
> import android.content.ComponentName;
> import android.content.Context;
> import android.content.Intent;
> import android.util.Log;
>
>
> public class RxBcast extends BroadcastReceiver {
>
> private static final String TAG = "RxBcast77";
> private static final int NOTE_ID = 1;
>
>@Override
>public void onReceive(Context c, Intent i) {
>// check and handle registerable actions
>String act = i.getAction();
> Log.d(TAG, "Rxd "+ act );
> if( act.equals(i.ACTION_BOOT_COMPLETED) ) {
>Intent si = new Intent(c, PiesOfCodActivity.class);
>si.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
>c.startActivity(si);
>}
>} // onReceive
>
> }
>
> *
> package com.needham.RxBcast;
>
> import android.app.Activity;
> import android.os.Bundle;
> import android.util.Log;
> import android.widget.TextView;
>
> public class PiesOfCodActivity extends Activity {
>/** Called when the activity is first created. */
>
>private static final String TAG = "RxBcast77";
>
>public void onCreate(Bundle savedInstanceState) {
>
>
>Log.d(TAG, "POCA777 "+ savedInstanceState );
>   super.onCreate(savedInstanceState);
>TextView tv = new TextView(this);
>tv.setText("Hello, Pies of Cod!");
>setContentView(tv);
>}
> }
>
> **
> 
> http://schemas.android.com/apk/res/android";
> package="com.needham.RxBcast"
> android:versionCode="1"
>android:versionName="1.0" >
>
> 
>  android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
>
>  android:icon="@drawable/ic_launcher"
> android:label="@string/app_name" >
>  android:name=".PiesOfCodActivity"
> android:label="@string/app_name" >
> 
> 
>
> 
> 
> 
>
> 
> 
> 
> 
> 
> 
> 
> 
> 
>
> 
> 
>
>
> On Feb 23, 2:16 pm, Ted Scott  wrote:
> > On 2/23/2012 11:18 AM, Thomas wrote:> I've continued to experiment.  I
> wanted to send an attachment file but
> > > but here is a portion of the  logcat showing the RxBcast failing at
> > > bootup and after the Emulator is opened then running correctly.
> > > look for **  I unlock  emulator
> > > The same thing happens on my DroidX2 Fails on boot after keyboard is
> > > unlocked and then works correct when started by touching icon.
> >
> > > ***  Bad stuff here
> > > E/AndroidRuntime(  237): FATAL EXCEPTION: mainE/AndroidRuntime(  237):
> > > java.lang.RuntimeException: Unable to instantiate receiver
> > > com.needham.PiesOfCod.RxBcast: java.lang.ClassNotFoundException:
> > > com.needham.PiesOfCod.RxBcast in loader dalvik.system.PathClassLoader[/
> > > data/app/com.needham.RxBcast-1.apk]E/AndroidRuntime(  237):at
> > > android.app.ActivityThread.handleReceiver(ActivityThread.java:2789)E/
> >
> > Looks like a configuration issue. Before you started experimenting, did
> > you get the stuff I posted working?
> >
> > What's in your manifest? What does your project's code tree look like?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
YuviDroid
Check out Launch-X  (a widget
to quickly access your favorite apps and contacts!)
http://android.yuvalsharon.net

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

[android-developers] Re: start at boot app gives instantiationException:

2012-02-23 Thread Thomas
It is the program you sent me.  I noticed that I have to debug as an
Android to get the
Log.d  statements to work.



package com.needham.RxBcast;

import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.util.Log;


public class RxBcast extends BroadcastReceiver {

private static final String TAG = "RxBcast77";
private static final int NOTE_ID = 1;

@Override
public void onReceive(Context c, Intent i) {
// check and handle registerable actions
String act = i.getAction();
Log.d(TAG, "Rxd "+ act );
if( act.equals(i.ACTION_BOOT_COMPLETED) ) {
Intent si = new Intent(c, PiesOfCodActivity.class);
si.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
c.startActivity(si);
}
} // onReceive

}

*
package com.needham.RxBcast;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;

public class PiesOfCodActivity extends Activity {
/** Called when the activity is first created. */

private static final String TAG = "RxBcast77";

public void onCreate(Bundle savedInstanceState) {


Log.d(TAG, "POCA777 "+ savedInstanceState );
   super.onCreate(savedInstanceState);
TextView tv = new TextView(this);
tv.setText("Hello, Pies of Cod!");
setContentView(tv);
}
}
**

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



























On Feb 23, 2:16 pm, Ted Scott  wrote:
> On 2/23/2012 11:18 AM, Thomas wrote:> I've continued to experiment.  I wanted 
> to send an attachment file but
> > but here is a portion of the  logcat showing the RxBcast failing at
> > bootup and after the Emulator is opened then running correctly.
> > look for **  I unlock  emulator
> > The same thing happens on my DroidX2 Fails on boot after keyboard is
> > unlocked and then works correct when started by touching icon.
>
> > ***  Bad stuff here
> > E/AndroidRuntime(  237): FATAL EXCEPTION: mainE/AndroidRuntime(  237):
> > java.lang.RuntimeException: Unable to instantiate receiver
> > com.needham.PiesOfCod.RxBcast: java.lang.ClassNotFoundException:
> > com.needham.PiesOfCod.RxBcast in loader dalvik.system.PathClassLoader[/
> > data/app/com.needham.RxBcast-1.apk]E/AndroidRuntime(  237):        at
> > android.app.ActivityThread.handleReceiver(ActivityThread.java:2789)E/
>
> Looks like a configuration issue. Before you started experimenting, did
> you get the stuff I posted working?
>
> What's in your manifest? What does your project's code tree look like?

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


Re: [android-developers] Re: start at boot app gives instantiationException:

2012-02-23 Thread Ted Scott

On 2/23/2012 11:18 AM, Thomas wrote:

I've continued to experiment.  I wanted to send an attachment file but
but here is a portion of the  logcat showing the RxBcast failing at
bootup and after the Emulator is opened then running correctly.
look for **  I unlock  emulator
The same thing happens on my DroidX2 Fails on boot after keyboard is
unlocked and then works correct when started by touching icon.

***  Bad stuff here
E/AndroidRuntime(  237): FATAL EXCEPTION: mainE/AndroidRuntime(  237):
java.lang.RuntimeException: Unable to instantiate receiver
com.needham.PiesOfCod.RxBcast: java.lang.ClassNotFoundException:
com.needham.PiesOfCod.RxBcast in loader dalvik.system.PathClassLoader[/
data/app/com.needham.RxBcast-1.apk]E/AndroidRuntime(  237): at
android.app.ActivityThread.handleReceiver(ActivityThread.java:2789)E/

Looks like a configuration issue. Before you started experimenting, did 
you get the stuff I posted working?


What's in your manifest? What does your project's code tree look like?

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


[android-developers] Re: start at boot app gives instantiationException:

2012-02-23 Thread Thomas
I've continued to experiment.  I wanted to send an attachment file but
but here is a portion of the  logcat showing the RxBcast failing at
bootup and after the Emulator is opened then running correctly.
look for **  I unlock  emulator
The same thing happens on my DroidX2 Fails on boot after keyboard is
unlocked and then works correct when started by touching icon.

1015}I/SurfaceFlinger(   58): Boot is finished (26269 ms)I/
ARMAssembler(   58): generated
scanline__0177:03515104_0001_ [ 73 ipp] (95 ins) at
[0x2eec50:0x2eedcc] in 1496954 nsI/ActivityThread(  227): Publishing
provider com.android.email.provider:
com.android.email.provider.EmailProviderI/ActivityThread(  227):
Publishing provider com.android.exchange.provider:
com.android.exchange.provider.ExchangeProviderI/ActivityThread(  227):
Publishing provider com.android.email.attachmentprovider:
com.android.email.provider.AttachmentProviderD/dalvikvm(   58):
GC_EXPLICIT freed 4280 objects / 204952 bytes in 179msD/
Exchange(  227): BootReceiver onReceiveI/ActivityManager(   58): Start
proc com.needham.RxBcast for broadcast com.needham.RxBcast/
com.needham.PiesOfCod.RxBcast: pid=237 uid=10040 gids={}D/EAS
SyncManager(  227): !!! EAS SyncManager, onCreateD/EAS
SyncManager(  227): !!! EAS SyncManager, onStartCommandD/EAS
SyncManager(  227): !!! EAS SyncManager, stopping selfD/Eas
Debug(  227): Logging: D/EAS SyncManager(  227): !!! EAS SyncManager,
onDestroy

**  I unlock  emulator

D/KeyguardViewMediator(   58): pokeWakelock(5000)D/
KeyguardViewMediator(   58): pokeWakelock(5000)I/ARMAssembler(   58):
generated scanline__0177:03515104_1001_ [ 91 ipp] (114
ins) at [0x333bb8:0x333d80] in 2730008 nsI/ActivityManager(   58):
Displayed activity com.android.launcher/
com.android.launcher2.Launcher: 19060 ms (total 19060 ms)D/
AndroidRuntime(  237): Shutting down VMW/dalvikvm(  237): threadid=1:
thread exiting with uncaught exception (group=0x4001d800)


***  Bad stuff here
E/AndroidRuntime(  237): FATAL EXCEPTION: mainE/AndroidRuntime(  237):
java.lang.RuntimeException: Unable to instantiate receiver
com.needham.PiesOfCod.RxBcast: java.lang.ClassNotFoundException:
com.needham.PiesOfCod.RxBcast in loader dalvik.system.PathClassLoader[/
data/app/com.needham.RxBcast-1.apk]E/AndroidRuntime(  237): at
android.app.ActivityThread.handleReceiver(ActivityThread.java:2789)E/
AndroidRuntime(  237):  at android.app.ActivityThread.access
$3200(ActivityThread.java:125)E/AndroidRuntime(  237):  at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:2083)E/
AndroidRuntime(  237):  at
android.os.Handler.dispatchMessage(Handler.java:99)E/
AndroidRuntime(  237):  at android.os.Looper.loop(Looper.java:123)E/
AndroidRuntime(  237):  at
android.app.ActivityThread.main(ActivityThread.java:4627)E/
AndroidRuntime(  237):  at
java.lang.reflect.Method.invokeNative(Native Method)E/
AndroidRuntime(  237):  at java.lang.reflect.Method.invoke(Method.java:
521)E/AndroidRuntime(  237):at com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:868)E/AndroidRuntime(  237):
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)E/
AndroidRuntime(  237):  at dalvik.system.NativeStart.main(Native
Method)E/AndroidRuntime(  237): Caused by:
java.lang.ClassNotFoundException: com.needham.PiesOfCod.RxBcast in
loader dalvik.system.PathClassLoader[/data/app/
com.needham.RxBcast-1.apk]E/AndroidRuntime(  237):  at
dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)E/
AndroidRuntime(  237):  at
java.lang.ClassLoader.loadClass(ClassLoader.java:573)E/
AndroidRuntime(  237):  at
java.lang.ClassLoader.loadClass(ClassLoader.java:532)E/
AndroidRuntime(  237):  at
android.app.ActivityThread.handleReceiver(ActivityThread.java:2780)E/
AndroidRuntime(  237):  ... 10 moreI/ARMAssembler(   58): generated
scanline__0077:03515104__ [ 33 ipp] (47 ins) at
[0x33c728:0x33c7e4] in 493939 nsD/MediaScanner(  201):  prescan time:
4232msD/MediaScanner(  201): scan time: 5msD/MediaScanner(  201):
postscan time: 1msD/MediaScanner(  201):total time: 4238msD/
MediaScannerService(  201): done scanning volume internalD/
dalvikvm(  123): GC_EXTERNAL_ALLOC freed 12767 objects / 663160 bytes
in 129msI/Launcher.Model(  123): not binding apps: no Launcher
activityD/dalvikvm(  123): GC_EXPLICIT freed 1892 objects / 94832
bytes in 182msD/dalvikvm(  123): GC_EXPLICIT freed 3604 objects /
193968 bytes in 228msI/Process (  237): Sending signal. PID: 237 SIG:
9W/InputManagerService(   58): Window already focused, ignoring focus
gain of: com.android.internal.view.IInputMethodClient$Stub
$Proxy@44eb94c0I/ActivityManager(   58): Process com.needham.RxBcast
(pid 237) has died.D/SntpClient(   58): request time failed:
java.net.SocketException: Address family not supported by protocolD/
dalvikvm(  123): GC_EXTERNAL_ALLOC freed 341 objects / 19920 bytes in
67msW/KeyCharacterMap(  123): No keyboard for id 0W/
KeyCharacte

Re: [android-developers] Re: start at boot app gives instantiationException:

2012-02-21 Thread Ted Scott

On 2/21/2012 3:02 PM, Thomas wrote:

The compile error:
* PiesOfCodActivity cannot be resolved to a type

The error essentially is that the RxBcast cannot be aware of an
external app that exists on an Android somewhere.  The
PiesOfCodActivity is a retitled "helloworld" that works just fine on
my Android.
Perhaps there is some sort of intent construction where the app-to-be-
is a string that represents future runtime intentions.
Thanks for all of your good thoughts and help.
Of course not you put it in a different application. That's not what I 
thought you asked about, I thought you wanted an app that would launch 
at boot. Did you get it working with the receiver in the same package?


To launch another activity outside your package you need different 
information in the intent. One way is to specify the package of the 
other app:
Intent si = new 
Intent(Intent.ACTION_MAIN).setPackage("com.hootinholler.PiesOfCod");


The other app needs to have an action MAIN defined in its manifest and 
it also needs a category DEFAULT



I've tested this here with one application that only has the 
PiesOfCodActivity in the PiesOfCod package and another app that only has 
the RxBcast in a Pies package and constructs the intent as above.


Really this didn't take that much to solve given a little reading and 
experimentation. I agree with Tre that you should probably read up on 
Intents and how they get created and resolved.


Also I don't think it will be a good idea to have an app with no 
launchable activity as it could make it hard for users to uninstall


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


Re: [android-developers] Re: start at boot app gives instantiationException:

2012-02-21 Thread TreKing
On Tue, Feb 21, 2012 at 2:02 PM, Thomas  wrote:

> Perhaps there is some sort of intent construction where the app-to-be- is
> a string that represents future runtime intentions.
>

You should read the Intent documentation thoroughly.
Then see this:
http://developer.android.com/reference/android/content/Intent.html#setComponent(android.content.ComponentName)


However, if you think need to specify the target activity by name, you are
almost assuredly doing something wrong.

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

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

[android-developers] Re: start at boot app gives instantiationException:

2012-02-21 Thread Thomas
The program is this:

package com.needham.RxBcast;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;


public class RxBcast extends BroadcastReceiver {

private static final String TAG = "RxBcast";
private static final int NOTE_ID = 1;

@Override
public void onReceive(Context c, Intent i) {
// check and handle registerable actions
String act = i.getAction();
Log.d(TAG, "Rxd "+ act );
if( act.equals(i.ACTION_BOOT_COMPLETED) ) {
Intent si = new Intent(c, PiesOfCodActivity.class );  *** see error
below
si.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
c.startActivity(si);
}
} // onReceive

}


The compile error:
* PiesOfCodActivity cannot be resolved to a type

The error essentially is that the RxBcast cannot be aware of an
external app that exists on an Android somewhere.  The
PiesOfCodActivity is a retitled "helloworld" that works just fine on
my Android.
Perhaps there is some sort of intent construction where the app-to-be-
is a string that represents future runtime intentions.
Thanks for all of your good thoughts and help.

Tom B




On Feb 21, 10:52 am, Ted Scott  wrote:
> Did you follow the steps I outlined? What intent are you speaking of
> that can't find the app? Speaking of the app, you're talking about the
> hello world or pies of cod app, right? What do you mean by an external app?
>
> Tell us exactly what you are doing and maybe we can help.
>
> On 2/21/2012 9:11 AM, Thomas wrote:
>
>
>
>
>
>
>
> > Thanks to all who have contributed answers to my questions.  The last
> > problem is that the intent cannot find the called app.  Perhaps it's a
> > misspelling or perhaps the fact it's an external app and I need some
> > slightly different intent format, or maybe lots of things.  I'll keep
> > at this and when I get the syntax correct, I'll post the answer.
> > Google searching turns up lot of commentary on the subject but all of
> > the snippets have proven not to work.
> > Best,
> > Tom B
>
> > On Feb 20, 6:46 pm, Ted Scott  wrote:
> >> On 2/20/2012 2:26 PM, Thomas wrote:
>
> >>> I'll make another request then.  Please post the code and manifest for
> >>> a simple something that will start the "helloworld" app at bootup.
> >>> The helloworld app is just a test case to see if things are working at
> >>> bootup. I have a far more complicated embedded application to test
> >>> after that.
> >>> Best,
> >>> Tom B
> >> You know I explained where to get the information you were missing is
> >> at, I even explained what you were confused about.  If indeed you have a
> >> far more complicated embedded app to test, judging by the level of your
> >> questions and failure to understand or even explore the material given
> >> to you, I predict you will be bricking that device.
>
> >> Nonetheless for the comedic value I give you Pies Of Cod, or at least
> >> the parts you asked for. Yes this code executes and launches the app
> >> Pies Of Cod when it is in a proper app environment. It took me about
> >> half an hour to cobble together. Of course you'll want to adjust the
> >> imports and packages to fit your environment so I omitted them. The view
> >> is the main.xml you get from an eclipse generated hello world app.
>
> >> First make a new android app named PiesOfCod in your workspace. Launch
> >> it and make sure it runs.
>
> >> Then you need to create a receiver class:
> >> public class RxBcast extends BroadcastReceiver {
>
> >>       private static final String TAG = "RxBcast";
> >>       private static final int NOTE_ID = 1;
>
> >>       @Override
> >>       public void onReceive(Context c, Intent i) {
> >>           // check and handle registerable actions
> >>           String act = i.getAction();
> >>           Log.d(TAG, "Rxd "+ act );
> >>           if( act.equals(i.ACTION_BOOT_COMPLETED) ) {
> >>               Intent si = new Intent(c, PiesOfCodActivity.class);
> >>               si.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
> >>               c.startActivity(si);
> >>           }
> >>       } // onReceive
>
> >> }
>
> >> Then change the strings:
>
> >> 
> >> 
> >> Pies Of Cod!
> >> PiesOfCod
> >> 
>
> >> Then adjust the manifest, yes you will have to use your package names,
> >> etc. mine won't work for you:
>
> >> 
> >>  >> />
>
> >>  >>           android:icon="@drawable/ic_launcher"
> >>           android:label="@string/app_name">
> >>  >>               android:name=".PiesOfCodActivity"
> >>               android:label="@string/app_name">
> >> 
> >> 
>
> >> 
> >> 
> >> 
>
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
>
> >> 
>
> >> Build it, launch it, then restart the AVD that you have it installed on
> >> and it should be open when you unlock the AVD.
>
> >> Good luck with your very complicated embedded application, and please
> >> keep us informed on how that is going.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to andr

Re: [android-developers] Re: start at boot app gives instantiationException:

2012-02-21 Thread Ted Scott
Did you follow the steps I outlined? What intent are you speaking of 
that can't find the app? Speaking of the app, you're talking about the 
hello world or pies of cod app, right? What do you mean by an external app?


Tell us exactly what you are doing and maybe we can help.

On 2/21/2012 9:11 AM, Thomas wrote:

Thanks to all who have contributed answers to my questions.  The last
problem is that the intent cannot find the called app.  Perhaps it's a
misspelling or perhaps the fact it's an external app and I need some
slightly different intent format, or maybe lots of things.  I'll keep
at this and when I get the syntax correct, I'll post the answer.
Google searching turns up lot of commentary on the subject but all of
the snippets have proven not to work.
Best,
Tom B

On Feb 20, 6:46 pm, Ted Scott  wrote:

On 2/20/2012 2:26 PM, Thomas wrote:


I'll make another request then.  Please post the code and manifest for
a simple something that will start the "helloworld" app at bootup.
The helloworld app is just a test case to see if things are working at
bootup. I have a far more complicated embedded application to test
after that.
Best,
Tom B

You know I explained where to get the information you were missing is
at, I even explained what you were confused about.  If indeed you have a
far more complicated embedded app to test, judging by the level of your
questions and failure to understand or even explore the material given
to you, I predict you will be bricking that device.

Nonetheless for the comedic value I give you Pies Of Cod, or at least
the parts you asked for. Yes this code executes and launches the app
Pies Of Cod when it is in a proper app environment. It took me about
half an hour to cobble together. Of course you'll want to adjust the
imports and packages to fit your environment so I omitted them. The view
is the main.xml you get from an eclipse generated hello world app.

First make a new android app named PiesOfCod in your workspace. Launch
it and make sure it runs.

Then you need to create a receiver class:
public class RxBcast extends BroadcastReceiver {

  private static final String TAG = "RxBcast";
  private static final int NOTE_ID = 1;

  @Override
  public void onReceive(Context c, Intent i) {
  // check and handle registerable actions
  String act = i.getAction();
  Log.d(TAG, "Rxd "+ act );
  if( act.equals(i.ACTION_BOOT_COMPLETED) ) {
  Intent si = new Intent(c, PiesOfCodActivity.class);
  si.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
  c.startActivity(si);
  }
  } // onReceive

}

Then change the strings:



Pies Of Cod!
PiesOfCod


Then adjust the manifest, yes you will have to use your package names,
etc. mine won't work for you:

























Build it, launch it, then restart the AVD that you have it installed on
and it should be open when you unlock the AVD.

Good luck with your very complicated embedded application, and please
keep us informed on how that is going.


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


[android-developers] Re: start at boot app gives instantiationException:

2012-02-21 Thread Thomas
Thanks to all who have contributed answers to my questions.  The last
problem is that the intent cannot find the called app.  Perhaps it's a
misspelling or perhaps the fact it's an external app and I need some
slightly different intent format, or maybe lots of things.  I'll keep
at this and when I get the syntax correct, I'll post the answer.
Google searching turns up lot of commentary on the subject but all of
the snippets have proven not to work.
Best,
Tom B

On Feb 20, 6:46 pm, Ted Scott  wrote:
> On 2/20/2012 2:26 PM, Thomas wrote:
>
> > I'll make another request then.  Please post the code and manifest for
> > a simple something that will start the "helloworld" app at bootup.
> > The helloworld app is just a test case to see if things are working at
> > bootup. I have a far more complicated embedded application to test
> > after that.
> > Best,
> > Tom B
>
> You know I explained where to get the information you were missing is
> at, I even explained what you were confused about.  If indeed you have a
> far more complicated embedded app to test, judging by the level of your
> questions and failure to understand or even explore the material given
> to you, I predict you will be bricking that device.
>
> Nonetheless for the comedic value I give you Pies Of Cod, or at least
> the parts you asked for. Yes this code executes and launches the app
> Pies Of Cod when it is in a proper app environment. It took me about
> half an hour to cobble together. Of course you'll want to adjust the
> imports and packages to fit your environment so I omitted them. The view
> is the main.xml you get from an eclipse generated hello world app.
>
> First make a new android app named PiesOfCod in your workspace. Launch
> it and make sure it runs.
>
> Then you need to create a receiver class:
> public class RxBcast extends BroadcastReceiver {
>
>      private static final String TAG = "RxBcast";
>      private static final int NOTE_ID = 1;
>
>      @Override
>      public void onReceive(Context c, Intent i) {
>          // check and handle registerable actions
>          String act = i.getAction();
>          Log.d(TAG, "Rxd "+ act );
>          if( act.equals(i.ACTION_BOOT_COMPLETED) ) {
>              Intent si = new Intent(c, PiesOfCodActivity.class);
>              si.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
>              c.startActivity(si);
>          }
>      } // onReceive
>
> }
>
> Then change the strings:
>
> 
> 
> Pies Of Cod!
> PiesOfCod
> 
>
> Then adjust the manifest, yes you will have to use your package names,
> etc. mine won't work for you:
>
> 
> 
>
>           android:icon="@drawable/ic_launcher"
>          android:label="@string/app_name" >
>               android:name=".PiesOfCodActivity"
>              android:label="@string/app_name" >
> 
> 
>
> 
> 
> 
>
> 
> 
> 
> 
> 
> 
> 
> 
> 
>
> 
>
> Build it, launch it, then restart the AVD that you have it installed on
> and it should be open when you unlock the AVD.
>
> Good luck with your very complicated embedded application, and please
> keep us informed on how that is going.

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


Re: [android-developers] Re: start at boot app gives instantiationException:

2012-02-20 Thread Ted Scott

On 2/20/2012 2:26 PM, Thomas wrote:

I'll make another request then.  Please post the code and manifest for
a simple something that will start the "helloworld" app at bootup.
The helloworld app is just a test case to see if things are working at
bootup. I have a far more complicated embedded application to test
after that.
Best,
Tom B



You know I explained where to get the information you were missing is 
at, I even explained what you were confused about.  If indeed you have a 
far more complicated embedded app to test, judging by the level of your 
questions and failure to understand or even explore the material given 
to you, I predict you will be bricking that device.


Nonetheless for the comedic value I give you Pies Of Cod, or at least 
the parts you asked for. Yes this code executes and launches the app 
Pies Of Cod when it is in a proper app environment. It took me about 
half an hour to cobble together. Of course you'll want to adjust the 
imports and packages to fit your environment so I omitted them. The view 
is the main.xml you get from an eclipse generated hello world app.


First make a new android app named PiesOfCod in your workspace. Launch 
it and make sure it runs.


Then you need to create a receiver class:
public class RxBcast extends BroadcastReceiver {

private static final String TAG = "RxBcast";
private static final int NOTE_ID = 1;

@Override
public void onReceive(Context c, Intent i) {
// check and handle registerable actions
String act = i.getAction();
Log.d(TAG, "Rxd "+ act );
if( act.equals(i.ACTION_BOOT_COMPLETED) ) {
Intent si = new Intent(c, PiesOfCodActivity.class);
si.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
c.startActivity(si);
}
} // onReceive

}

Then change the strings:



Pies Of Cod!
PiesOfCod



Then adjust the manifest, yes you will have to use your package names, 
etc. mine won't work for you:


























Build it, launch it, then restart the AVD that you have it installed on 
and it should be open when you unlock the AVD.


Good luck with your very complicated embedded application, and please 
keep us informed on how that is going.


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


Re: [android-developers] Re: start at boot app gives instantiationException:

2012-02-20 Thread TreKing
On Mon, Feb 20, 2012 at 1:26 PM, Thomas  wrote:

> Please post the code and manifest for a simple something that will start
> the "helloworld" app at bootup.
>

Have you tried a Google search for something like "Android start at boot
example"?
I would guess there is plenty of information on this topic readily
available.

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

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

[android-developers] Re: start at boot app gives instantiationException:

2012-02-20 Thread Thomas
I'll make another request then.  Please post the code and manifest for
a simple something that will start the "helloworld" app at bootup.
The helloworld app is just a test case to see if things are working at
bootup. I have a far more complicated embedded application to test
after that.
Best,
Tom B

On Feb 20, 12:05 pm, Ted Scott  wrote:
> Review the components section 
> herehttp://developer.android.com/guide/topics/fundamentals.html
>
> You are confusing a BroadcastReceiver with an Activity, and there's
> nothing you can add to the manifest to correct that since an activity
> tag can't describe or invoke a receiver. If you want to launch something
> at boot, then code a receiver that launches the app.
>
> On 2/20/2012 10:34 AM, Thomas wrote:
>
>
>
>
>
>
>
> > Actually, I don't.  What should the manifest be in this case?
> > Tom B
>
> > On Feb 20, 10:05 am, TreKing  wrote:
> >> You have the following:
>
> >> public abstract class StartAtBootActivity extends *BroadcastReceiver*{
>
> >>> <*activity *android:name=".StartAtBootActivity"
> >> See the problem with this scenario?
>
> >> -
> >> TreKing  - Chicago
> >> transit tracking app for Android-powered devices

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


Re: [android-developers] Re: start at boot app gives instantiationException:

2012-02-20 Thread Ted Scott
Review the components section here 
http://developer.android.com/guide/topics/fundamentals.html


You are confusing a BroadcastReceiver with an Activity, and there's 
nothing you can add to the manifest to correct that since an activity 
tag can't describe or invoke a receiver. If you want to launch something 
at boot, then code a receiver that launches the app.


On 2/20/2012 10:34 AM, Thomas wrote:

Actually, I don't.  What should the manifest be in this case?
Tom B

On Feb 20, 10:05 am, TreKing  wrote:

You have the following:

public abstract class StartAtBootActivity extends *BroadcastReceiver*{




<*activity *android:name=".StartAtBootActivity"

See the problem with this scenario?

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


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


Re: [android-developers] Re: start at boot app gives instantiationException:

2012-02-20 Thread TreKing
On Mon, Feb 20, 2012 at 9:34 AM, Thomas  wrote:

> Actually, I don't.


That's what you posted 

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

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

[android-developers] Re: start at boot app gives instantiationException:

2012-02-20 Thread Thomas
Actually, I don't.  What should the manifest be in this case?
Tom B

On Feb 20, 10:05 am, TreKing  wrote:
> You have the following:
>
> public abstract class StartAtBootActivity extends *BroadcastReceiver*{
>
>
>
> > <*activity *android:name=".StartAtBootActivity"
>
> See the problem with this scenario?
>
> -
> TreKing  - Chicago
> transit tracking app for Android-powered devices

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