[Q] Modify stock mail app? - Android Software Development

First off, I'm brand new to Android development so please bear with me.
My only goal at this point is to add the ability to choose the notification LED color to the Android 2.2 stock mail app (on the Droid). I've searched all over the place and haven't found an existing solution for this yet.
It seems to me like it should be super easy to add this functionality to the stock mail app. I can already choose my sound and vibrate settings, why not the LED color? Toss in some notification.ledARGB = something (plus the few other lines of code to make it work), a list to choose the color and we're good to go.
My problem, though, is I have no idea where to begin to have access to the code of the stock mail app. I would guess it goes something like:
1. Download the apk
2. Somehow open the source
3. Make the changes I need
4. Turn it back into a useable apk
5. Swap out the existing apk with my new modified one on the phone
I really only care about making this work on my own phone, so I'm not worried about signing the apk with a public cert or anything. I'm rooted as well, so no worries there.
Anyone have any insight? If I basically have the right plan of attack, and advice on the specifics? If I'm totally wrong in my approach, any advice on what I should be doing would be greatly appreciated.
Thanks in advance for any help!

I think this app is a part of AOSP, so you don't have to decompile an apk - grab sources and build them.

Well, that certainly makes sense. Just did some digging, and I found a pile of info about getting the source, git, repo, etc.
Naturally I'm a windows user, so it looks like I'll need to get some linux up and running to actually do anything with the source code. Ubuntu is installing as we speak....
Any tips on what to do next for a newbie like me?
Should I follow all the directions to get Eclipse ready to develop on the linux box?
Do I just need to download the Email.git to do what I want?
What do I do with the Email.git once I've gotten it?

Just gonna give this a little bump. I've got my linux box all set up and i've got the entire android source downloaded. I'm not really sure where to go from here, though.
How do I just modify and compile the email app into an apk? Thanks for any forthcoming handholding, guys.

Related

ROM for juniors?

