How to re-build the default "Launcher" application? - android

My goal is to modify the Launcher application and dynamically modify and change the theme.
I saw several 'home' apps at http://www.cyrket.com/p/android/com.stain46.taghome/. It looks like they took the default Home(Launcher) and modified it. How did they do that? What do I need to modify to achieve the same thing?

I have done this with the ICS launcher. You also need to do quite a number of code changes to get it to compile as a normal app because it uses a lot of private internal APIs (despite what Google may have implied). You also need to change the package name. There are two limitations I've found:
There's a filter called TableMaskFilter that isn't available to normal apps. I think this allows the app drawer to be semi-transparent, but I removed uses of it and it looks fine I think.
More critically, it appears there is no way to replicate the widget-adding experience because it requires a permission that only system apps can have. See this question.
Anyway, I put my source here. It compiles and works on the official Galaxy S2 4.0.3, but if you try to add widgets it will crash.
Note, when you're changing the package name, there are places that Eclipse's refactor doesn't notice (e.g. XML layouts). I recommend you do a global text search/replace instead.

The standard Launcher is open source so you can definitely grab it and modify it the way you want. For your app to be used as the Home Screen you will need to specify the correct Intent filter in your AndroidManifest.xml and the user will have to choose your app when they press the Home button. Why don't you grab that code, play with it and come back when you have more questions and more of an idea of what you want to change.

Here i found one stable version Launcher2
I have sharing that GitHub repo. HERE
WIKI of this project :
This project contains the code for the Launcher app that ships with Android Jelly Bean (API 16).
Some minor changes were required from this source code to remove the use of private APIs. These changes have been marked by "// AOSP Change"

Related

Widgets gone after app update

After updating my app sometimes all old widgets disappear from home screen.
And in app launcher/widget chooser my three widgets appear twice - until reboot!
Any suggestions?
On this page there is a long article talking about this issue.
The core of the issue seems to be this:
It is important that we use our own keys with the widget update
action, if we use AppWidgetManager.EXTRA_WIDGET_IDS we will not only
break our own widget, but others as well.
Unfortunately my code is not affected by this issue but I still have users reporting the issue.
Also found this report
My widgets disappeared after upgrading S4 to android lollipop. Discovered by accident that if you double tap the left soft key there is a widget icon at the bottom of the screen. Tap the icon to open widgets and there they all are!
This is an OS bug, because of the way it updates apps, making them unavailable for quite some time. If a launcher is updating the widgets during that time, it will likely dismiss them, except if it implements a specific workaround to avoid this situation.
Please stare at the issue here so that (maybe) Google considers fixing it: https://code.google.com/p/android/issues/detail?id=188137
if you change exact package path for a widget that'll break the upgrade and widget will disappear on upgrade
This question give us a solution.
We were implementing Xamarin.Android project using MvvmCross. This project uses widgets, and on app update the widget disappeared. The question mentioned in the link give us a path to find the solution, We used APK-Analyzer to analyze the difference between old and new APKs, and by looking into AndroidManifiest.xml files we figured out that the used AppWidgetProvider has a different package name. By searching more we found a release note from Microsoft
which says:
The names for generated Java types are different in this release. Any project that explicitly uses one of the old names that starts with md5 will need to be updated by hand to account for this change. See Breaking change for generated Java type names below for more details.
And by defining a constant name by replacing the following from:
[BroadcastReceiver(Label = "Widget Title")]
public class CustomProvider : AppWidgetProvider
to
[BroadcastReceiver(Label = "Widget Title", Name = "<old package name>.CustomProvider")]
public class CustomProvider : AppWidgetProvider
the problem solved.

Custom Android MMS/SMS application from source code?

Okay here's the deal:
I want to download the full source of the MMS/SMS application that ships with Android phones. I want to be able to modify it, and add a little custom functionality to it.
I am developing using Eclipse, and I'm on Windows 7. I have noticed that there is now a Git for Windows, but I am pretty lost in it and not sure how to integrate everything with Eclipse.
Basically, I want to just get it to the point where I have all the source code visible in Eclipse and be able to see the app run JUST like the built-in texting/MMS app that is already on my phone. Then I'll know that I can modify it and proceed.
Any ideas?
Thanks!
There's a mirror of the SMS/MMS app on GitHub here. Just import that to Eclipse and customise away.
Unless you want to customize and use it only on your own phone (without publishing), this is not a good idea. This is because it uses classes that are hidden from the sdk. By default you won't even be able to build the apk via eclipse, but there is a way. The reason why this is a bad idea is that the hidden apis are not guaranteed to remain the same through different api-levels and your app can stop working with the next android update, and might also not work on previous api-levels. In-fact your app might not even work on selected phones running the same api-level.

Is it possible to configure an Android install to run a single app?

Is it possible to configure the Android OS to run only a single app?
Basically what I want to do is customize an Android device so that it boots up and runs one application only, and for that application to be switched to the front of the screen automatically. Also, when it gets closed, to be started up and switched to again. Any ideas?
Thanks,
-David
One method is to get the source of Android and write your own custom ROM of Android as Octavian wrote.
Another alternative would be to write a custom home app that, well, isn't really a home app (but replaces the default home app intent). See SlideScreen as an example of a non-traditional "home" app.
Yes it is possible. You have to fetch yourself the source codes for Android and basically create a custom ROM. After applying all desired modifications you bake your ROM and install it to your device.
Pretty much all you need to know about the source and the process of compiling the sources are located at Android Sources. You can view the source codes from your browser by following this link.
Hope it helps you a bit. Good luck.

Where is the drawable for the handle of a SlidingDrawer defined?

I want to use a SlidingDrawer in an activity, and I would love to just use the built-in tray handle, rather than try to find or create my own. I found it online thanks to CommonsWare but I assume that they got it from the Android platform itself, so I figure it will benefit me in the long run to know where to find it, rather than just use their copy of it. I looked for it in my Android SDK installation, under platforms/android-8/android.jar/res/ but with no success.
Where can I find the above image, in the Android SDK itself, rather than just downloading it?
Look in the launcher app: ~\platform\packages\apps\Launcher\res\drawable\handle.xml
It uses all the drawables: tray_handle_normal, tray_handle_pressed, tray_handle_selected.
may be you can type android.R.drawable... in eclipse and let the intelli-sense display all the built in drawables.
but I think it's not there cause I searched for it and didn't find it too
thanks
Be carefull with using images that come with the system. Google itself states that they will not guarantee that these images will be included in the system in every release (the name may change). Also the design of your app will change if the user uses something like Blur or Sense that overrides a lot of the standard design items. If you use a copy of the drawable itself you now how your app will look and you can be sure that your app will keep working even if the manufacturer or Google changes the images that come with a device.

Is this a built in drawable?

In this linked image , I see the button on the right quite often in a lot of apps. On my Moto Droid, it is used extensively in the settings app. It is also used as the default AlertDialog icon. Can I use this via a android.r.drawable?
The icon is built-in with the Android development, you can access the image by using R.drawable.ic_dialog_menu_generic
While it may be possible to use it via android.R.drawable, you may want to find the image in the resources that come with your SDK ($ANDROID_HOME/platforms/$VERSION/data/res, where $ANDROID_HOME is where you have the SDK installed and $VERSION is a relevant Android API level). So, per Mr. Forloney's answer, you'll find that in, say, drawable-hdpi/ic_dialog_menu_generic.png in the aforementioned directory. Then, copy that image into your project. While it will add 5K to your project size, it will mean that the icon does not change based upon OEM or Android changes.

Categories

Resources