NFC is inside the battery!
What happens if you put a Galaxy S II NFC battery into a Galaxy R?
You get NFC?? hehe
forgot it,it's impossible...
I dont think so.
Im using Galaxy s II bateries in my galaxy R, but i dont expect obtain NFC.
Sorry, but i think that is imposibol, better you should be enthusiastic with other posibol new freatures, like HDMI conection.
jose_ma294 said:
Im using Galaxy s II bateries in my galaxy R, but i dont expect obtain NFC.
Sorry, but i think that is imposibol, better you should be enthusiastic with other posibol new freatures, like HDMI conection.
Click to expand...
Click to collapse
You need to have a nfc galaxy S II battery not the normal one.
You use the nfc version?
Anyway I was just speculating... wondering... we can not find new stuff if we do not try....
What you mean with possible hdmi connection?
You mean mhl?
How?
Hi
About NFC i did quick search for the kernel sources and can confirm that it has option for NXP PN544 chip but it's support not compiled in kernel (no option CONFIG_PN544 enabled or even not exists)
Here is code from board-n1.c (which is our phone bord def)
Code:
#ifdef CONFIG_PN544
static void n1_nfc_init(void)
{
gpio_request(GPIO_NFC_IRQ, "nfc_irq");
gpio_request(GPIO_NFC_EN, "nfc_en");
gpio_request(GPIO_NFC_FIRMWARE, "nfc_firm");
gpio_direction_input(GPIO_NFC_IRQ);
gpio_direction_output(GPIO_NFC_EN, 0);
gpio_direction_output(GPIO_NFC_FIRMWARE, 0);
tegra_gpio_enable(GPIO_NFC_IRQ);
tegra_gpio_enable(GPIO_NFC_EN);
tegra_gpio_enable(GPIO_NFC_FIRMWARE);
}
#endif
...
#ifdef CONFIG_PN544
n1_nfc_init();
#endif
About HDMI i fond parts of code for Silicon Image SII9234 mhl but there is no support of it in SGR kernel
This thread has some info about SII9234 and HDMI from USB
http://forum.xda-developers.com/showthread.php?t=960145
And home site
http://www.siliconimage.com/products/product.aspx?pid=169
I can confirm that it is in code and in the gpio map
this is from kernel source
Code:
#ifdef CONFIG_MHL_SII9234
#define GPIO_INPUT 0
#define GPIO_OUTPUT 1
#define GPIO_LEVEL_LOW 0
#define GPIO_LEVEL_HIGH 1
#define GPIO_LEVEL_NONE 2
static unsigned int mhl_gpio_table[][3] = {
{GPIO_MHL_SEL, GPIO_OUTPUT, GPIO_LEVEL_LOW},
{GPIO_MHL_RST, GPIO_OUTPUT, GPIO_LEVEL_HIGH},
{GPIO_MHL_INT, GPIO_INPUT, GPIO_LEVEL_NONE},
{GPIO_MHL_WAKE_UP, GPIO_INPUT, GPIO_LEVEL_NONE},
{GPIO_HDMI_LDO_EN, GPIO_OUTPUT, GPIO_LEVEL_LOW},
};
const char *mhl_gpio_name[] = {
"mhl_sel",
"mhl_rst",
"mhl_int",
"mhl_wake_up",
"hdmi_ldo_en"
};
static void n1_mhl_gpio_init(void)
{
...
}
static int sii9234_power_onoff(int onoff)
{
...
}
static int sii9234_switch_onoff(int onoff)
{
...
}
struct mhl_platform_data mhl_pdata = {
.mhl_sel = GPIO_MHL_SEL,
.mhl_rst = GPIO_MHL_RST,
.mhl_int = GPIO_MHL_INT,
.mhl_wake_up = GPIO_MHL_WAKE_UP,
.power_onoff = sii9234_power_onoff,
#ifdef CONFIG_MHL_SWITCH
.switch_onoff = sii9234_switch_onoff,
#endif
#endif
...
#ifdef CONFIG_MHL_SII9234
n1_mhl_gpio_init();
#endif
but it not enabled in configs too
my kernel config says
Code:
# CONFIG_MHL_SII9234 is not set
So for this features to function there should be hardware and what i do not know if it is just disabled in kernel or there is no real chips on PCB
What i suggest is to enable the options recompile kernel and try to connect HDMI USB cable and that battary with NFC and maybe we will be lucky )
---------- Post added at 07:57 AM ---------- Previous post was at 07:50 AM ----------
If there is source codes of newer versions it will be good thing to look in them because you can do get mach info just from reading it
---------- Post added at 08:11 AM ---------- Previous post was at 07:57 AM ----------
I'm will be not surprised if this chips are not installed SGR is chipper then SGS II and probably they did have this ideas in first place but budget was not for it
I think about NFC battery, it can be a chance that chip is inside it, and just need to add support for it in kernel, but need to check it
I had no much experiences in packaging Android kernel but i can build it for you with support of thous features enabled and you guys can pack it im also do not have battery from SGS II with nfc and cable for HDMI MHL (and device to check it with my monitor do not support HDMI MHL), so you will have to check it and look in to dmesg log to see what happes
Ok i got ardatdat sources will enable config options and build image, it is interesting to hear what he thinks about this
SPLESH said:
Hi
About NFC i did quick search for the kernel sources and can confirm that it has option for NXP PN544 chip but it's support not compiled in kernel (no option CONFIG_PN544 enabled or even not exists)
Here is code from board-n1.c (which is our phone bord def)
Code:
#ifdef CONFIG_PN544
static void n1_nfc_init(void)
{
gpio_request(GPIO_NFC_IRQ, "nfc_irq");
gpio_request(GPIO_NFC_EN, "nfc_en");
gpio_request(GPIO_NFC_FIRMWARE, "nfc_firm");
gpio_direction_input(GPIO_NFC_IRQ);
gpio_direction_output(GPIO_NFC_EN, 0);
gpio_direction_output(GPIO_NFC_FIRMWARE, 0);
tegra_gpio_enable(GPIO_NFC_IRQ);
tegra_gpio_enable(GPIO_NFC_EN);
tegra_gpio_enable(GPIO_NFC_FIRMWARE);
}
#endif
...
#ifdef CONFIG_PN544
n1_nfc_init();
#endif
About HDMI i fond parts of code for Silicon Image SII9234 mhl but there is no support of it in SGR kernel
This thread has some info about SII9234 and HDMI from USB
http://forum.xda-developers.com/showthread.php?t=960145
And home site
http://www.siliconimage.com/products/product.aspx?pid=169
I can confirm that it is in code and in the gpio map
this is from kernel source
Code:
#ifdef CONFIG_MHL_SII9234
#define GPIO_INPUT 0
#define GPIO_OUTPUT 1
#define GPIO_LEVEL_LOW 0
#define GPIO_LEVEL_HIGH 1
#define GPIO_LEVEL_NONE 2
static unsigned int mhl_gpio_table[][3] = {
{GPIO_MHL_SEL, GPIO_OUTPUT, GPIO_LEVEL_LOW},
{GPIO_MHL_RST, GPIO_OUTPUT, GPIO_LEVEL_HIGH},
{GPIO_MHL_INT, GPIO_INPUT, GPIO_LEVEL_NONE},
{GPIO_MHL_WAKE_UP, GPIO_INPUT, GPIO_LEVEL_NONE},
{GPIO_HDMI_LDO_EN, GPIO_OUTPUT, GPIO_LEVEL_LOW},
};
const char *mhl_gpio_name[] = {
"mhl_sel",
"mhl_rst",
"mhl_int",
"mhl_wake_up",
"hdmi_ldo_en"
};
static void n1_mhl_gpio_init(void)
{
...
}
static int sii9234_power_onoff(int onoff)
{
...
}
static int sii9234_switch_onoff(int onoff)
{
...
}
struct mhl_platform_data mhl_pdata = {
.mhl_sel = GPIO_MHL_SEL,
.mhl_rst = GPIO_MHL_RST,
.mhl_int = GPIO_MHL_INT,
.mhl_wake_up = GPIO_MHL_WAKE_UP,
.power_onoff = sii9234_power_onoff,
#ifdef CONFIG_MHL_SWITCH
.switch_onoff = sii9234_switch_onoff,
#endif
#endif
...
#ifdef CONFIG_MHL_SII9234
n1_mhl_gpio_init();
#endif
but it not enabled in configs too
my kernel config says
Code:
# CONFIG_MHL_SII9234 is not set
So for this features to function there should be hardware and what i do not know if it is just disabled in kernel or there is no real chips on PCB
What i suggest is to enable the options recompile kernel and try to connect HDMI USB cable and that battary with NFC and maybe we will be lucky )
---------- Post added at 07:57 AM ---------- Previous post was at 07:50 AM ----------
If there is source codes of newer versions it will be good thing to look in them because you can do get mach info just from reading it
---------- Post added at 08:11 AM ---------- Previous post was at 07:57 AM ----------
I'm will be not surprised if this chips are not installed SGR is chipper then SGS II and probably they did have this ideas in first place but budget was not for it
I think about NFC battery, it can be a chance that chip is inside it, and just need to add support for it in kernel, but need to check it
I had no much experiences in packaging Android kernel but i can build it for you with support of thous features enabled and you guys can pack it im also do not have battery from SGS II with nfc and cable for HDMI MHL (and device to check it with my monitor do not support HDMI MHL), so you will have to check it and look in to dmesg log to see what happes
Click to expand...
Click to collapse
Great Job! Say Thanks to SPLESH!
Please support him!
Maybe we can enable NFC and MHL!
What you think about that, people?
SPLESH, we need to enable MHL TV Out not HDMI, no?
We have no HDMI port, we have a micro usb port we could use for MHL hdmi.
http://en.wikipedia.org/wiki/Mobile_High-definition_Link
you can find source code here
https://opensource.samsung.com/index.jsp
search for "i9103"
---------- Post added at 12:10 PM ---------- Previous post was at 12:09 PM ----------
may be we must compare the hardware & source code with s2.
Despite the fact that it can be impossible, I will try to do my best to do it.
There can be no hardware for functionality, what we have, is kernel sources that was made for some internal board in Samsung called "n1" which may has those chips in place, but the production device SGR in real world can be missing those chips (there can be a place for them on printed circuit board or not) so the hope is real, but i will give 30 out 100% for this .
---------- Post added at 01:39 PM ---------- Previous post was at 01:25 PM ----------
jason11 said:
you can find source code here
https://opensource.samsung.com/index.jsp
search for "i9103"
---------- Post added at 12:10 PM ---------- Previous post was at 12:09 PM ----------
may be we must compare the hardware & source code with s2.
Click to expand...
Click to collapse
No I do not think it can help S II is not tegra and has totally different internal layout I only maybe interested in the drivers for the chips but board itself is different (the connections of devices are different and GPIO signals maybe all way around different)
And thanks for the source location but I already been there, how do think I posted parts of it?
SPLESH said:
Despite the fact that it can be impossible, I will try to do my best to do it.
There can be no hardware for functionality, what we have, is kernel sources that was made for some internal board in Samsung called "n1" which may has those chips in place, but the production device SGR in real world can be missing those chips (there can be a place for them on printed circuit board or not) so the hope is real, but i will give 30 out 100% for this .
---------- Post added at 01:39 PM ---------- Previous post was at 01:25 PM ----------
No I do not think it can help S II is not tegra and has totally different internal layout I only maybe interested in the drivers for the chips but board itself is different (the connections of devices are different and GPIO signals maybe all way around different)
And thanks for the source location but I already been there, how do think I posted parts of it?
Click to expand...
Click to collapse
OK. I thought you asked.
When I attempted to build whit MHL I got
Code:
arch/arm/mach-tegra/board-n1.c:1110: error: 'GPIO_MHL_SEL' undeclared here (not in a function)
arch/arm/mach-tegra/board-n1.c:1111: error: 'GPIO_MHL_RST' undeclared here (not in a function)
arch/arm/mach-tegra/board-n1.c:1112: error: 'GPIO_MHL_INT' undeclared here (not in a function)
arch/arm/mach-tegra/board-n1.c:1113: error: 'GPIO_MHL_WAKE_UP' undeclared here (not in a function)
meaning this values are not set in any place
and I can confirm that GPIO pin TEGRA_GPIO_PH2 (which is HDMI enable) is not connected to any MHL transmitter which is seed but reasonable
source file:arch/arm/mach-tegra/gpio.c
Code:
...
/* set NC Pin to input or output when no pull */
{GPIO, TEGRA_GPIO_PD0, GPIO_INPUT, GPIO_LEVEL_LOW, "TEGRA_GPIO_PD0" },
{GPIO, TEGRA_GPIO_PD1, GPIO_INPUT, GPIO_LEVEL_LOW, "TEGRA_GPIO_PD1" },
{GPIO, TEGRA_GPIO_PD3, GPIO_INPUT, GPIO_LEVEL_LOW, "TEGRA_GPIO_PD3" },
{GPIO, TEGRA_GPIO_PD4, GPIO_INPUT, GPIO_LEVEL_LOW, "TEGRA_GPIO_PD4" },
{GPIO, TEGRA_GPIO_PG1, GPIO_INPUT, GPIO_LEVEL_LOW, "TEGRA_GPIO_PG1" },
{GPIO, TEGRA_GPIO_PG2, GPIO_INPUT, GPIO_LEVEL_LOW, "TEGRA_GPIO_PG2" },
{GPIO, TEGRA_GPIO_PH0, GPIO_INPUT, GPIO_LEVEL_LOW, "TEGRA_GPIO_PH0" },
{GPIO, TEGRA_GPIO_PH1, GPIO_INPUT, GPIO_LEVEL_LOW, "TEGRA_GPIO_PH1" },
{GPIO, TEGRA_GPIO_PH2, GPIO_INPUT, GPIO_LEVEL_LOW, "TEGRA_GPIO_PH2" },
{GPIO, TEGRA_GPIO_PJ0, GPIO_OUTPUT, GPIO_LEVEL_LOW, "TEGRA_GPIO_PJ0" },
{GPIO, TEGRA_GPIO_PK3, GPIO_INPUT, GPIO_LEVEL_LOW, "TEGRA_GPIO_PK3" },
{GPIO, TEGRA_GPIO_PL2, GPIO_INPUT, GPIO_LEVEL_LOW, "TEGRA_GPIO_PL2" },
{GPIO, TEGRA_GPIO_PL3, GPIO_INPUT, GPIO_LEVEL_LOW, "TEGRA_GPIO_PL3" },
{GPIO, TEGRA_GPIO_PL4, GPIO_INPUT, GPIO_LEVEL_LOW, "TEGRA_GPIO_PL4" },
{GPIO, TEGRA_GPIO_PN7, GPIO_OUTPUT, GPIO_LEVEL_LOW, "TEGRA_GPIO_PN7" },
{GPIO, TEGRA_GPIO_PR5, GPIO_INPUT, GPIO_LEVEL_LOW, "TEGRA_GPIO_PR5" },
{GPIO, TEGRA_GPIO_PU2, GPIO_INPUT, GPIO_LEVEL_LOW, "TEGRA_GPIO_PU2" },
{GPIO, TEGRA_GPIO_PU3, GPIO_INPUT, GPIO_LEVEL_LOW, "TEGRA_GPIO_PU3" },
{GPIO, TEGRA_GPIO_PV6, GPIO_INPUT, GPIO_LEVEL_LOW, "TEGRA_GPIO_PV6" },
{GPIO, TEGRA_GPIO_PBB0, GPIO_OUTPUT, GPIO_LEVEL_LOW, "TEGRA_GPIO_PBB0" },
...
So there is no MHL in it
What is NFC ??
Nuclear Fission Controls ???
then we will never see mhl. Thats not good =(
s4sixty said:
What is NFC ??
Nuclear Fission Controls ???
Click to expand...
Click to collapse
No it stands for Near Field Communication and, I did compile and pack the kernel (actually same kernel but with enabled PN544) and post it here:
http://forum.xda-developers.com/showthread.php?p=20650649#post20650649
you can check it but i will remind that you will do so on your own risk
---------- Post added at 09:24 PM ---------- Previous post was at 08:35 PM ----------
I now can say that nfc is too not in place so this was good adventure but i think if device is not enabled in config it is probably missing or they use pins for same other things it can have other reasons too like missing firmware for NFC and so on
but at least I did try it out
legion1911 said:
Maybe we can enable NFC and MHL!
Click to expand...
Click to collapse
i have MHL cable for my sgs2 and cable dont work on my I9103
Yes thanks fo checking ;-)
Now i will search on the web for pictures of device pcb before even start this kind of task
By the way good place to look is www.chipworks.com they have many interesting devices but no SGR for now yet
Sent from my GT-I9103 using XDA App
wars045 said:
i have MHL cable for my sgs2 and cable dont work on my I9103
Click to expand...
Click to collapse
I know, I posted that before, this is why we are trying to enable it in software.
We are trying, maybe it will not work, but if we do not try, we will never find out.
Dear Splash,
If you look here:
http://www.nvidia.com/object/tegra-2.html
Nvidia writes about our processor (tegra 2):
"1080p Video Playback Processor — Watch 1080p HD movies stored on your mobile device on your HDTV without compromising battery life."
They are writing "Tegra 2 does MHL".
Related
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
There were AndroShark, tool for capturing traffic on Android. But there were no newer releases and it seems that original developer dropped project. I liked this tool and used it a lot. But it was set to expire... So there was no simple capture tools available... http://forum.xda-developers.com/showthread.php?t=675206 is home of AndroShark.
So I made Shark for Root, alternative for AndroShark. Some people asked for possibility to see packets on phone, and for that purpose SharkReader has created (first, "quick and dirty" release).
Shark for Root
With tcpdump http://swapper.n3o.lv/lv.n3o.shark_1.0.2.apk
Native http://swapper.n3o.lv/lv.n3o.sharknative_1.0.2.apk
SharkReader - unstable...
(note - run Shark Updater to get traffic analysator)
http://swapper.n3o.lv/lv.n3o.sharkreader_0.1.6.apk
Older versions http://swapper.n3o.lv/
EPIC
Thank you!
If you press stop, it doesn't truly stop. tcpdump seems like it is still going in the background. The file will continue getting larger and larger even though it has been told to stop capturing.
Running CyanogenMod 6 RC1.
Thank you.
Far as I can tell it's working good, Thanks for the reader, helps a lot, I can see this program becoming a portable wireshark app for android, keep up the great work and thank you.
Awesome start!! Thanks!
Sent from my Nexus One using XDA App
does this program work with rooted x10? i clcik on start and all i see is "not found".. my parameters are empty is this also correct ?
thanks
cool app! thanks!
duffy1807 said:
does this program work with rooted x10? i clcik on start and all i see is "not found".. my parameters are empty is this also correct ?
thanks
Click to expand...
Click to collapse
Default parameters are -vv -s 0
Can You send me more information about Your error?
Could someone tell about using different parameters or point me to some website where i could study these?(now i got the defaults)
And when i open Shark reader i see many "RAW Packet" but i cant get any information from them, just "Packet #number".
.pcap files are fine when i open them with Wireshark.
At the bottom i see this: -NULL , what else i can use here and how it effects?
Interesting app, keep up the good work!
A changelog would be nice.
I also can not run Shark on my X10. I get the error 'reloc_library [1215]: cannot locate _aeabi_fdiv CANNOT LINK EXECUTABLE
Sent from my X10a using XDA App
acips said:
Could someone tell about using different parameters or point me to some website where i could study these?(now i got the defaults)
And when i open Shark reader i see many "RAW Packet" but i cant get any information from them, just "Packet #number".
.pcap files are fine when i open them with Wireshark.
At the bottom i see this: -NULL , what else i can use here and how it effects?
Interesting app, keep up the good work!
Click to expand...
Click to collapse
Hello!
For Shark for Root parameters look at some examples/manuals about tcpdump. F.e. http://www.cs.ucr.edu/~marios/ethereal-tcpdump.pdf
Shark reader marks packets as RAW if it does not recognize it (currently it means it's not tcp/udp packet).
For filters you can use any tag and any tag with - sign. Tags are those in first column. Traffic is tagged by content (signature) and port. Signatures and ports you may update with Shark Updater (included in Shark Reader), but I have too little time to manage all those resources. I'll make this system public for tags submission/port submission, so interested users will be able to add necessary tags.
So, if you want to see only non zero bytes packets with http content, you may use this setting:
Code:
[ ] all [o] none | http -NULL |
Filters are processed in order. So http shows all http packets and -NULL hides those with nulls. First option works as global filter (show all or show none).
Warning! Not all traffic is tagged, so if you miss something, it could mean some tags are incorrectly assigned or skipped.
Hope it helps.
mcampbellsmith said:
I also can not run Shark on my X10. I get the error 'reloc_library [1215]: cannot locate _aeabi_fdiv CANNOT LINK EXECUTABLE
Sent from my X10a using XDA App
Click to expand...
Click to collapse
Which OS version your X10a have? I saw that there are some problems with reloc_library in Android 1.5.
It's Android 1.6 only on the X10
Sent from my X10a using XDA App
i made an spanish thread on my android site, lets see how it works on milestone
thanks!!!!
Can some please explain in lamon terms what this does?
hy there =) can you make a capture filter to msn conversations ? it would be nice =)
I use an app similar called 3G Watchdog (it's free).
Let's you know how much data you've used with a widget too!
slow4g63 said:
I use an app similar called 3G Watchdog (it's free).
Let's you know how much data you've used with a widget too!
Click to expand...
Click to collapse
LOL this is nothing like that my friend.. nothing at all
ex87,
Awesome work bro, life got too busy for me to work more on AndroShark, I really didn't drop it on purpose. But with a busy life, and me still really new at java, it was just too much. I am really glad you picked up the idea and ran with it.
Do you have any plans to opensource it at all (no worries if you dont)? I would like to be a contributor if you do decide to open source it.
I really doubt this is of any use. It was the second java app I ever worked on, and was really just a front end. Below is androshark source code. Like I said, this was my second attempt at writing an app, so please don't laugh If I were to do it today, I would completely change how it worked. /res/raw/sharktap was just tcpdump.
Code:
import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import android.app.Activity;
import android.app.AlertDialog;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;
/**
* ToDo:
* Check for root
* Check for first run
* Install Binaries on first run
* Check for sdcard mount
* Display file stats
* Name pcap based on file name
* Insert License
* kill sharktap on die
*
* @author jcase
*
*/
public class androshark extends Activity implements /*RadioGroup.OnCheckedChangeListener,*/ Button.OnClickListener {
Button btnStart, btnStop;
RadioButton radAll, rad3g, radWifi; //http://java.dzone.com/articles/google-android-tutorial?page=0,4
RadioGroup grpRadio;
TextView txtStatus, txtFilename, txtFilesize;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
btnStart = (Button)this.findViewById(R.id.btnStart);
btnStart.setOnClickListener(this);
btnStop = (Button)this.findViewById(R.id.btnStop);
btnStop.setOnClickListener(this);
long epoch = System.currentTimeMillis()/1000;
boolean exists = (new File("/data/data/net.andirc.androshark/files/sharktap")).exists();
if (exists) {
} else {
Process myproc = null;
try
{
try{
String strDirectoy ="/data/data/net.andirc.androshark/files";
new File(strDirectoy).mkdir();
}
finally {}
InputStream ins = getResources().openRawResource(R.raw.sharktap);
int size = ins.available();
byte[] buffer = new byte[size];
ins.read(buffer);
ins.close();
FileOutputStream fos = new FileOutputStream("/data/data/net.andirc.androshark/files/sharktap");
fos.write(buffer);
fos.close();
}
catch (Exception ex)
{
Log.e("yourTag", "Oops something happened: " + ex.getMessage(), ex);
}
finally {}
}
boolean exists2 = (new File("/sdcard/androshark/")).exists();
if (exists2) {
} else {
if (android.os.Environment.getExternalStorageState().equals(
android.os.Environment.MEDIA_MOUNTED)) {
Process myproc = null;
try
{
myproc = Runtime.getRuntime().exec(new String[] {"su", "-c","chmod 755 /data/data/net.andirc.androshark/files/sharktap && mkdir /sdcard/androshark/"});
new AlertDialog.Builder(this)
.setMessage("This is a beta trial version of androshark and will expire on May 15th 2010. This app can potentially consume a lot of sdcard space, depending on how long you allow it to sniff traffic and how much bandwidth you are using.")
.setPositiveButton("OK", null)
.show();
}
catch (Exception ex)
{
Log.e("yourTag", "Oops something happened: " + ex.getMessage(), ex);
}
finally {}
} else {
new AlertDialog.Builder(this)
.setMessage("Error sd01: sdCard not found!")
.setPositiveButton("OK", null)
.show();
}
}
if (epoch >= 1273990849) { // May 15th 2010 1273990849
System.exit(0);
}
}
public void onClick(View v) {
Process myproc = null;
try
{
if (v == btnStart) {
if (android.os.Environment.getExternalStorageState().equals(
android.os.Environment.MEDIA_MOUNTED)) {
myproc = Runtime.getRuntime().exec(new String[] {"su", "-c", "kill $(ps | grep sharktap | tr -s ' ' | cut -d ' ' -f2) && /data/data/net.andirc.androshark/files/sharktap -vv -s 0 -w /sdcard/androshark/dump.pcap"});
TextView txtStatus =
(TextView) this.findViewById(R.id.txtStatus);
txtStatus.setText("Status: Running");
TextView txtFilename =
(TextView) this.findViewById(R.id.txtFilename);
txtFilename.setText("Filename: /sdcard/androshark/dump.pcap");
/* int running = 1;
do {
File file = new File("/sdcard/androshark/dump.pcap");
long length = file.length();
TextView txtFilesize =
(TextView) this.findViewById(R.id.txtFilesize);
txtFilesize.setText("File Size: " + length/1024 + "KB");
} while (running <= 1); */
} else {
new AlertDialog.Builder(this)
.setMessage("Error sd02: sdCard not found!")
.setPositiveButton("OK", null)
.show();
}
} else if (v == btnStop) {
myproc = Runtime.getRuntime().exec(new String[] {"su", "-c", "kill $(ps | grep sharktap | tr -s ' ' | cut -d ' ' -f2)"});
myproc.waitFor();
File file = new File("/sdcard/androshark/dump.pcap");
long length = file.length();
TextView txtStatus =
(TextView) this.findViewById(R.id.txtStatus);
txtStatus.setText("Status: Stopped");
TextView txtFilesize =
(TextView) this.findViewById(R.id.txtFilesize);
txtFilesize.setText("File Size: " + length/1024 + "KB");
}
}
catch (Exception ex)
{
Log.e("yourTag", "Oops something happened: " + ex.getMessage(), ex);
}
finally {}
}
}
racemepls said:
Can some please explain in lamon terms what this does?
Click to expand...
Click to collapse
shdwknt said:
LOL this is nothing like that my friend.. nothing at all
Click to expand...
Click to collapse
Apparently you know, and still haven't helped those of us who have no idea what this app is for!
Hi
I work for a company that is in the business of private-security,and recently we decided to test the feasibility of creating a new product line of hand-held personal security recorders that will make use of RGB+IR channels image recording (reproduced from an in-house,custom built back camera based on one of the world's biggest manufacturers of raw cmos imaging sensors fitted with a proprietary bayer filter).
The host device is expected to be based on the ARM architecture and a powerful GPU chip (such as the the Adreno or Power VR latest chips) and although we haven't decided yet of the smart-phone brand that we'll be interested in converting,the model will probably belong to one of the biggest players in the market such as Samsung/HTC/Motorola etc.,and for the obvious reasons...
And here is the question...although we don't see any significant problems with fitting the custom-camera module instead of an original(,non-soldered,ofc...) camera box that comes with the OEM host device while maintaining the same footprint,power & heating envelopes and signaling interfaces (we have some great ASIC engineers here,I fully trust their abilities in that respect ),we're still unsure of our abilities to tweak the ROM of one of today's latest smartphones to include a custom driver (we'll probably hand to one of our affiliate software-house companies to do its coding...for a hefty fee ,not to mention re-writing a camera app,hopefully not from scratch...).
I'd be happy to hear from you,techies of your opinion regarding this project,and considering that some amount of reverse engineering here is a given (right ?),will it be possible to achieve the design goal of the software part of the project in (roughly) 6 months time-frame,and with a budget that should not exceed 250-300 K USD ?
Thanks in advance
David B.
still working on the camera app?
Sure.
Have you looked at other Android applications, which have partially achieved this? They exist.
From the sound of your inventory, you've talented engineers, resources and business sense. Specific issue is to do with variants in hardware and being able to support multiple devices, in most cases not at all 'generic'.
Sony IMX046 found within Xperia X10 models - 8.1MP and the IMX081PQ 16.1MP found in the Arc after debuting as a Cybershot. Both quite different devices, one having double resolution, back lit CMOS sensors and other features, radical enough to place it in a league of it's own. Now try to make that work with a HTC 5MP camera and conjunction it with the front facing camera when video conferencing...
Consider details like pixel arrays, focus, aperture, transistor gates, photo cathodes, anti-reflective coatings, firmware versions, available resolutions (not just desired), operating modes, effects... filters... all different for each device, each manufacturer, each version or release of Android.
To build an database of hardware, sensors, modes, focus sets, image formats, firmware and drivers itself is not hard but is the backbone of what you have in front of you. Provide a platform able to identify the package driver and hardware provider (the right 'glue') itself not overtly difficult or impossible.. perhaps a challenge!
Each driver, device, firmware has significant differences which can not be evaluated on 'one size fits all' method. A highly flexible architecture is required, modular in so far as to analyze and detect variations fail safe, apply the correct logic and driver for base provider as a structured and autonomous instance.
Consider this code from a Gingerbread firmware, designed for a Sony X10. SE will not release Gingerbread (2.3.x) for the X10 as they declared that 2.1 (Eclair) is suitable for the hardware and the software upgrade provides no value.
static const camera_size_type picture_sizes[] = {
{ 3264, 2448 }, // 8MP
{ 2592, 1944 }, // 5MP
{ 2560, 1920 }, // 5MP (reduced)
{ 2048, 1536 }, // 3MP QXGA
{ 1920, 1200 }, // WUXGA
{ 1920, 1080 }, // HD1080 - HDTV
{ 1600, 1200 }, // 2MP UXGA
{ 1680, 1050 }, // WSXGA+
{ 1600, 900 }, // HD+
{ 1440, 900 }, // WSXGA
{ 1280, 768 }, // WXGA
{ 1280, 720 }, // HD720 (HDTV)
{ 1152, 864 }, // XGA+
{ 1024, 768}, // 1MP XGA
{ 800, 600 }, // SVGA
{ 800, 480 }, // WVGA
{ 640, 480 }, // VGA
{ 352, 288 }, // CIF
{ 320, 240 }, // QVGA
{ 176, 144 } // QCIF
};
If you know what you are looking at, you can see some of these resolutions are not supported by the camera and will generate errors in software, leaving unhappy customers! Considering that this is an extract from an active AOSP project to port Gingerbread for the X10, for the love of doing it with no real benefit to the developers involved... it's not bad at all but will become refined into something more like this;
static const camera_size_type picture_sizes[] = {
{ 820, 616 },
{ 3280, 616 },
{ 3280, 2464 },
};
Reason the camera itself only supports 3 possible modes and these have to be defined exactly in the right way for it to work, for a single device and a single pixel out will error, even the order of the driver.. notice bold emphasis on resolution.
0.5Mp - 4X Horiz & Vert. | 2Mp - 4X Vertical Elim. | 8MP - Full Resolution​
Saying it simply, it's not impossible but it's not easy!
Well, now that I have your attention, my REAL question is this: Is there a way to make apps like the Amazon marketplace think they're on wifi so I don't get that stupid "you can't download this because it's too big for a cellular network"?
***** please, I pay for unlimited data and I plan to use it.
Sent from my Droid Charge running Infinity Beta
HAHAHA I like your tactics for getting attention.
A while back I made a remark that the only way to get peoples attention in these forums is to ask if CM7 is coming out in the title and then ask the real question in the body.
Well played
Also no, there's no way to trick Amazon
I've actually been working on figuring out a way to do this.
Any app that tries to figure out how it's connected queries the same class in the system called NetworkInfo.class.
There are two methods within NetworkInfo.class that report the network type: getType() and getTypeName(). getType() returns a machine-readable answer, while getTypeName() is human-readable.
Code:
public int getType() {
return mNetworkType;
}
Code:
public String getTypeName() {
switch (mNetworkType) {
case ConnectivityManager.TYPE_WIFI:
return "WIFI";
case ConnectivityManager.TYPE_MOBILE:
return "MOBILE";
default:
return "<invalid>";
}
}
I haven't had the resources (primarily time) to dig that far into things, but if we could figure out a way to inject something between Amazon and the getType() or getTypeName() calls, we could report to it that we're on WiFi regardless of how we're actually connected.
AlexDeGruven said:
I've actually been working on figuring out a way to do this.
Any app that tries to figure out how it's connected queries the same class in the system called NetworkInfo.class.
There are two methods within NetworkInfo.class that report the network type: getType() and getTypeName(). getType() returns a machine-readable answer, while getTypeName() is human-readable.
Code:
public int getType() {
return mNetworkType;
}
Code:
public String getTypeName() {
switch (mNetworkType) {
case ConnectivityManager.TYPE_WIFI:
return "WIFI";
case ConnectivityManager.TYPE_MOBILE:
return "MOBILE";
default:
return "";
}
}
I haven't had the resources (primarily time) to dig that far into things, but if we could figure out a way to inject something between Amazon and the getType() or getTypeName() calls, we could report to it that we're on WiFi regardless of how we're actually connected.
Click to expand...
Click to collapse
Wow, Computer Science II is actually helping me be able to read this. So, what type of object is mNetworkType and where is it defined? We could get it to just return that its on wifi all the time. Also, do you know what Amazon calls? GetType or GetTypeName?
Sent from my Droid Charge running Infinity Beta
Lol. Nicely done with the thread title.
Sent from my mobile office.
AlexDeGruven said:
I've actually been working on figuring out a way to do this.
Any app that tries to figure out how it's connected queries the same class in the system called NetworkInfo.class.
There are two methods within NetworkInfo.class that report the network type: getType() and getTypeName(). getType() returns a machine-readable answer, while getTypeName() is human-readable.
Code:
public int getType() {
return mNetworkType;
}
Code:
public String getTypeName() {
switch (mNetworkType) {
case ConnectivityManager.TYPE_WIFI:
return "WIFI";
case ConnectivityManager.TYPE_MOBILE:
return "MOBILE";
default:
return "<invalid>";
}
}
I haven't had the resources (primarily time) to dig that far into things, but if we could figure out a way to inject something between Amazon and the getType() or getTypeName() calls, we could report to it that we're on WiFi regardless of how we're actually connected.
Click to expand...
Click to collapse
kvswim said:
Wow, Computer Science II is actually helping me be able to read this. So, what type of object is mNetworkType and where is it defined? We could get it to just return that its on wifi all the time. Also, do you know what Amazon calls? GetType or GetTypeName?
Sent from my Droid Charge running Infinity Beta
Click to expand...
Click to collapse
Interesting stuff. There's an iPhone app for jailbroken phones that performs this function on an app-by-app basis. With this code identified, something similar might be possible on Android. I haven't done any Android dev yet, so I don't know how much help I might be. Is there a way to easily (and cheaply) intercept method calls on Android? If so, there might be a way to intercept the getType and getTypeName calls and then modify them on a case-by-case basis so that the call can be diverted to a different function. I'm talking completely theoretical here...I don't know what is offered by the Android SDK.
shrike1978 said:
Interesting stuff. There's an iPhone app for jailbroken phones that performs this function on an app-by-app basis. With this code identified, something similar might be possible on Android. I haven't done any Android dev yet, so I don't know how much help I might be. Is there a way to easily (and cheaply) intercept method calls on Android? If so, there might be a way to intercept the getType and getTypeName calls and then modify them on a case-by-case basis so that the call can be diverted to a different function. I'm talking completely theoretical here...I don't know what is offered by the Android SDK.
Click to expand...
Click to collapse
That was exactly where my investigation has hit the wall at the moment (and then I got busy finishing my basement).
There are a couple of ways to do it, really. Someone could modify the appstore apk to wrap any calls to getType() and getTypeName(), but that would only be on that particular apk. IIRC, the market does it for large apk downloads as well.
Other apps also look at what your network type is.
I'd love to have something that allows me to toggle what the applications see, regardless of the actual state (I'm thinking of things like Verizon's Skype, etc).
The problem with all of this is that NetworkInfo.class is deep in the core OS, so intercepting any calls to it's methods might be rather difficult at best.
Edit: Also - Can we change the thread title now that we know what it's really all about?
ROTFLMFAO! Awesome thread title!
Sent from my SCH-I510 using xda premium
rofl you got me!!! hahahaha... and to answer your question I don't think there is but it'd be nice to know for sure
blazing through on my 4G Droid Charge
In the Amazon Appstore apk, com.amazon.mas.client.framework.net contains a class called NetworkStateManager whose source is:
Code:
package com.amazon.mas.client.framework.net;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.wifi.WifiManager;
import android.net.wifi.WifiManager.WifiLock;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
public class NetworkStateManager
{
private static final int DELAY_DROP_DETECTION = 5000;
private static final String TAG = "NetworkStateManager";
private static final Map<String, WifiManager.WifiLock> wifiLocks = new ConcurrentHashMap();
private final ConnectivityManager connectivityManager;
private final WeakReference<Context> context;
private final Handler delayHandler;
private final List<NetworkStateListener> listeners = new ArrayList();
private boolean networkDropDetected = false;
private NetworkStateReceiver receiver = null;
private boolean wasConnected = false;
private final WifiManager wifiManager;
public NetworkStateManager(Context paramContext)
{
this.context = new WeakReference(paramContext);
this.wifiManager = ((WifiManager)paramContext.getSystemService("wifi"));
this.connectivityManager = ((ConnectivityManager)paramContext.getSystemService("connectivity"));
this.delayHandler = new NetworkStateHandler(null);
if (isNetworkConnected());
for (boolean bool = false; ; bool = true)
{
this.networkDropDetected = bool;
return;
}
}
private WifiManager.WifiLock getWifiLock(String paramString)
{
if (wifiLocks.containsKey(paramString));
for (WifiManager.WifiLock localWifiLock = (WifiManager.WifiLock)wifiLocks.get(paramString); ; localWifiLock = this.wifiManager.createWifiLock(paramString))
return localWifiLock;
}
public boolean acquireWifiLock(String paramString)
{
WifiManager.WifiLock localWifiLock = getWifiLock(paramString);
if (localWifiLock.isHeld())
Log.w("NetworkStateManager", "Wifi lock identified by " + paramString + " already acquired");
for (int i = 0; ; i = 1)
{
return i;
localWifiLock.acquire();
wifiLocks.put(paramString, localWifiLock);
}
}
public void addListener(NetworkStateListener paramNetworkStateListener)
{
if (!this.listeners.contains(paramNetworkStateListener))
this.listeners.add(paramNetworkStateListener);
}
public void clearListeners()
{
this.listeners.clear();
}
public boolean isNetworkConnected()
{
NetworkInfo localNetworkInfo = this.connectivityManager.getActiveNetworkInfo();
if ((localNetworkInfo == null) || (!localNetworkInfo.isConnected()));
for (int i = 0; ; i = 1)
return i;
}
public boolean isNetworkWifi()
{
return this.connectivityManager.getNetworkInfo(1).isConnected();
}
public boolean isWifiLockAcquired(String paramString)
{
WifiManager.WifiLock localWifiLock = getWifiLock(paramString);
if ((localWifiLock != null) && (localWifiLock.isHeld()));
for (int i = 1; ; i = 0)
return i;
}
public void releaseWifiLock(String paramString)
{
WifiManager.WifiLock localWifiLock = getWifiLock(paramString);
if (localWifiLock.isHeld())
{
localWifiLock.release();
if (wifiLocks.containsKey(paramString))
wifiLocks.remove(paramString);
}
while (true)
{
return;
Log.w("NetworkStateManager", "Wifi lock identified by " + paramString + " is not acquired");
}
}
public void removeListener(NetworkStateListener paramNetworkStateListener)
{
this.listeners.remove(paramNetworkStateListener);
}
public void startListening()
{
Context localContext = (Context)this.context.get();
if (this.receiver != null)
Log.w("NetworkStateManager", "Already listening, duplicate call to NetworkStateManager#startListening");
while (true)
{
return;
if (localContext == null)
{
Log.w("NetworkStateManager", "Call to NetworkStateManager#startListening on null context");
continue;
}
this.wasConnected = isNetworkConnected();
IntentFilter localIntentFilter = new IntentFilter("android.net.conn.CONNECTIVITY_CHANGE");
this.receiver = new NetworkStateReceiver(null);
localContext.registerReceiver(this.receiver, localIntentFilter);
}
}
public void stopListening()
{
Context localContext = (Context)this.context.get();
if (this.receiver == null)
Log.w("NetworkStateManager", "Not listening, invalid call to NetworkStateManager#stopListening");
while (true)
{
return;
if (localContext == null)
{
Log.w("NetworkStateManager", "Call to NetworkStateManager#stopListening on null context");
continue;
}
localContext.unregisterReceiver(this.receiver);
this.receiver = null;
this.delayHandler.removeMessages(65536);
}
}
private class NetworkStateHandler extends Handler
{
public static final int MSG_NETWORK_DROP = 65536;
private NetworkStateHandler()
{
}
public void handleMessage(Message paramMessage)
{
switch (paramMessage.what)
{
default:
super.handleMessage(paramMessage);
case 65536:
}
while (true)
{
return;
NetworkStateManager.this.wasConnected = false;
NetworkStateManager.this.networkDropDetected = true;
Iterator localIterator = NetworkStateManager.this.listeners.iterator();
while (localIterator.hasNext())
((NetworkStateManager.NetworkStateListener)localIterator.next()).onConnectivityLost();
}
}
}
public static abstract interface NetworkStateListener
{
public abstract void onConnectivityLost();
public abstract void onConnectivityRestored();
}
private class NetworkStateReceiver extends BroadcastReceiver
{
private NetworkStateReceiver()
{
}
public void onReceive(Context paramContext, Intent paramIntent)
{
if ((paramContext == null) || (paramIntent == null) || (!"android.net.conn.CONNECTIVITY_CHANGE".equals(paramIntent.getAction())));
while (true)
{
return;
if (NetworkStateManager.this.isNetworkConnected());
for (int i = 0; ; i = 1)
{
boolean bool = paramIntent.getBooleanExtra("isFailover", false);
if ((i == 0) || (bool) || (!NetworkStateManager.this.wasConnected))
break label99;
Message localMessage = NetworkStateManager.this.delayHandler.obtainMessage(65536);
NetworkStateManager.this.delayHandler.sendMessageDelayed(localMessage, 5000L);
break;
}
label99: if (i != 0)
continue;
if (NetworkStateManager.this.delayHandler.hasMessages(65536))
NetworkStateManager.this.delayHandler.removeMessages(65536);
if (!NetworkStateManager.this.networkDropDetected)
continue;
NetworkStateManager.this.wasConnected = true;
Iterator localIterator = NetworkStateManager.this.listeners.iterator();
while (localIterator.hasNext())
((NetworkStateManager.NetworkStateListener)localIterator.next()).onConnectivityRestored();
}
}
}
}
I'm guessing that making isNetworkWifi() return true would allow for downloads of large files over the cell network. I might repack the APK and post it here if I find the time.
All right, I decompiled the dex file into smali class files, made the change, recompiled, and produced an APK that does not have the wifi restriction, but I'm having problems with signing. I ran a signing tool on the APK, but even after that my phone still fails to install the app (I do have the previous version of the app uninstalled). Has anyone else had experience with this?
substanceD said:
All right, I decompiled the dex file into smali class files, made the change, recompiled, and produced an APK that does not have the wifi restriction, but I'm having problems with signing. I ran a signing tool on the APK, but even after that my phone still fails to install the app (I do have the previous version of the app uninstalled). Has anyone else had experience with this?
Click to expand...
Click to collapse
Care to post it?
Sent from my Droid Charge running Infinity Beta
kvswim said:
Care to post it?
Sent from my Droid Charge running Infinity Beta
Click to expand...
Click to collapse
Yeah, sure. (For anyone else attempting to download this, it will not install in its current form).
Anyone have any luck with the signing?
AlexDeGruven said:
Anyone have any luck with the signing?
Click to expand...
Click to collapse
I'm having troubles too. Is there any way to bypass the sign check? I assume its similar to a CRC or MD5 check.
EDIT: http://developer.android.com/guide/publishing/app-signing.html
What if you saved & signed as a different app name?
Sent from my Droid Charge running Infinity Beta
Bumping
Sent from my Droid Charge running Infinity Beta
Just had an idea. What if we packed it into a ROM as a system APK?
Sent from my Droid Charge running Infinity Beta
Screw CM7. Why was CM8 skipped?! >:[
Sent from my SCH-I510 using xda premium
DirgeExtinction said:
Screw CM7. Why was CM8 skipped?! >:[
Sent from my SCH-I510 using xda premium
Click to expand...
Click to collapse
Great job reading the thread and making a relevant comment.
Aside from that: CM8 would be Honeycomb-based if it were to ever be made, which is unlikely, since it's the one version of Android that's closed-source. ICS will give rise to CM9
AlexDeGruven said:
Great job reading the thread and making a relevant comment.
Aside from that: CM8 would be Honeycomb-based if it were to ever be made, which is unlikely, since it's the one version of Android that's closed-source. ICS will give rise to CM9
Click to expand...
Click to collapse
Why, thank you.
I was bored and just posted that. I knew this thread was about the Amazon appstore(had read some posts from the first page a few days ago).
Sent from my SCH-I510 using xda premium
Hi ive written a simple application for windows phone 7 that posts a status update to the users wall. This is all working correctly except for the fact that when the status update is done it is always empty. I am trying to make it so that the user can enter what they would like to say in a text box, but obviously so far this isnt working and all that is being sent is an empty status update. I am connecting to the facebook api and the authentication all works correctly or the post would not be sent at all. Ive searched all over the web and havent found anyone with the same issue as of yet.
Here is the status update code that I am working on:
Code:
private void PostStatusUpdate(string status, Action<bool, Exception> callback)
{
var request = HttpWebRequest.Create("https://graph.facebook.com/me/feed");
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
request.BeginGetRequestStream((reqResult) =>
{
using (var strm = request.EndGetRequestStream(reqResult))
using (var writer = new StreamWriter(strm))
{
writer.Write("access_token=" + _accessToken);
writer.Write("&message=" + HttpUtility.UrlEncode(status));
}
request.BeginGetResponse((result) =>
{
try
{
var response = request.EndGetResponse(result);
using (var rstrm = response.GetResponseStream())
{
var serializer = new DataContractJsonSerializer(typeof(FacebookPostResponse));
var postResponse = serializer.ReadObject(rstrm) as FacebookPostResponse;
callback(true, null);
}
}
catch (Exception ex)
{
callback(false, ex);
}
}, null);
}, null);
}
[DataContract]
public class FacebookPostResponse
{
[DataMember(Name = "id")]
public string Id
{
get;
set;
}
}
private void PostUpdate_Click(object sender, RoutedEventArgs e)
{
PostStatusUpdate(this.StatusText.Text, (success, ex) =>
{
this.Dispatcher.BeginInvoke(() =>
{
if (success && ex == null)
{
MessageBox.Show("Status updated");
NavigationService.Navigate(new Uri("/Views/MainPage.xaml", UriKind.Relative));
}
else
{
MessageBox.Show("Unable to update status");
}
});
});
}
Has anyone encountered this before / know any solution to this problem?
Any insights into this would be much appreciated
You are using the asyncronous method with no callback function
Looks like you should be using a callback function - See examples here
http://msdn.microsoft.com/en-us/lib...est.begingetrequeststream(v=vs.90).aspx#Y1760
http://msdn.microsoft.com/en-us/lib...brequest.begingetrequeststream(v=vs.100).aspx
Also, did the same code work at one point?
It could be as simple as not closing your connections. I ran into this in the Weather City Editor that I wrote for Windows Mobile.
When I added code to hit accuweathers site to look up the code, I had forgotten to close the connection. I would need to wait until the connection timed out before it would work again.
I think yours is differnt though, since it is updating blank.
But, you could just use GetRequestStream, which does not need the callback function, synce it is not asyncronous. See example code: http://msdn.microsoft.com/en-us/library/d4cek6cc.aspx
Thanks for the reply
Thanks for the reply, the code has never worked so far it has only posted blank facebook statuses, I will see if adding an asynchronous call back makes a difference.
Thanks