Hi,
I got a few spare androids' and i'm considering giving them to my kids (11 and 12) to play around with it and enjoy the android experience. however I don't want them being able to put 3rd party applications. how do i go about removing the option of "unknown sources" and maybe wifi from the settings.apk.
I'm not new to java and xml but sort of new to android development, I've tried several ways to remove it from the apk only (ark, ddx, baksmali, apksign) I did it in so many ways that i can't remember them all. I've also tried to decode the apk with apktool, ddx, baksmali, and creating a new project from existing source in eclipse, and I couldn't figure out what parts I have to modify to get it working (i kept on getting errors in eclipse so i wasn't even able to compile and test it in DDMS-eclipse).
Also i would like to know if maybe it is necessary to port the whole kernel source into eclipse?
I've searched all over the internet for a information for this specific thing and I couldn't find anything.
Btw, I'm using nix lucid.
Thanks In advance.
any help would be appreciated!
how about flash the supere rom without the google apps? that way they wont be able to access the market..
lagu805 said:
how about flash the supere rom without the google apps? that way they wont be able to access the market..
Click to expand...
Click to collapse
I know, the problem is not the market, i can pull it out from the phone with adb in a second w/o superE, but they can still install stuff on it with a sd card, and I would hate to not put in a file browser on the phone.
I think it would be a good idea to make a rom that's made for kids, for playing games and stuff without me worrying about it.
I'm sure that they will try to figure out a way to get around the "no market on the phone" and I should not underestimate a kid (even a 12 year old). I've seen him getting around lots of technological obstacle's.
I think that the world could use a kid's version of android, you know, get them hooked when they're young. The last thing i would like to hear from my kids is talking about iPhone or Windows. We're all linux in our house
Interesting. I too gave Magics to my 11 & 12 yr olds, one without a data plan and the other without a SIM at all. I think the right way might be multiuser like we already do on the desktops. Sudo would be a nice touch but I'd be happy to login as admin to install or whatnot.
Multiuser is something I'd like to see anyway with most or some settings on a per user basis. Or at least just for security, normal login can't do critical tasks that might cause issues. I think we'll hear about this again once we hear about some seriously dangerous apps/scams/viri on the phones.
In the meantime your best bet is education and rules about what can and can't be done. Then once per week or so you take the phone and check things out, update as needed, etc. So far my kids have little interest in breaking the rules and are happy browsing the market for fun things.
I think the only way to achieve this is to download the AOSP, edit the sources to remove the options and then compile your own ROM.
3rdcoast said:
Interesting. I too gave Magics to my 11 & 12 yr olds, one without a data plan and the other without a SIM at all. I think the right way might be multiuser like we already do on the desktops. Sudo would be a nice touch but I'd be happy to login as admin to install or whatnot.
Multiuser is something I'd like to see anyway with most or some settings on a per user basis. Or at least just for security, normal login can't do critical tasks that might cause issues. I think we'll hear about this again once we hear about some seriously dangerous apps/scams/viri on the phones.
In the meantime your best bet is education and rules about what can and can't be done. Then once per week or so you take the phone and check things out, update as needed, etc. So far my kids have little interest in breaking the rules and are happy browsing the market for fun things.
Click to expand...
Click to collapse
well, it is just a nix and SUDO should be possible, but setting this up is a quite a project and I don't think this is a one day project.
As for educating, I think they know right from wrong and I don't think that they will willingly break the rules, the market however is full of apps that are not meant for young kids..... what do you think they're going to do when they bump in to one of those apps? .
Actually what i wanted to do is to give them a phone with a line and no data plan so they can play games or watch movies, If the kids want to use the internet, there are more than enough boxes at home they can use. This phone is strictly for voice text and games.
What I want to accomplish in general, is having a child safe phone, and have the other parents here who want their kids to have to have an android, enjoy it. My way of giving back to the community.
But to have a phone that will be suitable for the purpose (not just for my kids) the data has to be completely disabled, and wifi is going to be the issue. putting on an encryption on wifi is a joke, ever heard of aircrack? I'm sure there are lots of determined horny 15 year olds that will get around that. (am i paranoid?)
Case_ said:
I think the only way to achieve this is to download the AOSP, edit the sources to remove the options and then compile your own ROM.
Click to expand...
Click to collapse
That's exactly what i want to do. The question is how do I do it?
Again, I'm not a complete noob, I just never played around with android as an OS. so if I can have the first push here here what I'm supposed to do to start this I would really appreciate it.
As I've said in my first post, I tried a few things and i couldn't get it right. what part of this don't i get??
Thanks a lot.
well your not even going in the right direction..
do you have an IDE with compiler and the android SDK all set up? then you can check on dferrera post on how to compile android from source... its listed in this forum.. please search
if your not a programmer or have no idea what classes - functions etc are then this might now be an option for you that is something you can be instructed on
you are going to need to learn to compile android from source and modify it, this is a very big task mate - be prepared, and no one can answer all the questions for u
alan090 said:
well your not even going in the right direction..
do you have an IDE with compiler and the android SDK all set up? then you can check on dferrera post on how to compile android from source... its listed in this forum.. please search
if your not a programmer or have no idea what classes - functions etc are then this might now be an option for you that is something you can be instructed on
you are going to need to learn to compile android from source and modify it, this is a very big task mate - be prepared, and no one can answer all the questions for u
Click to expand...
Click to collapse
Thanks for the reply, but i can't seem to get java5 working on 10.04 (the 10.04 repos have only java6 but i did add the old repos and ran in to some issues), I had it working on 9.04 though. anyone made it run on 10.04? or should I downgrade (or run it in VB) to 9.04/.10?
k50aker said:
Thanks for the reply, but i can't seem to get java5 working on 10.04 (the 10.04 repos have only java6 but i did add the old repos and ran in to some issues), I had it working on 9.04 though. anyone made it run on 10.04? or should I downgrade (or run it in VB) to 9.04/.10?
Click to expand...
Click to collapse
Add these 2 lines to the end of /etc/apt/sources.list file
Code:
deb http://pl.archive.ubuntu.com/ubuntu/ jaunty multiverse
deb http://pl.archive.ubuntu.com/ubuntu/ jaunty universe
then do:
Code:
sudo apt-get update
sudo apt-get install sun-java5-jdk
@k50aker
Hiding Wifi and other things should be quite easy task, but... how do you want to protect against system reinstallation? They could download any ROM from internet and install it in just 10 minutes. Backuping is easy too, so they could have 2 systems installed and switch between them when their dad comes home.
Android phones aren't desktops. You can't have root and don't give it to other users of a device.
Mod. edit: not dev related, moved to general
I wouldn't want to hide WiFI, the device is useless without connectivity, much cheaper toys out there for that if I wanted stand alone.
My two children each have a Magic and this is my experience, none of the worries that many parents seem to fear. They are well behaved and so far no problems and they are ready for 2.1 since 1.5 is just too confining even for them. Education goes a long way.
The best choice I made was to not put a SIM in one of the phones. WiFI is ideal since she is nearly always in a zone. This has gotten her used to IM instead of texting. Same effect but costs nothing. A SIP app works almost as well as SIM voice. Someday I'll do a data only SIM so she has total coverage, she'll understand that heavy data is to be done over WiFI and cell data is for VoIP and for times when it is really needed and can't wait.
However it would be nice if there was a limited setting requiring admin password for certain functions. But really, there hasn't been any problems but my kids might be grateful enough to not abuse the rights I give them. Best advice besides education if they are very young is to not SIM until after they get into the alternatives and not be addicted to texting. The older one has learned to watch her usage patterns and has to pay if she goes over budget.
Switch33 said:
Add these 2 lines to the end of /etc/apt/sources.list file
Code:
deb http://pl.archive.ubuntu.com/ubuntu/ jaunty multiverse
deb http://pl.archive.ubuntu.com/ubuntu/ jaunty universe
then do:
Code:
sudo apt-get update
sudo apt-get install sun-java5-jdk
Click to expand...
Click to collapse
those ropes are for jaunty not for lucid, and I have tried that before anyway and this is what i get:
Code:
desktop:~$ sudo apt-get install sun-java5-jdk
Reading package lists... Done
Building dependency tree
Reading state information... Done
sun-java5-jdk is already the newest version.
The following packages were automatically installed and are no longer required:
libwv2-4
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 11 not upgraded.
1 not fully installed or removed.
After this operation, 0B of additional disk space will be used.
Setting up sun-java5-doc (1.5.0-19-0ubuntu0.9.04) ...
This package is an installer package, it does not actually contain the
J2SDK documentation. You will need to go download one of the
archives:
jdk-1_5_0-doc.zip jdk-1_5_0-doc-ja.zip
(choose the non-update version if this is the first installation).
Please visit
http://java.sun.com/j2se/1.5.0/download.html
now and download. The file should be owned by root.root and be copied
to /tmp.
[Press RETURN to try again, 'no' + RETURN to abort] no
Abort installation of J2SDK documentation
dpkg: error processing sun-java5-doc (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
sun-java5-doc
E: Sub-process /usr/bin/dpkg returned an error code (1)
Brut.all said:
@k50aker
Hiding Wifi and other things should be quite easy task, but... how do you want to protect against system reinstallation? They could download any ROM from internet and install it in just 10 minutes. Backuping is easy too, so they could have 2 systems installed and switch between them when their dad comes home.
Android phones aren't desktops. You can't have root and don't give it to other users of a device.
Click to expand...
Click to collapse
You are right, but one of the later steps I thought about would be a custom boot and custom or no recovery. But I will figure that out later in the project.
But i will probably change my direction on this (wifi etc.) based on what you guys say.

[Q] Debugging help needed

I have a user of my app who is having a problem running it. My code launches another activity in the same app, and he is saying it is stopping before it should & returning to the previous activity, and he doesn't see any Force Close warnings.
I have run my code in the emulator & on my phone, I can't reproduce the error. We both run Android 2.2 on our phones, his is an HTC EVO & mine is a HTC Wildfire, as far as I can tell his specs are better than mine so shouldn't cause an issue - I deliberately chose a low spec for for my dev work so the code ought to run on anything.
As a bit of an Andoid dev noob (but been coding for years), is there any easy way I can make a special build of the app to send to him that would log any errors that happen ? I'd like to get a stack dump as well if possible, as I'm not sure exactly what routine in the activity its crashing out in. The activity that crashes is Gallery with 9 images in it, he can't flick through them or select one. I'm stumped as to whats causing it, any assistance would be gratefully received.
Thanks.
Why not point to your app and let others here try it on their phones? It could simply be other apps installed on his phone interfering with your app.
Long time programmer here too and when I get to where you're at (and I"m sure you've put some hours into this LOL), I go back to STEP 1.
I comment-out any and all code but the bare minimum; break it down to the Intent, startActivity and maybe a Toast message in the second activity. Even parse down your XML files to bare minimum.
See if that works. Then, ADD BACK ONE LINE OF CODE AT A TIME Run program and make sure it works. Yeah, it's painful, but in my 20 years of coding, I've learned to put my pride aside and to not "pretend" all the code I've written is correct.
Sometimes on bigger projects, I"ll change or add a couple of lines of code, run a back up and test. Rinse and repeat LOL. That way, I know I"m only a couple of lines of code from what "used" to work.
Good Luck!
Thanks both of you.
old_dude - Its a paid app. Only £0.99 but I don't think people would pay to help me. There is a free version of the same app (with less functionality) that this guy can get to work. If your really interested the 2 versions are -
Plink Log - Free Version
Plink Log Pro - Paid version
Rootstonian - agreed thats the approach I'd normally take if I was having problems on my dev phone or the emulator. The problem is that its OK on my HTC Wildfire/Android2.2 but on this guys HTC EVO/Android2.2 its having problems. I dont really want to keep sending him .apks with 1 or 2 lines extra enabled just to see if that fixes his specific issue. I was hoping there was something I could code to catch whatever crashes the activity & log it somewhere for me to analyse. When I do PC dev work, I have a global exception handler that catches anything I dont explicitly handle, and dumps the full call stack into a Log File I can read later.
I think I'll just have to take the existing app & put loads of debug code into it to save messages into a log file & see what bits of code are being called & what isn't & then get him to email me the results.
Thanks for the ideas guys, its always useful to get input from another perspective.
Dave
Hmmmm, just discovered setDefaultUncaughtExceptionHandler - might be able to use that with printStackTrace. Sounds interesting.

