Radio FM bug on dexter's rom - Milestone XT720 General

Does someone found anything new about radio FM bug ?
Is there a way to desactivate volume buttoms in radio or to do that they change ringtone volume and to add a + and - buttom in radio apk so, we will be abble to change volume by screen.
Thank you

Zachary57 said:
Does someone found anything new about radio FM bug ?
Is there a way to desactivate volume buttoms in radio or to do that they change ringtone volume and to add a + and - buttom in radio apk so, we will be abble to change volume by screen.
Thank you
Click to expand...
Click to collapse
I think I've figured out what's going on. To raise or lower volume you need to send the "com.motorola.fmradio.volume.change" intent. I've tested this using Tasker to lower the FM Radio volume (I haven't figured out how to use Tasker to raise volume yet--but I assume that if volume down works, then volume up should also be supported--also Tasker can't intercept the volume keys because they're deeply ingrained in the framework so we will have to actually fix the framework as far as I can tell).
The good news is that all the code needed for changing volume seems to be already there, we just need to connect the volume button code in the framework with the correct intents. At this point, I think I've isolated the relevant code in the Korean Motoroi 2.2 framework, so I'm working on porting and integrating the relevant code into the Milestone 2.2.1 framework that we're using. It's very slow and tedious work, though so I don't really have an estimate for how long it may take.

Are you study smali-code from framework-res or looking in source code?
Cause i think we have one more bug, that even don't was declared.
I'am speaking about magnification on text when selecting it.

I'm mostly looking at the smali for framework/*.jar (as far as I can tell there are only small FM radio changes in framework-res). Porting smali for magnification from 2.1 is probably even more of a pain than porting 2.2 code to 2.2.1. Working from Java source would probably be a lot easier. So, maybe it's time to move to a source-based release instead.

But we don't have source based... only CM i can get on mind.
BTW, in witch class you found fm radio ?
Some logs after greping:
grep on search "fm" on korean framework.jar
http://xt720.fjfalcon.ru/other/log.txt
grep on search "volume" on korean framework.jar
http://xt720.fjfalcon.ru/other/log2.txt
Now will try to copy audio manager's classes from korean in framework-apk, framework.jar...
Maybe it will work..
BTW, maybe we should create site/topic about what studyes was already done for phone, cause we may do one work many times...

fjfalcon said:
But we don't have source based... only CM i can get on mind.
BTW, in witch class you found fm radio ?
Some logs after greping:
grep on search "fm" on korean framework.jar
http://xt720.fjfalcon.ru/other/log.txt
grep on search "volume" on korean framework.jar
http://xt720.fjfalcon.ru/other/log2.txt
Now will try to copy audio manager's classes from korean in framework-apk, framework.jar...
Maybe it will work..
BTW, maybe we should create site/topic about what studyes was already done for phone, cause we may do one work many times...
Click to expand...
Click to collapse
The ones I know about (Korean Motoroi) are:
android.policy.jar :
com/android/internal/policy/impl/PhoneWindowManager$7.smali
com/android/internal/policy/impl/PhoneWindowManager.smali
mot-framework-res :
AndroidManifest.xml
res/values-ko/strings.xml
res/values/public.xml
res/values/strings.xml
services.jar :
com/android/server/am/ActivityManagerService.smali
One challenge is that the Milestone 2.2.1 seems to have been more effectively optimized than the Motoroi 2.2, so separating differences that matter from "noise" can be tedious. For example the Motoroi smali copies values back and fourth between variables and parameters for seemingly no reason whereas the Milestone smali just uses the parameters directly. Also Motoroi has a lot of code for managing the digital TV tuning (DVB) mixed in to the same regions of code. I've read about something called dex2jar that can be used to decompile dex to java, but I don't know whether it's feasible/possible to go back to dex from the decompiled java. But it may make understanding the code a little easier.
From what I understand PhoneWindowManager is the superclass for all windows in Android. This class handles the volume buttons (and the gallery button too I think).

com/android/internal/policy/impl/PhoneWindowManager$7.smali
com/android/internal/policy/impl/PhoneWindowManager.smali
mot-framework-res :
AndroidManifest.xml
res/values-ko/strings.xml
res/values/public.xml
res/values/strings.xml
services.jar :
com/android/server/am/ActivityManagerService.smali
Click to expand...
Click to collapse
Will try just to replace this files from korean, to our mod...
Maybe it will help...
Damn, after copy
com/android/internal/policy/impl/PhoneWindowManager$7.smali
com/android/internal/policy/impl/PhoneWindowManager.smali
to our mod - get boot loop.
Will restore from original mod.

