Android : Start Application Knowing Package Name?
Aug 6, 2010Can someone tell me how to start new application knowing only its package name? I do not have information about what activity is the main one.

Can someone tell me how to start new application knowing only its package name? I do not have information about what activity is the main one.
I know how to update my own programs, and I know how to open programs using the a predefined Uri (for sms or email for example)
I need to know how I can create an Intent to open MyTracks or any other application that I don't know what intents they listen to.
I got this info from DDMS, but I havn't been succesful in turning this to an Intent I can use. This is taken from when opening MyTracks manually.
CODE:..................
My application has 2 packages because one is shared with my other applications. I want to start an activity of the shared package.
I tried the following: Intent intent = new Intent(); intent.setClassName(shardedPackageName,sharedActivityName); startActivity(intent);
It throws an ActivityNotFoundException and suggests that the activity might not be in the manifest. But how do I list an acitivity from another package in the manifest?
I have two apps, one runs in namespace com.gtosoft.voyager and the other is com.gtosoft.dash. From com.gtosoft.dash I would like to start up the service which is defined in com.gtosoft.voyager...
I think I need an intent, but what arg(s) would I pass to the intent before kicking it off with startService()?
If they were in the same package I could just use
CODE:............................
I have a service class my.app.MyService that I'm attempting to launch from my.app.MyActivity as follows:
Intent svc = new Intent( this, MyService.class );
The manifest contains the entries:
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_SERVICE" />
<service android:name =".MyService" />
LogCat gives the message:
"Unable to start service Intent { comp={"my.app/ my.app.MyService" } } : not found"
Could someone kindly let me know what I am missing?
i'm a bit stuck with remote services in android. thing is i implemented a remote service in package "a.b.c" and i want other applications to be able to access this service. i got rid of the whole crappy aidl-stuff and designed the "interface" of the service to work via broadcasted intents. works fine so far...
problem is: how do i get a different application (different package, different project, maybe even a different developer, ...) to start/stop the service?
CODE:..........
This will crash my app immediately on startup. what did i do wrong? how will i get this to work?
once it's running, commands and data will be passed via broadcasts. so that should be no real problem...
I'm am creating an Android application, but in order to have one of the functionalities working I need to read a predefined xml file whilst only knowing its name, not the R.id..
In normal Java I know I can use
getClass().getClassLoader().getResource(xmlName)
But using the limited Android SDK thats not working, any knows how to solve this?
How to install package without asking user just like market app?
View 7 Replies View RelatedI'm working on the upgrade process for an Android app and am having a hard time ensuring a graceful shutdown of the old version. Can someone explain how the old version of the app is killed and if there is anything we can do to hook into the process? In more detail:
We notice that a new version of our app is available and launch a new activity with Intent.ACTION_VIEW pointing to the new apk file (or to the marketplace, once our app is there). However, the user has 2 chances to abort the install (once at the warning about reinstalling the app, and the second when warned about the permissions our app needs). My understanding is that I can't use startActivityForResult() with ACTION_VIEW, so I can't find out if the Action is aborted or not. So we can't tell if/when the install has been started.
We'd like to ensure that our app shuts down cleanly since we use a lot of native code and threads. We could kill our app proactively, as soon as we launch the ACTION_VIEW activity, but then we're left in a bad state if the user aborts. We could wait for the installer to remove our files, prior to installing the new version, but that's a hack. Is there any clean way to do this? Our main window is never seeing an onDestroy(), btw.
I have developed an application which has several packages within it's project. A class in one of those packages is called right away in the first line of code, which throws the dreaded java.lang.NoClassDefFoundError error. I don't get it, the package simply is within the project, and it works fine on my Android 1.6 device, but won't work with my 1.5 device. I do have to say that the project was originally set for 1.6, but then I changed the within the manifest from 4 to 3. Is that bad practice? Or maybe it has nothing to do with the platform version? Also I do get these lines as wel from the DDMS :
05-04 17:24:59.921: WARN/dalvikvm(2041): VFY: unable to resolve static field 2 (MANUFACTURER) in Landroid/os/Build;
05-04 17:24:59.921: WARN/dalvikvm(2041): VFY: rejecting opcode 0x62 at 0x0034
05-04 17:24:59.921: WARN/dalvikvm(2041): VFY: rejected ***/android/managementModule/Management;.getDeviceSpecifics ()V
05-04 17:24:59.921: WARN/dalvikvm(2041): Verifier rejected class ***/android/managementModule/Management;......
I'm developing on Android at the moment and want to know the best mobile app analytics for android and iPhone. I only need usage stats at the moment.
View 3 Replies View RelatedMy app is creating a directory by using File thisDir = getDir("mycustomname", Context.MODE_WORLD_WRITEABLE); It is stored at /data/data/package/app_mycustomname/. I can browse that directory with DDMS or with 'adb shell', of course, it is empty. My App then creates some subdirectories there, and those have subdirectories too, and so on, and creates files in several of those. My app can read all those dirs and files, too. Sometimes I have to take a look at this directory tree, but I cannot browse deep into that tree, neither using DDMS (both inside Eclipse and standalone) nor using the shell. I can see that there is a directory called / data / data / package / app_mycustomname / mysubdirectory and I can even 'cd' into this directory. But when I do a 'ls' there, the directory is reported to be empty, though I'm sure there must be something inside. app_mycoustomname has the permissions drwxrwx-wx app_mycoustomname/mysubdirectory has the permissions drwxrwxrwx. I have the same issue on the emulator and on the ADP1, both running a 1.1 firmware.
View 4 Replies View RelatedI am using Windows XP and Eclipse to develop. I updated everything today, the new sdk, the new adt etc. After that, when I tried to "export signed application package", nothing happened. If I click "export unsigned application package", a dialog box showed up. Anything i missed? How can I fix this problem? - 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@google groups.com To unsubscribe from this group, send email to android-developers +unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
View 3 Replies View RelatedI'm looking for a way to calculate the size of an installed Android application/package. I can't find this information in neither ApplicationInfo nor PackageInfo objects. From the ApplicationInfo I can get the path for the data and the app itself. Data is a directory structure, but when attempting to read it recursivly I get a nullpointer. Is there any better way of doing it? Any sample code?
View 1 Replies View Relatedi work on custom Application Manager and try to get the disk usage of installed package. So PackageManager.getpackageSizeInfo was removed from SDK on 0.9->1.0 update android.content.pm. PackageStats(String pkgName)(cacheSize, codeSize, dataSize) returns always "0" Size of phys. file (java.io.File) in "/data/app" seems wrong/not completely. Has anybody any solution to get the total disc space used by an installed package?
View 4 Replies View RelatedHow to know the list of available extra for a intent?For example, I want to know all available extra for ACTION_BATTERY_CHANGED. What is the method to know them?I have seen nothing on the official dev guide, reference in http://developer.android.com.I have seen nothing on watching the intent on debugger (on Eclipse)I have seen no methods on the intent documentation, like myIntent.getListExra()
View 2 Replies View RelatedI want to do an animation with several image-files, and for this the AnimationDrawable works very well. However, I need to know when the animation starts and when it ends (i.e add a listener like the Animation.AnimationListener). After having searched for answers, I'm having a bad feeling the AnimationDrawable does not support listeners..Does anyone know how to do frame-by-frame image animation on Android?
View 4 Replies View Relatedi want to whether i can create an app without knowing anything about java..i have installed the sdk but can't go any futher..do i need to know about java??
View 3 Replies View RelatedI'm looking for a way to iterate a viewgroup to retrieve all child views without calling findViewById(). Does view count and view position line up? So can I get the view count and then use that as a counter to call getChildAt(int index)?
View 2 Replies View RelatedHow can I start a new application on Android? I have done a new applications NewHomeScreen and Hello and on NewHomeScreen I wrote this code.
CODE:............
However, it does not start Hello application. Debugger says that state has value null but what should it be? I also wrote this to Manifest:
CODE:....................
I would like to know if anybody knows how I can start my application with an incoming SMS message.
For example, I send an SMS message from phone A to Phone B. When Phone B receives the message, it checks if it is sent to my program. If it is, it starts(run) my application. Important thing here is that my program is not running in the device unless SMS is received, so it can not be listening for SMS itself.
I have droidstats app. But i am now looking for a MMS only app. Reason is MMS messages do not count as part of my unlimited sms package, were as before it use deduct 4 sms per mms.
View 1 Replies View RelatedIs there any one know how to open an App when the Android OS start up, I have to do it in an embedded system?
View 4 Replies View RelatedI love the new Twitter App. I do have one question though. When I open the "Tweets Page", is there any way to set it to start where I left off as opposed to the most recent?
View 1 Replies View RelatedI want to know if there is any way to start another application from within my application. Specifically i am trying to a have a shortcut (button) to Google Maps Application within my application. Also is there any way to start another process from within my android appplication?
View 4 Replies View RelatedHow can I start my android application after pressing particular key?
View 3 Replies View RelatedI want to start my application just after it gets installed on the device. Is there any way out in Android to do so. I was wondering if there is any receiver to get informed on package installed.
View 8 Replies View RelatedI have application A defined as below:
CODE:.................
Now in application B, how can I write the code to start the activity in application A?
I was wondering I looked but did not find.I was reading that I can put 1.6 with touchwiz on my behold 2.Don't understand how to do it but my question is that in that thread somebody wrote that after you finish installing this you are the proud owner of waldo app.i know my phone says version 1.5 but it has the waldo app and also the voice search for google.oh and my phone is stock because I tried to root but have the dumb update that can't root!
View 4 Replies View RelatedI have to use java.awt.image package for BufferedImage class in my android app But I am not able to do this and does anyone knows that how to do this in android or What's the equivalent class of java.awt.Image in Android?
View 1 Replies View Related