[Q] Stock Graphics and how to implement them

I'm building a few apps but wanted to see if there might be a way to grab existing graphics already in the OS. Like the plus sign in the Calendar or the microphone... I'd rather not have to include the same image in the system if it's already there, and the fact that a simple theme change would make the apps I'm working on change dynamically with the new look.
Thoughts?
if the files you want to use are defined in the resource directory and can be accessed via R.java from both xml and java then there is no way to get to the files.
if the files are defined as Assets then there is a possibility for you to access them.
you will need to know the exact file path to the file you want to access.
see
http://developer.android.com/reference/android/content/res/AssetManager.html
and
http://stackoverflow.com/questions/5493396/how-to-reference-android-assets-across-packages
Exactly what I was looking for, but not what I was wanting to hear. Know of any stock graphics I can use for my res/drawables? I'm not exactly the best artist in the world and would like my apps to look somewhat like they belong.
removed
android.R.drawable is helpful but if you can't get it, just download the source. are you guys forgetting the android is completely open source? it might take you a while to find them, but they're all there.
I was sure there were some stock graphics available somewhere. Thanks SimonVT. Helped quite a bit with the ugly crayon jobs I created.
removed
SimonVT said:
That is also an option, but using native resources will ensure that it fits in with the overall OS theme.
Click to expand...
Click to collapse
oh yeah, I guess you've got a point there. I wasn't thinking about people with sense, motoblur, etc. I've only ever had stock android phones. Well, I did have a nook color for a month or two, but I installed cyanogenmod the day I got it.
this might interest you aswell. its the android icon template pack.
http://developer.android.com/shareables/icon_templates-v2.3.zip
you can read more about icon and user interface guidlines here
http://developer.android.com/guide/practices/ui_guidelines/index.html
Yeah, that's some good information as well. Following the OS standard is what I would prefer over trying to make my own or grabbing from other installed apps. It makes for the apps/widgets to flow much better in overall design theory.