fjfalcon said:
Will try just to replace this files from korean, to our mod...
Maybe it will help...
Damn, after copy
com/android/internal/policy/impl/PhoneWindowManager$7.smali
com/android/internal/policy/impl/PhoneWindowManager.smali
to our mod - get boot loop.
Will restore from original mod.
Click to expand...
Click to collapse
PhoneWindowManager$7 does something else on Milestone. I think the class$N represent instances and the numbers are generated by compile (but I'm not sure about that). I'm pretty sure we have to at least remove all the digital TV stuff or find and add the missing digital TV tuner framework parts. Also, don't forget that Korean is 2.2 but Milestone is 2.2.1 so there is the chance that internal APIs are slightly different. The best approach IMHO is to find only code that must be changed and integrate it manually. It's slow but safest since we don't have source.

Mioze7Ae said:
PhoneWindowManager$7 does something else on Milestone. I think the class$N represent instances and the numbers are generated by compile (but I'm not sure about that). I'm pretty sure we have to at least remove all the digital TV stuff or find and add the missing digital TV tuner framework parts. Also, don't forget that Korean is 2.2 but Milestone is 2.2.1 so there is the chance that internal APIs are slightly different. The best approach IMHO is to find only code that must be changed and integrate it manually. It's slow but safest since we don't have source.
Click to expand...
Click to collapse
I've figured out how to decompile the framework into java using dex2jar and jd-gui. This makes it much easier read and understand what the smali is doing without tracing variables. For example, this is what's going on inside PhoneWindowManager$7 on Motoroi in smali:
Code:
.class Lcom/android/internal/policy/impl/PhoneWindowManager$7;
.super Landroid/content/BroadcastReceiver;
.source "PhoneWindowManager.java"
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/android/internal/policy/impl/PhoneWindowManager;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x0
name = null
.end annotation
# instance fields
.field final synthetic this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;
# direct methods
.method constructor <init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
.registers 2
.parameter
.prologue
.line 2189
iput-object p1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$7;->this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;
invoke-direct {p0}, Landroid/content/BroadcastReceiver;-><init>()V
return-void
.end method
# virtual methods
.method public onReceive(Landroid/content/Context;Landroid/content/Intent;)V
.registers 5
.parameter "context"
.parameter "intent"
.prologue
.line 2190
invoke-virtual {p2}, Landroid/content/Intent;->getAction()Ljava/lang/String;
move-result-object v0
const-string v1, "com.motorola.fmradio.start.running"
invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_13
.line 2191
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$7;->this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;
const/4 v1, 0x1
invoke-static {v0, v1}, Lcom/android/internal/policy/impl/PhoneWindowManager;->access$102(Lcom/android/internal/policy/impl/PhoneWindowManager;Z)Z
.line 2195
:cond_12
:goto_12
return-void
.line 2192
:cond_13
invoke-virtual {p2}, Landroid/content/Intent;->getAction()Ljava/lang/String;
move-result-object v0
const-string v1, "com.motorola.fmradio.end.running"
invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_12
.line 2193
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$7;->this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;
const/4 v1, 0x0
invoke-static {v0, v1}, Lcom/android/internal/policy/impl/PhoneWindowManager;->access$102(Lcom/android/internal/policy/impl/PhoneWindowManager;Z)Z
goto :goto_12
.end method
and decompiled:
Code:
package com.android.internal.policy.impl;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
class PhoneWindowManager$7 extends BroadcastReceiver
{
public void onReceive(Context paramContext, Intent paramIntent)
{
if (paramIntent.getAction().equals("com.motorola.fmradio.start.running"))
boolean bool1 = PhoneWindowManager.access$102(this.this$0, 1);
while (true)
{
return;
if (paramIntent.getAction().equals("com.motorola.fmradio.end.running"))
{
boolean bool2 = PhoneWindowManager.access$102(this.this$0, 0);
continue;
}
}
}
}
It's a matter of a few seconds to grok what's going on in the decompiled version compared to a few minutes in the smali. Diffing sources should also be much easier with the decompiled forms. I'll get Dexter's and Motoroi's frameworks decompiled and upload them somewhere.
I don't know enough about java/android to know whether recompiling the decompiled sources is possible/easy. But as a tool for improving code comprehension it will be well worth it I think.

wow, that very good.
Now we can edit from source, good job. I have a bit info about java. Better that junior, but less than prof dev, but I think there will be no problem to understand it.
To compile it back to jar we should decompile whole framework. At least all dependices.
So today we have 3 problems.
text magnification,
fm radio,
keycode 112(gallery key).
Sent from my XT720 using XDA App

Mioze7Ae said:
Code:
package com.android.internal.policy.impl;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
class PhoneWindowManager$7 extends BroadcastReceiver
{
public void onReceive(Context paramContext, Intent paramIntent)
{
if (paramIntent.getAction().equals("com.motorola.fmradio.start.running"))
boolean bool1 = PhoneWindowManager.access$102(this.this$0, 1);
while (true)
{
return;
if (paramIntent.getAction().equals("com.motorola.fmradio.end.running"))
{
boolean bool2 = PhoneWindowManager.access$102(this.this$0, 0);
continue;
}
}
}
}
Click to expand...
Click to collapse
It seems somewhat garbled. I think it should be:
Code:
class PhoneWindowManager$7 extends BroadcastReceiver
{
public void onReceive(Context paramContext, Intent paramIntent)
{
if (paramIntent.getAction().equals("com.motorola.fmradio.start.running"))
{
boolean bool1 = PhoneWindowManager.access$102(this.this$0, 1);
return;
}
if (paramIntent.getAction().equals("com.motorola.fmradio.end.running"))
{
boolean bool2 = PhoneWindowManager.access$102(this.this$0, 0);
return;
}
}
}
So this definitely isn't worth recompiling... but it's better than nothing.

khalpowers said:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
grab here fmradio volume fix ( thanks to fwals )
http://www.multiupload.com/1CZ6BX1VFI
apply with update open recovery..clear dalvik cache..reboot
after login go to setting>applications>manage application>all
looking for fmradio..open and clear data..done.
If you download this ROM, and you like it, please press the "Thanks Button" below the post ..
Click to expand...
Click to collapse
Radio Volume seens to be fixed.

Zachary57 said:
Radio Volume seens to be fixed.
Click to expand...
Click to collapse
It's a partial fix (but it's better than nothing!). You can't change the radio volume when the screen is off/locked or if you're using a different app with the radio in the background--that requires editing the framework.

Related

[Contacts.apk] [DONE] Contacts List with Photo in Donut

Updated:
Credits must go to Geesun for his patch to show Contacts Photo.
backup first...
the files in attachments are to be used in UPDATE on RECOVERY MODE.
cyanogen_update.zip -> Contacts.apk with 2.0 icons + Photo on Contact list
geesun_update.zip -> Contacts.apk with Photo on Contact list and much more (warning this is for chinese mod and there is some chinese text)
IF YOU WANT ONLY THE Contacts.apk just unzip the file and check inside App
Feature only in the Geesun Mod
from the Chinese site (translated):
Contacts to strengthen amended as follows
1. Intelligent IP dial-up, according to city contacts dial 17951 (can be set)
2. Display to / go to Electric City
3. According to contact numbers, display contact city,
4. Show a missed call city.
5. For international calls, you can display the name of the country
6. For fixed-line telephone, +86 and so on, can handle
7. For used phones, you can also display, such as 138001380000,10086,95528, etc.
8. The first time required to set up your own IP dial-up number and their phone numbers, default is 17951 / Shanghai
9. Database is small, query speed.
10. The database updated to 2009.5, all data come from the Internet, without encryption, you can free to use.
11. To contact data will not be damaged.
12. Have joined the contact picture.
Thanks
Xenio
SCREENSHOT FROM GEESUN MOD (Cyanogen mod have only Photos in Contacts)
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
direct link to Contacts.apk from Cyanogen
http://n0rp.chemlab.org/android/apps/Contacts.apk
Geesun Patch.
Code:
diff --git a/src/com/android/contacts/ContactsListActivity.java b/src/com/android/contacts/ContactsListActivity.java
index 2b74410..d0b6b94 100755
--- a/src/com/android/contacts/ContactsListActivity.java
+++ b/src/com/android/contacts/ContactsListActivity.java
@@ -178,8 +178,8 @@ public final class ContactsListActivity extends ListActivity
static final int MODE_QUERY = 60 | MODE_MASK_NO_FILTER;
/** Run a search query in PICK mode, but that still launches to VIEW */
static final int MODE_QUERY_PICK_TO_VIEW = 65 | MODE_MASK_NO_FILTER | MODE_MASK_PICKER;
-
- static final int DEFAULT_MODE = MODE_ALL_CONTACTS;
+ //Geesun
+ static final int DEFAULT_MODE = MODE_ALL_CONTACTS|MODE_MASK_SHOW_PHOTOS;
/**
* The type of data to display in the main contacts list.
@@ -1973,6 +1973,13 @@ public final class ContactsListActivity extends ListActivity
photo = BitmapFactory.decodeByteArray(photoData, 0,
photoData.length);
mBitmapCache.put(pos, new SoftReference<Bitmap>(photo));
+ //Geesun
+ if(photo == null){
+ int id = cursor.getInt(ID_COLUMN_INDEX);
+ Uri uri = ContentUris.withAppendedId(People.CONTENT_URI, id);
+ photo = People.loadContactPhoto(context, uri, R.drawable.ic_contact_list_picture, null);
+
+ }
} catch (OutOfMemoryError e) {
// Not enough memory for the photo, use the default one instead
photo = null;
--------------------------------------------------------------------
OLD OP.
I am trying to modify the Contacts.apk source to get the Photo's
contact in the Contacts tab, (In Eclair this is already implemented, I
would like to have it in Donuts too).
In the Favorites tab the photos are already there, so tweak it must be simple.
This is what I get until now:
Contacts.apk source file ContactsListActivity.java
ORIGINAL
1653 private boolean mDisplayPhotos = false;
1654 private SparseArray<SoftReference<Bitmap>> mBitmapCache = null;
...
1658 super(context, R.layout.contacts_list_item, null, false);
CHANGED BY ME
1653 private boolean mDisplayPhotos = true;
1654 private SparseArray<SoftReference<Bitmap>> mBitmapCache = new SparseArray<SoftReference<Bitmap>>();
...
1658 super(context, R.layout.contacts_list_item_photo, null, false);
After this I get a GENERIC ICON with the droid on the left of the
contacts name.
That is all I get, I am not good in Java Programming...
If you want to get involved this is the code...
http://android.git.kernel.org/?p=pl...70d24e7686305a7570d1300e738744e980384;hb=HEAD
Any help?
Xenio
Hi,
I've tried to set this another way using:
132 static final int MODE_ALL_CONTACTS = 10 | MODE_MASK_SHOW_PHOTOS;
133 /** Show all contacts with phone numbers, sorted alphabetically */
Same effect. I'll take a look on that Interesting subject
logcat shows:
D/skia ( 669): --- SkImageDecoder::Factory returned null
xenio2000 said:
CHANGED BY ME
1653 private boolean mDisplayPhotos = true;
1654 private SparseArray<SoftReference<Bitmap>> mBitmapCache = new SparseArray<SoftReference<Bitmap>>();
...
1658 super(context, R.layout.contacts_list_item_photo, null, false);
Click to expand...
Click to collapse
So, at line 1654 you created an new instance so that it's not null...
But I'm not sure what 1658 does?
Since it already shows the pics in the Favorites tab, there should be a line that pulls the pic correctly...maybe you can look there for inspiration? I don't have a build environment or I'd probably look at helping with this.
**EDIT**
I misunderstood the orignal post
1Way
1wayjonny said:
**EDIT**
I misunderstood the orignal post
1Way
Click to expand...
Click to collapse
They are talking about the main contacts tab in the donut builds. there is no picture displayed, until you select the contact.
TemporalShadows said:
So, at line 1654 you created an new instance so that it's not null...
But I'm not sure what 1658 does?
Since it already shows the pics in the Favorites tab, there should be a line that pulls the pic correctly...maybe you can look there for inspiration? I don't have a build environment or I'd probably look at helping with this.
Click to expand...
Click to collapse
I'm pretty sure that problem is with database query.
For those that haven't a build enviroment... you can take a look at the java source here:
http://android.git.kernel.org/?p=pl...70d24e7686305a7570d1300e738744e980384;hb=HEAD
I hope you can help us.
Thanks,
Xenio
@Akirah
I think you are right check from lines 187 to 217
Code:
187 static final String[] CONTACTS_PROJECTION = new String[] {
188 People._ID, // 0
189 NAME_COLUMN, // 1
190 People.NUMBER, // 2
191 People.TYPE, // 3
192 People.LABEL, // 4
193 People.STARRED, // 5
194 People.PRIMARY_PHONE_ID, // 6
195 People.PRIMARY_EMAIL_ID, // 7
196 People.PRESENCE_STATUS, // 8
197 SORT_STRING, // 9
198 };
199
200 static final String[] SIMPLE_CONTACTS_PROJECTION = new String[] {
201 People._ID, // 0
202 NAME_COLUMN, // 1
203 };
204
205 static final String[] STREQUENT_PROJECTION = new String[] {
206 People._ID, // 0
207 NAME_COLUMN, // 1
208 People.NUMBER, // 2
209 People.TYPE, // 3
210 People.LABEL, // 4
211 People.STARRED, // 5
212 People.PRIMARY_PHONE_ID, // 6
213 People.PRIMARY_EMAIL_ID, // 7
214 People.PRESENCE_STATUS, // 8
[B] 215 "photo_data", // 9[/B]
216 People.TIMES_CONTACTED, // 10 (not displayed, but required for the order by to work)
217 };
Yeah,
I've seen it and tried to modify columns columns order to add photo to it, but not luck.
It compiles, but photo is not retrieved.
Looks like someone did it before it is included in some modded rom.
I am looking for it now, we have to find it.
Xenio
try this one. has photos. base of cm's source.
http://kugou.me/Contacts.apk
Yes it works... now we have to found how it was done and close the thread.
I'll check the cyanogen github.
xenio2000 said:
Yes it works... now we have to found how it was done and close the thread.
I'll check the cyanogen github.
Click to expand...
Click to collapse
I have just take a look at the ContactsListActivity.java source:
You should pay attention here:
Code:
static final String[] CONTACTS_PROJECTION = new String[] {
People._ID, // 0
NAME_COLUMN, // 1
People.NUMBER, // 2
People.TYPE, // 3
People.LABEL, // 4
People.STARRED, // 5
People.PRIMARY_PHONE_ID, // 6
People.PRIMARY_EMAIL_ID, // 7
People.PRESENCE_STATUS, // 8
SORT_STRING, // 9
};
and
Code:
static final String[] STREQUENT_PROJECTION = new String[] {
People._ID, // 0
NAME_COLUMN, // 1
People.NUMBER, // 2
People.TYPE, // 3
People.LABEL, // 4
People.STARRED, // 5
People.PRIMARY_PHONE_ID, // 6
People.PRIMARY_EMAIL_ID, // 7
People.PRESENCE_STATUS, // 8
"photo_data", // 9
People.TIMES_CONTACTED, // 10 (not displayed, but required for the order by to work)
};
The second one has the "photo_data" column . Please try yourself because I cannot build the Contacts app now.
bpmtri said:
The second one has the "photo_data" column . Please try yourself because I cannot build the Contacts app now.
Click to expand...
Click to collapse
I've tried to add new column, and to move columns. Doesn't work.
Standard cyanogen one doesn't seem to have photos at least from what I see in sourcecode, changes are done to BT contact send.
akirah said:
I've tried to add new column, and to move columns. Doesn't work.
Standard cyanogen one doesn't seem to have photos at least from what I see in sourcecode, changes are done to BT contact send.
Click to expand...
Click to collapse
Hi akirah,
Please make sure you have:
Code:
static final int MODE_ALL_CONTACTS = 10 | MODE_MASK_SHOW_PHOTOS;
to show the default picture, and
Code:
static final String[] CONTACTS_PROJECTION = new String[] {
People._ID, // 0
NAME_COLUMN, // 1
People.NUMBER, // 2
People.TYPE, // 3
People.LABEL, // 4
People.STARRED, // 5
People.PRIMARY_PHONE_ID, // 6
People.PRIMARY_EMAIL_ID, // 7
People.PRESENCE_STATUS, // 8
"photo_data", // 9
SORT_STRING, // 10
};
to have "Photo data". "photo_data" column must have index = 9.
I just try to read the source code and suggest you. Hope this help you to make it work.
Yep last Cyanogen Mod from github does not have Photos I misunderstood the x140d4n post
Ok the Contacts.apk posted from x140d4n works and it came from here a Chinese site...thanks for it.
http://www.kugou.me/
You can translate with google...
Looks like the mod with the picture is added by geesun (I think) to the Cyanogen Mod and this is the mod cm 4.2.3.1-geesunmod, if you download it and extract the Contacts.apk it works very well a little slow the first time but it is nice.
I did'n found this tweak here in XDA, another site that x140d4n give to me is http://www.androidin.net
I did't found any source... just the zip with the apk...
Xenio
REMOVE THE .ZIP EXTENSION
bpmtri said:
to have "Photo data". "photo_data" column must have index = 9.
I just try to read the source code and suggest you. Hope this help you to make it work.
Click to expand...
Click to collapse
This is exactly what I've tried. But still photo is not retrieved from database.
xenio2000 said:
Yep last Cyanogen Mod from github does not have Photos I misunderstood the x140d4n post
Ok the Contacts.apk posted from x140d4n works and it came from here a Chinese site...thanks for it.
http://www.kugou.me/
You can translate with google...
Looks like the mod with the picture is added by geesun (I think) to the Cyanogen Mod and this is the mod cm 4.2.3.1-geesunmod, if you download it and extract the Contacts.apk it works very well a little slow the first time but it is nice.
I did'n found this tweak here in XDA, another site that x140d4n give to me is http://www.androidin.net
I did't found any source... just the zip with the apk...
Xenio
REMOVE THE .ZIP EXTENSION
Click to expand...
Click to collapse
i installed it but it didnt work force close on contacts i delete original Contacts.apk and dalvik-cache and rebooted
any ideas? im tryin to get original one and still having issues lol
johnnylicious said:
i installed it but it didnt work force close on contacts i delete original Contacts.apk and dalvik-cache and rebooted
any ideas? im tryin to get original one and still having issues lol
Click to expand...
Click to collapse
You get FC's when you push original one ?
akirah said:
You get FC's when you push original one ?
Click to expand...
Click to collapse
well im using the eclair theme 2.0 over cyan's 4.3.2.1 i tried pushing the original themed one back into system/app and still get error
hmm

[APP] Zune software remote control

Instructions + download: http://forum.xda-developers.com/showpost.php?p=17254652&postcount=7
I have finally found a way to control the Zune software running on Windows. The Zune API is horrible so there are few(if any) programs that interface with the software externally. Today I came across the SendMessage method. The idea is your Android device is a big remote control for the Zune software. If you already have a media remote then this application isn't needed. I only have a remote on my laptop, not desktop so that's why I'm bothering to write it. I thought I would share it on XDA for free.
http://pastebin.com/C85isGsW - that was my test program. When I opened it my music paused(yay!).
Anyways this will be a 2-part system. The Windows app will run in the background(either as a service or in the system tray) and listen on some random TCP port for a connection. It will be relatively small, using less than 50MB RAM. This one uses 27MB right now(yes, C# is bloated).
The Android app will simply connect over the wifis or even over the internet(just remember to forward ports) and after a quick handshake it will be able to send and receive data from the service/app in tray. First I'll start with simple play/pause buttons and a volume slider and eventually I'll add all the interfaces listed here: http://msdn.microsoft.com/en-us/library/ms646275(v=vs.85).aspx
Step 1: install service or open the Windows program
Step 2: type computer IP in android app
Step 3: press play/pause or control volume etc. It will save the IP so you don't have to keep typing it in. In fact I will have a dropdown list so you can select different computers(HTPC, basement computer etc.)
I just started writing the program so it will by done by the end of the weekend. Figured I would create the thread since I know it will work.
inb4 zune sucks
Interested in seeing this.
Sent from my Transformer TF101 using XDA Premium App
yes dude yes!!! imso amped for this! thanks so much.
OK I got the windows side app 95% done... started the Android version and well.. I'm a noob. Looks like honeycomb makes you interface with TCP in a separate thread...
Windows server code:
Code:
hile (stop != 1)
{
// Perform a blocking call to accept requests.
// You could also user server.AcceptSocket() here.
TcpClient client = server.AcceptTcpClient();
data = null;
// Get a stream object for reading and writing
NetworkStream stream = client.GetStream();
int i;
// Loop to receive all the data sent by the client.
while ((i = stream.Read(bytes, 0, bytes.Length)) != 0)
{
// Translate data bytes to a ASCII string.
data = System.Text.Encoding.ASCII.GetString(bytes, 0, i);
//Console.WriteLine("Received: {0}", data);
if (Convert.ToString(data).CompareTo("PP") == 0) SendMessageW(hwnd, WM_APPCOMMAND, hwnd, (IntPtr)APPCOMMAND_MEDIA_PLAY_PAUSE);
if (Convert.ToString(data).CompareTo("UP") == 0) SendMessageW(hwnd, WM_APPCOMMAND, hwnd, (IntPtr)APPCOMMAND_VOLUME_UP);
if (Convert.ToString(data).CompareTo("DN") == 0) SendMessageW(hwnd, WM_APPCOMMAND, hwnd, (IntPtr)APPCOMMAND_VOLUME_DOWN);
if (Convert.ToString(data).CompareTo("PR") == 0) SendMessageW(hwnd, WM_APPCOMMAND, hwnd, (IntPtr)APPCOMMAND_MEDIA_PREVIOUSTRACK);
if (Convert.ToString(data).CompareTo("NE") == 0) SendMessageW(hwnd, WM_APPCOMMAND, hwnd, (IntPtr)APPCOMMAND_MEDIA_NEXTTRACK);
// Process the data sent by the client.
//device.AudioEndpointVolume.MasterVolumeLevelScalar = (Convert.ToInt64(data) / 100.0f);
//byte[] msg = System.Text.Encoding.ASCII.GetBytes(data);
//byte[] msg = System.Text.Encoding.ASCII.GetBytes("Successfully set to " + data);
// Send back a response.
//stream.Write(msg, 0, msg.Length);
//Console.WriteLine("Sent: {0}", data);
}
// Shutdown and end connection
client.Close();
}
}
What needs to happen to connect to the server(client code)
Code:
static void Connect(String server, String message)
{
try
{
// Create a TcpClient.
// Note, for this client to work you need to have a TcpServer
// connected to the same address as specified by the server, port
// combination.
Int32 port = 13000;
TcpClient client = new TcpClient(server, port);
// Translate the passed message into ASCII and store it as a Byte array.
Byte[] data = System.Text.Encoding.ASCII.GetBytes(message);
NetworkStream stream = client.GetStream();
// Send the message to the connected TcpServer.
stream.Write(data, 0, data.Length);
// Close everything.
stream.Close();
client.Close();
}
catch (ArgumentNullException e)
{
MessageBox.Show("ArgumentNullException: " + e.ToString());
}
catch (SocketException e)
{
MessageBox.Show("SocketException: " + e.ToString());
}
}
So I would call Connect("192.168.1.40", "PP"); to pause/play the server(desktop running Zune)
Code:
package com.pwn.control;
import android.app.Activity;
import java.io.*;
import java.net.*;
import android.widget.*;
import android.os.Bundle;
import android.os.StrictMode;
public class ControlActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
tv = new TextView(this);
tv.setText("HELLO WORLD");
setContentView(tv);
run();
}
TextView tv;
public void run()
{
new Thread(new Runnable() { public void run() {
Socket socket;
try
{
InetAddress serverAddr = InetAddress.getByName("192.168.1.40");
socket = new Socket("192.168.1.40", 13000);
//socket.connect();
DataOutputStream out = new DataOutputStream(socket.getOutputStream());
out.writeBytes("PP");
//PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(socket.getOutputStream())), true);
//out.println("PP");
socket.close();
}
catch (Exception e)
{
tv.setText(e.toString());
//setContentView(R.layout.main);
}
}
} ).start();
}
}
Unfortunately the above code doesn't work. Kinda stuck lol... maybe someone knows more about writing android apps than I do.
http://www.youtube.com/watch?v=PMjNrd1d4FM
Got it working with an ASP site...
now the annoying part... I tried setting it up with a default IIS instance and it doesn't have permissions to use the user32.dll!!! I tried forced impersonation and tons of different tricks but for some reason it isn't getting as high permissions as the ASP.NET debugging server.
So I need to either fix the android app so it will communicate with the service, or I need to find a way to get the IIS instance enough permissions to interact with the desktop. I did set the IIS Admin service to "interact with desktop" but nothing happened.
I also tried setting up Apache 2.2 with mod_asp installed but it has the same result... blocked from interacting.
Ok I got it working but it's really really makeshift right now...
ASP website --> loopback on port 13000 --> C# app(that will actually interface with the Zune software)
I couldn't make the API call from the C# code in the ASP site because IIS doesn't have enough permissions. So since my only drawback before was that I couldn't communicate between .NET TcpListener and Java, I can just use the ASP site to make the TcpClient connection.
The good thing is you can access this interface from anything with a web browser. Just make http://computer-ip:port/ZuneControl a favorite on any device and you can control Zune from it.
http://www.youtube.com/watch?v=haVLCOY0l6U
If you're really eager to try the alpha build with IIS that's fine...
Just set up IIS like I do in the video and add port 13000 to your inbound and outbound firewall rule. I'll work on the UI when I get some time next weekend.
Here is the code for the C# app. http://pastebin.com/08kCjKQW
The web code is in the RAR file. I just copied and pasted out of that pastebin with some extra buttons.
http://tunerspotter.com/\dropbox\misc\ZuneControl.rar
In that ZuneControl folder, ZuneControl.exe is the app. Click start, then minimize it after you set up IIS. It will work for Apache installations also. I have Apache on port 82. http://sourceforge.net/projects/mod-aspdotnet/
Instruction video: http://www.youtube.com/watch?v=ClCQhmQxC7Q
Well i've been using the web interface for a few days and it kicks ass. Does exactly what i want. I can be in bed and change songs/volume from another tab in Opera.
Next weekend Ill see if i can get the program to listen on port 81 as a web service so instead of setting up IIS or apache all you have to do is open the app and click start(then minimize it)
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
hey are you still working on this? I would really love something like this!
well i gave up on the app and just turned it into a ASP site + windows application. so yeah i've been using it for a few months. works great, i can pull up on any web capable device and adjust my music. Whether it's my zune, tablet, computer, or phone, i can adjust volume, go back/next, and pause/play from any device. i set up port forwarding with dyndns.org so it works over 3G

