I'm trying to figure out (if it's even possible) to override the behavior of the built in ICS launcher folders.
I have a specific and small change I'd like to add (simply add a button on the top to sort alphabetically to start with). From looking at the source for Launcher2 add the behavior should be easy enough, but I can't seem to figure out way to hook into the launcher and override specific bits.
I would hazard to guess that the correct approach is that you have to implement a full custom launcher (by altering the class I'm interested in changing and recompiling Launcher2) and that what I'm hoping to do isn't possible. Android/Java is not my day job so I'm hoping there might be a way that I'm not seeing that a more experienced developer is aware of.
In short is/how can I implement a custom subclass of com.android.Launcher2.Folder and have that used instead? Preferably with just a drop in app rather than having to completely override the normal ICS launcher app.
I'm trying to figure out (if it's even possible) to override the behavior of the built in ICS launcher folders.
No, sorry.
I would hazard to guess that the correct approach is that you have to implement a full custom launcher (by altering the class I'm interested in changing and recompiling Launcher2) and that what I'm hoping to do isn't possible.
Correct. Beyond that, you cannot simply reuse their code, as packages have to be unique in Android devices.
how can I implement a custom subclass of com.android.Launcher2.Folder and have that used instead?
Completely rebuild the firmware that contains the modified class, then use that modified firmware on your device. Or, refactor the entire home screen app into your own package, get it building as a standalone app (which may not be easy), and then add in your change.
Far simpler would be for you to make your own app widget that implements some sort of folder construct. That would not "override the behavior of the built in ICS launcher folders", but it could give you the functionality you seek.
Related
I have an Activity that, with a few modifications, would work extremely well as another part of the app I'm working on. I was wondering if it's possible to easily duplicate an Activity in Android Studio without needing to manually copy all of its dependencies (activity_my.xml for example).
To get it right: You have code you want to reuse in another Activity.
Now, the way I would do this would not be to copy the reused code (because if you want to modify it, you have to modify both copies, which is tedious work).
I'd create a base-activity, that has the functionality that both of your Activities need. This functionality would have to be slightly abstracted so that both activites could use this functionality by extending this BaseActivity and use it for their individual purposes.
If you post some code (the part of code both of your activities should have), I could update my answer to show you how that would look like in your case.
In one of requirement I need to develop an application where user can launch two application in separate area of screen.
Say Application A in half of the part of screen and in rest of part other application.
I know this could not be straight way to achieve it, but is there any possibility to build such kind of app/launcher. I checked some of mobile ROM support multi application window support.
Any suggestion to achieve this.
You'd have to have this support done on system level, same way Samsung did for example. W/o this you are out of luck.
this is system level thing unless you make you own customize rom it pretty much impossible to do ,if you want to make customize rom then you will be able to do since its an system level this launcher uses system property to do so.
[SOLVED = I can't add to it, it's based on the active ROM]
Sorry for the vague questioning, I wasn't sure quite how to create it.
I'm wanting to add toggle buttons, or at least other elements into this part of android;
I can't find any documents on how to add to this element of Android, and I'm wondering if we actually can? Does anyone know what this element is even called and can link me to the appropriate android doc?
Thanks!
This is an application that ships with Android, hence you cannot change its behavior. It has a predefined set of elements that can be present on it. If you want to create a custom version of it, you will need to create a custom ROM.
This looks similar to the quick settings screen on my Samsung and it created by the phone manufacturer. You could create a custom ROM, but I don't think this is what you really want.
The closest I think you can get is the notification bar, which can use a custom layout:
Change Notification Layout
Also Take a look at the WatchOn app, which has a relatively complex control embedded into the notification screen:
I am relatively new to android and want to create an application that permanently overrides androids basic softkey behaviour and view (for devices with soft keys).
Some functionalities I want to implement are changing the size of the softkeys window at the bottom, change its images, and possibly change its functionality.
For example, the user can set the size to of the softkey to be "large", "medium" or "small". And I can change the functionality of the back button to open say a particular application instead of going "back".
I'm basically looking for a high level answer as to how to do this, a basic direction of what I should read/study in order to be able to accomplish this. I realise this may require root access.
Please note that I want this behaviour to change not only in my application but I want the effect to exist on all applications. If this requires the application to be running atleast at the backend, that is fine.
After doing some decent amount of search, it seems I will have to make changes in the systemUI.apk, or possibly get its source code and modify it. Is this correct?
Thanks in advance.
I don't think even root is going to be enough for the type of changes you are describing. You're going to need to edit the Android source code and build your own system image.
Well you can't override system resources because they are part of the system image.
What you are looking for is called Home Application which can be developed like any other android app no need for root , you can find an example for it in your sdk samples.
Home Sample Application.
your app would be responsible to have UI components to send the user to all of the phone functionalities which includes:
Place for wegits
Place for apps listing (menue)
Access telephony functionality (call, phone history ...)
Access settings.
So, I noticed that I can organize apps into folders (HTC Incredible). However these folders are fairly limited in their capabilities. I want to implement an activity that extends the "base" folder activity (at the very least I want to add the ability to rearrange items in folders), but I can't figure out the class name... So, what's the name of the class that is used when adding a "New Folder" to the Home screen?
PS
I did take a look at the Android developer website. But the discussion there revolves mostly around content providers. I assume that's not quite what I need since I'd have to create a separate content provider for each new folder, or am I misunderstanding something?
So, what's the name of the class that
is used when adding a "New Folder" to
the Home screen?
For the HTC Incredible, it impossible to say what the class name is, since the Incredible is an HTC Sense device, so it's home screen implementation is proprietary.
For the Nexus One, it's the Folder class as implemented in either the Launcher or Launcher2 application built into the Android firmware. It's a bit unclear which of those versions of the launcher is used by the Nexus One.
In other words, this is a feature of the home screen application, not a "live folder" per the documentation you cited.
You are certainly welcome to try your hand at writing your own home screen replacement that offers greater capability in this area.
I'm not sure this is something you can do. From what I know, the folder feature is built in the Home application and the only way to integrate with it is through LiveFolders which can't really be used for what you intend, because:
As you said, each LiveFolder defined is tied to a ContentProvider
There is no LiveFolder API for handling the user "dropping" things (such as apps) on your folder.
The way I see it, your only hope is to write your own Home app that supports the features you want :)