[Q] Cross-tablet apks

Hi all...
I was wondering if and how could be possible to port apks built for one tablet to another of different brand, i.e. I liked a lot the email client of the Samsung Galaxy 10.1 (with multiple email selector and recycle bin emptying feature), but many others are worth a try...
When I try simply to push the email.apk to my Iconia, it won't work (the icon diasppears from apps), if I try to install it I obtain an error (app not installed) probably due to a signing mismatch... I'd like really to learn how to do this, if possible. This knowledge will complete and accomplish any further request about personalization of our tablets, could be a great improvement being capable to get out the "system" you really want...
I tried to figure out how to use apk manager, but it's quite really difficult without some good suggestion, the thread is more than 200 pages long, and I got stoned before simply find out any usefull info about "system apks"...
TIA
I would like to know also. I want the Facebook account integration from the Galaxy.
Some apps are license by that manufacurer and would be considered wares.its a gray area please be careful. And make sure the Dec of all apps you use get paid
simple answer
couple of APK for galaxy are using CORE framework of the galaxy tabs firmware itself
that will not be possible to just install those apk.
such as
touchwizUI
status bar overlay (I mean the minimode menu with quick access), the quick access settings...
Email and Social things
It's their "Marketing Strenght" so they didn't make it easy to be "stolen" by other brands
I run just the dual clock, the memo, and eReader from samsung but I am running a custom firmware so that change many things
At this moment only 1 custom firmware does use Samsung as base, Virtuous Galaxy... but I have to warn that using custom firmware without following backup steps strictly or knowing the consequence is to AVOID.
sanaell said:
...
At this moment only 1 custom firmware does use Samsung as base, Virtuous Galaxy... but I have to warn that using custom firmware without following backup steps strictly or knowing the consequence is to AVOID.
Click to expand...
Click to collapse
first of all, thanks for your answer, and your warn...
I'd like to go deep in the question, as you correctly affirmed, virtuous galaxy's based upon Unity v5 kernel, but virtuous picasso also lays on the same structure, doesn't it?
right now I'm running m-dj's picasso 1.1.0 rom, wouldn't be possible, with any required modification, to run elsewhere coming apks?
I mean, think about having two different pcs, both with the same hardware and the same linux distro and kernel, wouldn't seem wierd that on one pc you could run an application that won't run on the other?
I'm thinking, if they wanted to protect their components why they didn't simply wrote hardware oriented kernels? Therefore, its a fact that on my iconia I can run either a Samsung or an Asus based rom, according to this, where is the cross-platform limit? I mean, is there some sort of documentation defining which part of these Android system is "really" open, under GPL, GNU or whatever structured property info list? I can't find any browsing the net... or maybe I've found too much, its almost impossible to understand what you can and what you can't...
I do not know the whole answer to this question.but I do know this much.if you have any.apk application that is for sale on the market or was installed for free on any device that it was not pre installed on. I would thing it would be considered pirated. As you did not buy it.nor did the developer give permission to run the API on your device.thou some apostle you buy can be installed across the devices you have registered with Googler
if im wrong people please correct me.I just think that developers that fallow rules and write great software MUST BE PAID.
erica_renee said:
I do not know the whole answer to this question.but I do know this much.if you have any.apk application that is for sale on the market or was installed for free on any device that it was not pre installed on. I would thing it would be considered pirated. As you did not buy it.nor did the developer give permission to run the API on your device.thou some apostle you buy can be installed across the devices you have registered with Googler
if im wrong people please correct me.I just think that developers that fallow rules and write great software MUST BE PAID.
Click to expand...
Click to collapse
Right and Wrong
if the application is a paid application and wasn't preinstalled on your tablet it is not really legal
if the application is free but cannot be installed from the market and you install it from other sources it's ok
if the application is from another tablet, and exclusively on this tablet do not expect run it on the stock firmware of your tablet, you have great chance to cannot run it simply, or get some random FC (such as from GALAXY because they use another structure on the file directory... so some application try to get the path and it's return an error, Or they are implemented and integrated with the kernel and that... you can't pass throught)
On my tablet I do run
ASUS widget
Galaxy widget (dual clock)
and some other application not from ACER.
now to get back to the OP
. you are on a virtuous... why not go on the virtuous Galaxy !!! if you want galaxy application... I don't get it...
sanaell said:
now to get back to the OP
. you are on a virtuous... why not go on the virtuous Galaxy !!! if you want galaxy application... I don't get it...
Click to expand...
Click to collapse
I agree to this explanation of yours, when I flash a rom different from the original, aware that's coming from a different brand, I'm more or less conscious that I'm doing something wrong. mmmf... that's philosophy... won't lose your time
The point is, I've tried the Galaxy rom, I don't like the interface, I don't like the extra bar functionalities, in short I mostly appreciated the Email.apk, most of all because it has a convenient "select all" function, even in the recycler bin (I can't stand with an email client stupid like the one embedded in the Acer version). In any case, given the impossibility to get the Galaxy Email, I'll buy a new one on the market...

