I have created a lib that when you add to your app adds a 2nd launcher icon (it'll be used for debugging network), the lib could be initialized from the application using its context or from an activity, I'd like to know in my lib if the application was launched from the 2nd launcher icon or another one.
One more thing I have different taskAfinity for my 2nd launcher.
The lib is also open source here: https://github.com/shehabic/sherlock
Does anybody know why the blank activity in the latest version of Android Studio now includes two .xml files for each Activity? My instinct is to use Empty Activity and continue doing things "the old way" but I'm wondering what Android's "bigger picture" is with these changes? Is it wiser to develop any future applications using this new Blank Activity format? Thank you.
Does anybody know why the blank activity in the latest version of Android Studio now includes two .xml files for each Activity?
For Android Studio 1.5, content_main.xml contains the core UI of the activity. activity_main.xml wraps that in a bunch of other stuff (e.g., CoordinatorLayout) to demonstrate a couple of particular UI elements (e.g., FAB). activity_main uses <include> to incorporate content_main by reference.
These templates change occasionally, and so if you are reading this in the future, your edition of the templates may differ substantially (and please stop reading Stack Overflow answers from your flying car, as that's a safety hazard).
I'm wondering what Android's "bigger picture" is with these changes?
IMHO, you are seriously overstating the role of these templates. They are samples, nothing more.
Is it wiser to develop any future applications using this new Blank Activity format?
It is wiser to not pay all that much attention to the templates. They are samples, nothing more. Developers should know what they want to build and how they want to build it. If one of the templates is close to what is desired, use it. Otherwise, skip the new-activity wizard entirely and just add the new activity yourself.
In cases where the new-activity logic is not directly avoidable (e.g., new-project wizard), either use "Empty Activity" (as it has the least stuff that you would need to delete) or find some other solution. For example, other than for experimenting with the new-project wizard itself, I never use it, and I make a few Android projects a week. Instead, I'll copy an existing project and adjust it to the new package name and stuff, then import it into Android Studio, as I find that less irritating than having to rip out template-generated gunk.
If you choose Blank Activity then you will have the option of having the activity use a Fragment. Also, Android Studio will automatically create two layout files for the activity, three if you choose the Fragment option, and also a menu resource file.
If you choose Empty Activity then you get to choose whether or not you want Android Studio to generate a layout file for the activity. If you choose the layout file option Android Studio will create one layout file, as opposed to two layout files in case of Blank Activity, and no menu resource file. Also, the layout file is much simpler and does not contain things like: Coordinator Layout, Floating Action Button, etc., whereas the layout file for Blank Activity contains these items, assuming you are using the latest version of Android Studio.
here is the repo https://github.com/mitch000001/ringdroid
so run git clone https://github.com/mitch000001/ringdroid to copy on your local.
My question im having a slight issue getting this to work in my Android app. The end goal is to have my host app use ringdroid as a library project so i can make calls to it as if it were apart of my host app. My host app would be thus dependent on ringdroid project.
What i have done is imported ringdroid as its own project into eclipse. then i set this project to be a library (have to change one switch statement to if statement, no big deal). then on my host android project's properties i add ringdroid as a library. I want to be able to start ringdroid on the press of a button from within my host app.
In my host app activity manifest file i define the ringdroid activity i want to call:
<activity android:name="com.Ringdroid.RingdroidSelectActivity"
android:label="#string/main_activity_label">
</activity>
then in my host project i have a button that i want to click that would start this activity but i keep getting a null pointer exception in onCreate of RingdroidSelectActivity. Can one of you run it and see what im doing wrong ?? keep in mind i have not altered the manifest file of the .RingdroidSelectActivity project except for removing the launcher category.
I figured this out.... In android you can add another project as a dependency of your own. What you have to do is define the depenedent activity your calling in the host apps manifest. I also had to put the permissions there as well.
It seems in ADT 20 the manifest are merged. I am using an older eclipse and ADT version so i had to merge the manifest myself.
So my dilemma is that I have two versions (we'll call version A and B) of my Android application, each on different phones. The difference between them is their launching activity name.
Now, there is a third version of my app which is an upgrade to either of the two versions I described above.
Now, I understand that you should have the same launching activity name on the new version of an app if you want things to upgrade correctly (i.e. keeping the same launcher icon).
So here's the problem: I have this third version that has the same launching activity name as version A, so after the upgrade happens, the same launcher icon is used which is what I want. However, when I try to upgrade version B which uses a different launching activity name from the upgrade, it deletes the old launcher icon and puts in a new launcher icon with the updated name.
This causes at least one notable problem: take the Galaxy Note for instance. You can add folders in your app drawer. If Version B was in a folder to begin with, the upgrade would cause that launcher icon to be removed and then the new launcher icon would be added to the drawer rather with the rest of the applications than the folder.
Now is there a way to provide two names to an activity-alias so that I can solve this issue? Any other suggestions? Please and thanks! I apologize in advance if any of this was not clear. Thanks for reading!
Android has several system icons available, such as these.
I can't use them in my application (for system notifications as an example) since they are not made public within the API. So I would like to add them to my project in eclipse using ADT.
Is there a way to do this automatically? For example, when I start a new android project, it allows me to create an icon for my project, and creates it in all sizes and places them in the correct resource folders. I'd like to import other icons from the android library the same way.
Thanks.
From what it says here:
NOTE: Some of the images in the Android jar are not public and
therefore cannot be directly used (you can copy them to you own
application, but can't reference them via the "android" package
namespace). This project does not distinguish between what is public
and what is not. If you try to use an image that is not public, you
will get an error indicating that fact.
So it seems that the way to go is to copy the icons to your project, as Android won't allow direct access to them.