[PRIVACY] WARNING: Dolphin's collection of your browsing history

If it weren't for things like this, I'd still be a fan of Dolphin Browser.
Ever since the 'webzine' 'feature' came out (in version 6), this app forwards the URL of:
Every link you click.
Every search you enter.
Every page you load.
To: http://en.mywebzines.com/v3/columns?u=(URLencodedURL)&t=(TIMESTAMP)
This includes:
SSL URLs.
QUERY_STRINGS.
IP addresses on private networks and file:// urls.
In addition, when I mentioned this on http://blog.dolphin-browser.com, the comment awaited moderation for two days before being deleted. I've yet to receive an email.
Proof:
Code:
[[email protected]]~# ngrep -P '!' -lq -R -W single -M '(^GET|^POST|^Host:|^[^ ]ookie:)' "tcp port 80"
interface: eth0 (10.23.1.0/255.255.255.0)
filter: (ip or ip6) and ( tcp port 80 )
match: (^GET|^POST|^Host:|^[^ ]ookie:)
T 10.23.1.220:60126 -> 107.20.41.53:80 [AP] GET /v3/columns?u=http%3A%2F%2F10.23.1.254%2F&t=1319574537635 HTTP/1.1!!Authorization: cd7f573ec9e6e865a28aaab7a1793796!!Accept-Encoding: gzip!!Host: en.mywebzines.com!!Connection: Keep-Alive!!!!
(less spammy proof)
[G] www.google.com:80/search?q=wut
[G] en.mywebzines.com:80/v3/columns?u=http%3A%2F%2Fwww.google.com%2Fsearch%3Fq%3Dwut&t=1319574984926
[G] en.mywebzines.com:80/v3/columns?u=https%3A%2F%2Fwww.google.com%2Fsearch%3Fq%3Dwhat%2Bis%2Bthis%2Bi%2Bdont%2Beven&t=1319575011872
[G] en.mywebzines.com:80/v3/columns?u=file%3A%2F%2Fsdcard%2Fdata%2Fhome.html&t=1319575109160
Stick this in your /system/etc/hosts to make the Orwellian nightmare stop. This will break webzine 'functionality', and is only possible on rooted phones:
Code:
127.0.0.1 en.mywebzines.com mywebzines.com
Alternatively, here is how to remove this via APKTool:
Code:
* apktool d mobi.mgeek.TunnyBrowser-1.apk
* apply the this patch to smali/mobi/mgeek/TunnyBrowser/WebViewCallbackHandler.smali
#####
--- orig-7.0/smali/mobi/mgeek/TunnyBrowser/WebViewCallbackHandler.smali 2011-10-22 11:41:43.000000000 +0000
+++ mobi.mgeek.TunnyBrowser-7/smali/mobi/mgeek/TunnyBrowser/WebViewCallbackHandler.smali 2011-10-22 11:40:18.000000000 +0000
@@ -2189,7 +2189,7 @@
.line 576
:cond_2
- invoke-direct {p0, p1, v0}, Lmobi/mgeek/TunnyBrowser/WebViewCallbackHandler;->a(Lcom/dolphin/browser/core/IWebView;Ljava/lang/String;)V
+# invoke-direct {p0, p1, v0}, Lmobi/mgeek/TunnyBrowser/WebViewCallbackHandler;->a(Lcom/dolphin/browser/core/IWebView;Ljava/lang/String;)V
goto :goto_0
.end method
#####
I would attach an .apk of dolphin cleansed of it's spyware AIDS, however I'm not sure if the mods would like that.
update:
Modified APKs posted http://forum.xda-developers.com/showpost.php?p=18799432&postcount=61
update: Fiasco appears on http://www.androidpolice.com/2011/1...e-you-visit-to-a-remote-server-in-plain-text/
update: Dolphin writes blog post claiming data is not retained, and that 'feature' is disabled. Latest market version. (7.0.1/id105) appears, still forwards urls
update: Version 7.0.2 (id 106) no longer forwards urls.
While I have no proof dolphin == mywebzines, they conveniently share the same hosting and dns providers (both domains are registered via proxy)
Code:
[[email protected]]~# for i in $(host -t a dolphin-browser.com|awk '{print $NF}');do host $i;done
89.249.19.50.in-addr.arpa domain name pointer ec2-50-19-249-89.compute-1.amazonaws.com.
[[email protected]]~# for i in $(host -t a en.mywebzines.com|awk '{print $NF}');do host $i;done
77.123.17.50.in-addr.arpa domain name pointer ec2-50-17-123-77.compute-1.amazonaws.com.
185.179.17.50.in-addr.arpa domain name pointer ec2-50-17-179-185.compute-1.amazonaws.com.
58.30.19.50.in-addr.arpa domain name pointer ec2-50-19-30-58.compute-1.amazonaws.com.
167.175.19.50.in-addr.arpa domain name pointer ec2-50-19-175-167.compute-1.amazonaws.com.
93.246.101.75.in-addr.arpa domain name pointer ec2-75-101-246-93.compute-1.amazonaws.com.
53.41.20.107.in-addr.arpa domain name pointer ec2-107-20-41-53.compute-1.amazonaws.com.
205.64.72.184.in-addr.arpa domain name pointer ec2-184-72-64-205.compute-1.amazonaws.com.
119.178.72.184.in-addr.arpa domain name pointer ec2-184-72-178-119.compute-1.amazonaws.com.
156.2.73.184.in-addr.arpa domain name pointer ec2-184-73-2-156.compute-1.amazonaws.com.
33.95.17.50.in-addr.arpa domain name pointer ec2-50-17-95-33.compute-1.amazonaws.com.
[[email protected]]~# host -t ns mywebzines.com;host -t ns dolphin-browser.com
mywebzines.com name server ns2.dnsv5.com.
mywebzines.com name server ns1.dnsv5.com.
dolphin-browser.com name server ns1.dnsv4.com.
dolphin-browser.com name server ns2.dnsv4.com.
[[email protected]]~#
Subscribed.
As a Dolphin user, I'm interested to see where this goes.
Maybe you can get the adfree android developer to add en.mywebzines.com to the next hosts file update and problem solved (for adfree users, at least).
lexluthor said:
Subscribed.
As a Dolphin user, I'm interested to see where this goes.
Maybe you can get the adfree android developer to add en.mywebzines.com to the next hosts file update and problem solved (for adfree users, at least).
Click to expand...
Click to collapse
Does't adfree allow custom entries?
I still use dolphin 4 as it has the best UI on android...especially after the modifications I've made. Unfortunately since it's free of admob and mobosquare code I'd probably get in trouble for posting it
Nice work. I'll keep watching this thread.
Uninstallimg today
mills2533 said:
Nice work. I'll keep watching this thread.
Click to expand...
Click to collapse
Makes you wonder why Google is still allowing Dolphin to stay in their catalog.... Uninstalling today!
Hmmmmph!
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
If we add this address to the hosts file, won't the problem be solved?
Thanks for bringing this up anyways!
Good find, uninstalling now. Do you know if this applies to ant other browsers ?
I use Boat Browser, very clean.. none of the concerns and bloatware mentioned.
is there any word on miren browser?
Uninstalling now, and too bad, I like their setup. Guess I will be shopping around for another browser.
Plus interested in seeing where this will go.
Eh, i don't mind. The only good use that Dolphin gave me was that before i exit it it asked if i wanted to clear history, and so i only use it for porn.
My fav browser is the default MIUI browser.
xriderx66 said:
Eh, i don't mind. The only good use that Dolphin gave me was that before i exit it it asked if i wanted to clear history, and so i only use it for porn.
My fav browser is the default MIUI browser.
Click to expand...
Click to collapse
Heh heh I guess I could use it for soke flixs! Any good sites?
I recommend Boat Browser. It's very smooth and clean. I switched to it from dolphin and I've never looked back.
abdielol said:
I recommend Boat Browser. It's very smooth and clean. I switched to it from dolphin and I've never looked back.
Click to expand...
Click to collapse
Omnichron said:
I use Boat Browser, very clean.. none of the concerns and bloatware mentioned.
Click to expand...
Click to collapse
I remember trying boat. It failed my evaluation on two counts: The lower button bar wouldn't go away, and it constantly posted data to http://www.umeng.com/app_logs
Code:
[P] www.umeng.com:80/app_logs
post: T 10.23.1.220:38582 -> 211.151.139.246:80 [AP] H!}![K!1!!!!!'!!!K!7!A!!E!E|!Y!d!.M!!!H-!!N!!!!}!!!!sfV{!!!!!d!!!!!!#!I!v V-!!!(k!!T!k!!!!!2!j!!"G!A!!!5!A>!!!]!!`K!Tk!!!!`!!!!J^!XdT!jC!!!!!D!!&5C!!:W=!!S!!e D!!!!!g!G!!!!!!O!c!<!!!!!I!1!!!X!!!z!!!!!!1!!4#!!!!!!!!!0>!!!C{4%!:o!~!!!!!!tJ!!!!!!]!!!!!!!!!!!!!!!!!!!C!C!!!!!qY!!5[#!M!!K(+*s!!!PI!u!!/J!!q!0!!!-!!!=?!g!!!Q\!!w!!!R!!!!!0!G3-V2!!U!m!5!q![!j!g!!Z9w!!eV!oC!!od!!!
I've not sifted through smali code to see -what- gets posted, but it does so every time you do something.
Damn it. All the other browsers suck.
Sent from my ADR6300 using Tapatalk
try opera I guess its your only choice
Dolphin mini doesn't have webzine right?
Stock ftw.
can you check miren browser?

[Guide} [Basic] App development basics and first android app fully functional

This is basic guide to start to off app development for android..........
This is just a basic guide and not a comprehensive one which covers the whole lot of it but a rather a guide to get a basic simple app of your own running without any issues
Requirements
A bit of java
linux , darwin or a windows 7 machine
internet connection
basic idea of how programming works
sdk with atleast one api installed and configured path
Part 1 setting up everthing and explaining used variables and terms
Now let's get started
[windows}
Download eclipse as any other software and install it by the .exe file and follow the instructions
(linuc macosx )
if you are on a older ditribution of linux the minimum required version of eclipse 3.6 is not supplied via ubuntus main repository ....
so you need to download it from the eclipse official website and install it....
[common}
Installing ADT(Android developer tools) plugin
open up eclipse
Start Eclipse, then select Help > Install New Software.
Click Add, in the top-right corner.
In the Add Repository dialog that appears, enter "ADT Plugin" for the Name and the following URL for the Location:
https://dl-ssl.google.com/android/eclipse/
Click OK.
If you have trouble acquiring the plugin, try using "http" in the Location URL, instead of "https" (https is preferred for security reasons).
In the Available Software dialog, select the checkbox next to Developer Tools and click Next.
In the next window, you'll see a list of the tools to be downloaded. Click Next.
Read and accept the license agreements, then click Finish.
If you get a security warning saying that the authenticity or validity of the software can't be established, click OK.
When the installation completes, restart Eclipse.
Configure the ADT Plugin
Once Eclipse restarts, you must specify the location of your Android SDK directory:
In the "Welcome to Android Development" window that appears, select Use existing SDKs.
Browse and select the location of the Android SDK directory you recently downloaded.
Click Next.
If you haven't encountered any errors, you're done setting up ADT and can continue to Next Steps.
the path to the sdk is case sensitive and absolute so be careful guys....
Now you have virtually everything set up to start building apps
go to file>new>project>android>android application project
something like this will pop up
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
now
the first three fields are yours to choose
now the second part
The build sdk is the sdk that you are targeting in laymans words its like building a building on a certain specific site.....
the minimum required sdk
now if choose this as froyo(api 8) your app will run on froyo os and above and will be compatible with older flavours of android....
once you are done creating a new project hit finish
now you will see something like this
now the calculator is my app name the name that you gave a few minutes ago will be yours...
Now the android is basically divided into three main things
The android manifest
The src folder
The xml
The android manifest basically is a traffic police in lay mans words
it determines which activity comes first when it ends etc...
note:i will be referring the xml to a activty
the src folder contains all of your java
xml's are the skeltel system of android they define the size layout colour or the whole look of your android project....
Note: dont tinker with the gen folder you alone will be responsible for your mistakes
in this tutorial you will be working with only src,res and xml's as i cant dig deeper into it because its a subject too broad to teach....
now lets get started
navigate to res > layout double click on main_activty.xml
below the screen click on activty_main.xml next to graphical layout...
something like this will appear
HTML:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="@string/hello_world"
tools:context=".MainActivity" />
</RelativeLayout>
this is the text appearing to you
Note this is auto generated....
now i will explain each line of it with my limited knowledge
HTML:
]<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
This is the auto generated refernce by eclipse yours may vary and might not be same as mine
HTML:
android:layout_width="match_parent"
android:layout_height="match_parent"
now you can see that the layout is set to match_parent by deafult
match_parent utilizes the whole screen into your layout...
and observe this guys the
HTML:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
the relative layout has started with <relativelayout and ended with > anything code started should be finished up by > or />
both are literally same
now the next junk of code to deal with
HTML:
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="@string/hello_world"
tools:context=".MainActivity" />
Textview is basically a method by google to display some text on the screen...
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
These two lines suggest that your app has both vertcal and horizontal layout
android:text="@string/hello_world"
this is the text being displayed on your graphical layout
now go to layout > values > strings.xml
double click it
you will see something like this
now basically strings are resource files used to show text on display...
the string name cant have any spaces if it has then u will see errors
but the value of the string can have spaces
Activity
change the text in value field and see the result in graphical layout of the xml
now you basically need to use strings for each and every text that has to be displayed.......
End of part 1
Part 2
Adding of buttons and modifying them
now guys lets add some buttons to our project
navigate to src
in that you will find a java file open it (.java)
you will find something like this
HTML:
package com.exmple.addandsubract;
import android.R;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
public class Layout extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_list_item);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_layout, menu);
return true;
}
}
now you might be wondering what is this crap code ...
now lets add buttons
navigate into layout open up the xml
your screen will show up this
HTML:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="@string/hello_world"
tools:context=".MainActivity" />
</RelativeLayout>
now within the closing of relative layout
copy paste this
HTML:
<Button
android:id="@+id/bsub"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginTop="79dp"
android:text="@string/sub" /
every button must have an id for our convenience we have added a bsub as our program is to add and subtract a number
HTML:
android:layout_width="match_parent"
the layout width specifies the size of the width of the button
as i have said before match_parent is to occupy the whole screen..if you want it smaller you can set it in dp(density pixels)
HTML:
android:text="@string/sub"
you cant hard code stuff into the button u need to refernce it to a string i have referred it to the string sub
for this to work it requires you to add a string by the name sub in strings.xml
now do the same code again for button add
after this you will have something like this showing up
now that we have our button's set up we need to make this work (in real add java to it)
to accomplish this we need to link xml's to java
this may sound like greek and latin but guys stick with it u will understand everything
now below
HTML:
public class Layout extends Activity {
type this
HTML:
int counter=0;
Button add,sub;
TextView display;
as u may all know we should define a variable before we use them
as we are working with number (basically integars we use integar to define them
now we basically define display as textview
now coming to the real java part
HTML:
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_list_item);
after this chunk of code
type
HTML:
counter=0;
the counter is the number which should be displayed on the screen for us
i have decided to start with 0 you can set it to any number that you prefer
now type this
HTML:
add = (Button) findViewById(R.id.badd);
sub = (Button) findViewById(R.id.bsub);
what this basically says is that add is a button and its id(in the xml) is badd.. findviewbyid is the method for referencing
now its the same for sub button too
HTML:
display = (TextView) findViewById(R.id.textView1);
this will set our display to textview1 which is our activity.xml this may sound as bloat to you but its handy when working with many xmls
now type
HTML:
add.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
display.setText("Your total is " + counter );
}
});
sub.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
display.setText("Your total is " + counter );
}
});
i will explain what this does
HTML:
add.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
display.setText("Your total is " + counter );
}
});
type add. then all lists will popup select onclicklistener(this makes the button clickable)
within the brackets of onclicklistener type new(as its a new button) leave a space type view.onlclicklistener(again you will see popups
now what is between this two brackets is what happens when the button is clicked now add this in between these brackets
HTML:
add.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
counter=counter+1;
display.setText("Your total is " + counter );
}
});
sub.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
counter=counter-1;
display.setText("Your total is " + counter );
}
});
HTML:
counter=counter-1;
this decrements the counter value by 1
after the counter is decremented we need to change the display to show the value of it
we do that by typing this
HTML:
counter=counter-1;
display.setText("Your total is " + counter );
now do this for both buttons test the app on emulator
Have doubts comment below
liked the thread rate it that gives me moral confidence and motivation
1st reserved op has plans of increasing
reservation
2nd
one final one for the day... :cyclops:
thanks! :good:
its to the point and very precise!
View attachment HelloWorld.apk
how do i add an icon? mine is the default andy.
And is it possible to open an app (eg launcher pro) in eclipse and mod it as per my wish?
Harryhades said:
thanks! :good:
its to the point and very precise!
View attachment 1401833
how do i add an icon? mine is the default andy.
And is it possible to open an app (eg launcher pro) in eclipse and mod it as per my wish?
Click to expand...
Click to collapse
There are two ways to add icon after giving the package name in the next menu you can change the icon....or go re drawabl-hdpi and replace the icon.png by the one that u want it should be case sensitive and it should be the same text....
For the 2nd question
yes you can mod these apps i have tried adw from cm'r repo but it should work with launhcer pro to btw the app has to deodexed.....
Thanks
Thanks bro i have started developing one :good:
completing the guide this sunday
I realize this is a few years old but I'm new to developing apps and I been trying to get this to work so that I can add a number to a number stored in a database. The number is put in the database via "edittext". When I try this my number gets replaced with "false" when I hit the add button.
Sent from my LG-LS995 using XDA Free mobile app