Help with finishing my App (ROM Control)

Hey, so I have made an app for customizing some stuff on my Droid 3, but it works on my nexus 7, and cannot get it to load right on my D3 at the momment but that's not the issue. So what it does right now is I have a settings pannel and the only one I have actually coded is Notification background color. It sends the RGB to AccellerometerRotation in Settings.System. I will make it send to custom places once it is done. But I can then retrieve that in app, and use it to set color filter on a preview I have in my app, so bottom line, my code works.
Now, I need to add this code into the SystemUI.apk so that it will automatically run at some point (any point really) like a change in wallpaper or a reboot. I cannot figure out how to acomplish this. I have tried copypasting from JD GUI, adding my code, building apk for smali, and replacing the smali, but it doesn't work, either force crash or no systembar. I have tried to do this method on both ImageWallpaper class and the SystemUIService class, neither worked. At this point I'm totally stumped as to what to do. I assume adding my own class that would run but TBH, I am totally beat with trying anymore alone. Sometimes, its best to just let someone else take the wheel for a bit haha.
If anyone can help me finish my app, I am rewarding $40 Via PayPal for completion, which Is hopefully insentive enough for all you greedy people to assist haha.
So if any of you know how to do this, i can post the code (will be annoying till I get internet back) if needed, but ide prefer not until I get power and internet. Thanks in advance for all the responses!
I see you all viewing lol, can I get some responses <3 still stuck. I might try to just convert my java to smali and insert it into the existing smali but idk

Categories

Resources