[APP] New GOOGLE camera

Hi guys google released new camera app with background defocus feature for 4.4 devices and one member of xda is port this camera for jb devices and its working on our XL.
But there is no panorama feature...
And u must disable the google play service from settings>app>all>..... . Unless it shows fc.
It works on jb4.2.2 latest firmware.
here is the download link d-h.st/qZQ
And original post: forum.xda-developers.com/showthread.php?t=2721266
Screeshot
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Sent from my C2104 using Tapatalk
New pictures taken with Google camera...
NORMAL mode:
HDR mode:
Lens Blur mode:
sent from ÂЙĐЯÖÎĐ ШÎŤH MÝ BÜĎĐÝ XPËЯIĀ Ł
Awesome , This I Want
Sent from my C2105 using xda app-developers app
FC
It's not working for me, I got a camera FC.
C2105
4.2.2 / fw 15.3.A.1.14
Installed as normal app
EDIT:
I didn't read OP properly. I did not disable Google Play Services. I have not/will not try it with Google Play Services disabled.
Thread Opened
Saqib Nazm said:
Thread Opened
Click to expand...
Click to collapse
Thanks
sent from ÂЙĐЯÖÎĐ ШÎŤH MÝ BÜĎĐÝ XPËЯIĀ Ł
Still got fc even after disabling play services and play store
Sent from my C2105 using xda app-developers app
Stoped play Service with. Titanium backup and work fine
Enviado desde mi C2104 usando Tapatalk 2
AlvinZahran98 said:
Still got fc even after disabling play services and play store
Sent from my C2105 using xda app-developers app
Click to expand...
Click to collapse
don't disable playstore.
and check the original thread from first post for newest updates an solutions
What I have found is that the app calls a plenty of API19/KK specific calls and that is why it FCs.
The problem are not the libs (probably). It is also not a good idea to mess libs in your system - even if some additional libs shall be needed, thou can almost surely place them in googlecamera data files:
/data/data/com.google.android.GoogleCamera/lib (default location in 4.1.2! Not sure about 4.2/4.3, it might be app-lib subdir or something like that)
and chmod them 755 and chown them 1000:1000. However...
After first logcat insights, I have decompiled the apk file with apktool.
At the beginning, I have found out that API19 introduced some "floating" variable type maths API, which was available only for "double" type variables before. This one was easy. After decompiling, I have edited:
smali\com\android\camera\util\CameraUtil.smali
in such a way:
Before:
Code:
.method private static getGaussianMask([F)V
[COLOR="Red"].locals 9[/COLOR]
.parameter "mask"
.prologue
...
div-int/2addr v7, v8
[COLOR="red"] int-to-float v7, v7
invoke-static {v7}, Landroid/util/FloatMath;->exp(F)F
move-result v7[/COLOR]
const/high16 v8, 0x4000
...
After:
Code:
.method private static getGaussianMask([F)V
[COLOR="Green"] .locals 11[/COLOR]
.parameter "mask"
.prologue
...
div-int/2addr v7, v8
[COLOR="SeaGreen"] int-to-double v9, v7
invoke-static {v9, v10}, Ljava/lang/Math;->exp(D)D
move-result-wide v9
double-to-float v7, v9[/COLOR]
const/high16 v8, 0x4000
...
And - YAY! - after compiling it again, it started to work under 4.1.2 Touchwiz! Including photosphere, new lens features etc.
Won't upload an apk file - I guess it breaks google license, it's an easy thing to do if you want to do it yourself, and maybe someone will be brave enough...
Anyway.
It still does not work stable. Still has to disable gms and still FCs after switching to any other mode, than chosen actually...
I have found out that the next cause of FCs is hidden in the fact that GC invokes:
android.os.HandlerThread->quitSafely
and
android.os.Looper->quitSafely
when shutting down any mode to switch to another one (there are about 5-6 calls within the smali code...).
It's a harder stuff to edit thru mali. Now I am trying to switch the functions to (available previously) "quit" methods - but guess quitting "unSafely" may cause some further trouble to user experience. I dont know. I am not experienced in this kind of stuff.
Hope those hints will show someone smarter than me the good way to backport this goddamn cam app...
Awesome ! thanks a lot bro
first one is from default camera
second from Google camera App
only drawback is that Google services have to be disabled
i m on 4.4.2(xperia sp, custom rom) but app still freeze

Categories

Resources