Re: [android-developers] Seekbar Save state and restore

2013-07-11 Thread TreKing
On Thu, Jul 11, 2013 at 9:14 PM, Keith Zettler wrote:

> How exactly can i save/restore this seekbar if user uses back button or
> activity is destyroyed?


1 - Your code shows two seekbars so referring to "this seekbar" is
ambiguous.
2 - A seekbar, being a built-in widget, should save and restore itself.
3 - Your code does not demonstrate anything that needs saving.


-
TreKing  - Chicago
transit tracking app for Android-powered devices

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Looking for Android developer

2013-07-11 Thread Ali S. Rangwala
Hello All,

We are looking for Android developer to work with us. Interested members
can forward us your brief profile and links on Google play for review.

This is consultant based role to start with (project wise work allocation)
and eventually grow into permanent role.

Regards,
Ali

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Seekbar Save state and restore

2013-07-11 Thread Keith Zettler
How exactly can i save/restore this seekbar if user uses back button or 
activity is destyroyed?
I have not been able to find a specific example anywhere


public class MainActivity extends Activity  implements 
SeekBar.OnSeekBarChangeListener {

SeekBar seekBar;
SeekBar seekBar1;
TextView textView;
TextView textView1;
TextView textView2;
TextView textView3;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

seekBar=(SeekBar)findViewById(R.id.seekbar);
seekBar1=(SeekBar)findViewById(R.id.seekBar1);
textView=(TextView)findViewById(R.id.textview);
textView1=(TextView)findViewById(R.id.textView1);
textView2=(TextView)findViewById(R.id.textView2);
textView3=(TextView)findViewById(R.id.textView3);
   
   

seekBar.setOnSeekBarChangeListener(this);

}

@Override
public void onProgressChanged(SeekBar seekBar, int progress,
boolean fromUser) {
//  Notify that the progress level has changed.

int A= (progress+250);
textView.setText("SeekBar now at the value of:"+progress);
textView1.setText("SeekBar now at the value of:"+A);


}

@Override
public void onStartTrackingTouch(SeekBar seekBar) {
// Notify that the user has started a touch gesture.
//textView.setText(textView.getText()+"\n"+"SeekBar Touch Started");

}

@Override
public void onStopTrackingTouch(SeekBar seekBar) {
// Notify that the user has finished a touch gesture.
   // textView.setText(textView.getText()+"\n"+"SeekBar Touch 
Stopped");   
}




@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is 
present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}


}

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Parsing + Modifying resource.arsc programmatically [ without apktool ]

2013-07-11 Thread Nikolay Elenkov
On Fri, Jul 12, 2013 at 8:35 AM, giles ian  wrote:
> Hello All,
>
> I need to parse and make changes in resource.arsc programmatically without
> the help of apktool.
>
> Something like http://stackoverflow.com/a/4761689, but this is for android
> manifest.
>
> And the structure of manifest and resource.arsc is different so the above
> link wont work.
>
> Does anyone know structure of resource.arsc completely
>

Both apktool and Android tools (aapt, etc.) are open source, so...

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Parsing + Modifying resource.arsc programmatically [ without apktool ]

2013-07-11 Thread giles ian
Hello All,

I need to parse and make changes in resource.arsc programmatically without
the help of apktool.

Something like http://stackoverflow.com/a/4761689, but this is for android
manifest.

And the structure of manifest and resource.arsc is different so the above
link wont work.

Does anyone know structure of resource.arsc completely

Thanks,

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] How can I get the reference to the top (or second top, or any one in the task) activity object

2013-07-11 Thread TreKing
On Wed, Jul 10, 2013 at 11:01 PM, Linda Li wrote:

> It is not clean. Actually I can make relaunching the app by starting with
> Login page. However, when we press back, there is Gallery. It is not clean
> at all.


I have no idea what you mean by it not being "clean".

-
TreKing  - Chicago
transit tracking app for Android-powered devices

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Re: creating apk according to selected java files

2013-07-11 Thread Lew
Look at the Ant documentation for the "javac" task and file lists.

RTFM is often the best way to go.

-- 
Lew

On Tuesday, July 2, 2013 4:13:34 AM UTC-7, surabhi jain wrote:
>
> Thanks for reply.
>
> I am sure that there is no dependency of remaining classes. But exactly I 
> am not getting that How could  we build project using Ant including 
> selected java classes?
>
>
> On Wed, Jun 19, 2013 at 3:24 AM, Lew >wrote:
>
>> And bear in mind that transitive dependencies might require use of those 
>> classes anyway.
>>
>> How come your files need to be excluded from the build yet exist in the 
>> source tree?
>>
>> What advantage do you imagine exclusion of those files will confer?
>>
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] How i can programatically downlaod our emails from gmail account ?

2013-07-11 Thread Lew
Ashish Sharma wrote:

> java [sic] mail api is working fine for gmail account. can you please 
> guide, how to use it for exchange server?
>
>>  
http://lmgtfy.com/?q=Java+Mail+API+connect+to+exchange+server

-- 
Lew

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Re: Modifying an String of Android Resource File (*.arsc)

2013-07-11 Thread Yaron Reinharts

As far as I know the apktool can be ported but I haven't tried it myself.
Let us know :)
/Yaron
On 07/11/2013 08:30 PM, giles ian wrote:
Thanks Yaron, but my requirement is parsing and modifying arsc file at 
runtime on the device.


So my next question is can apktool be ported on device. What I mean is 
since the source code is available are there any lib/frameworks (that 
apktool) which are only available for desktop and not for android.



On Thu, Jul 11, 2013 at 8:13 AM, Yaron Reinharts 
mailto:yaron.reinha...@gmail.com>> wrote:


No need to reinvent the wheel:
https://code.google.com/p/android-apktool/

Hope this helps
Yaron

On 07/11/2013 02:13 AM, giles ian wrote:

Hi Illyoung Choi,
*
*
*Is it possible for you to share the code for the entire thing.
i.e. *
*
*
*1.Parsing*
*2. Modifying
*
On Tuesday, June 21, 2011 8:09:12 PM UTC-7, Illyoung Choi wrote:

Hi All.

Last day, I made a simple application for parsing an Android
Resource
File (*.arsc) and modifying resource strings.

I think this thing might be a help for someone, so I'll share
the
structure of *.arsc that I understood.

Since I could not spend many hours for this, my understanding
is not
perfect and might be slightly wrong.


I patched string resource from *.apk.
Simply extracted *.apk with 7zip and got the resources.arsc
file.

Below are the structure of *.arsc

struct ANDROID_RESOURCE_HEADER
{
int signature; // 0x000c0002, I assume this is a signature
int nImageLength; // total ARSC file size (bytes)
int nUnknown1[2]; // still unknown (not important for modifying
strings)
int nStringBlockLength; // total StringBlock(see below) size
int nStringCount; // total number of String Resources
int nUnknown2[4]; // still unknown  (not important for modifying
strings)
}

"struct ANDROID_RESOURCE_HEADER" is a header of ARSC file image.
So simply you can read this header information from file.

After this header, you will meet the StringBlock

StringBlock has 2Sections
{
[String Offset]
[String Data]
}

String Offset Section has Offset Values of Specific Strings from
StringBlock Start Address.

String Data Section has 2 Part

String Data
{
[Length]
[String]
}

Length part is 2byte. but, in AscII Mode, uses only 1byte.
Before reading String, you must check whether it is "Unicode" or
"AscII" format.

in Unicode format, Length part will be used with 2bytes.
normally it is "0x??, 0x00" (only if it is not longer than
256 bytes)

in AscII format, Length part will be used with 1bytes. but,
they also
used second byte for mirroring.
if string length has a value 7, you will meet "0x07, 0x07"

So, I checked whether both bytes have same value to check string
format.


Lastly, actual string data will be after this length part
with "Zero
Terminal"
in Unicode format, surely, Zero Terminal will be 2 byte of zero.



Whenever you change the string of this ARSC file, you should
recalculate these.
Length Part of String Data
String Offset of StringBlock
nImageLength of Header
nStringBlockLength of Header


After doing these all.
Simply, remove all JAR Signature (META-INF folder) from package.
Re-Archive with Zip and rename with *.apk.
Resign with your certificate by using "jarsigner" of JDK



Thanks.

-- 
-- 
You received this message because you are subscribed to the Google

Groups "Android Developers" group.
To post to this group, send email to
android-developers@googlegroups.com

To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com

For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the
Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it,
send an email to android-developers+unsubscr...@googlegroups.com
.
For more options, visit https://groups.google.com/groups/opt_out.





-- 
Yaron Reinharts

Smart Drive Applications
http://www.poncho.co.il/gateaway.php
https://market.android.com/details?id=com.poncho.gsm.gate.activities


-- 
-- 
You received this message because you are subscribed to the Google

Groups "And

[android-developers] Helicopter view inside an app (think thumbnails of Activities)

2013-07-11 Thread darrinps
Want to have a helicopter view of other Activities so that the user can 
click on one of the "thumbnails" and be sent to that Activity as it looks 
in the thumbnail.

This will mean pre-rendering each Activity then storing what they look like 
off someway then adding those images to some sort of display that will 
allow the image to be clicked and then the Activity to which it is tied be 
called.

Has can something like this be done?

Thanks!

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Re: Modifying an String of Android Resource File (*.arsc)

2013-07-11 Thread giles ian
Thanks Yaron, but my requirement is parsing and modifying arsc file at
runtime on the device.

So my next question is can apktool be ported on device. What I mean is
since the source code is available are there any lib/frameworks (that
apktool) which are only available for desktop and not for android.


On Thu, Jul 11, 2013 at 8:13 AM, Yaron Reinharts
wrote:

>  No need to reinvent the wheel:
> https://code.google.com/p/android-apktool/
>
> Hope this helps
> Yaron
>
> On 07/11/2013 02:13 AM, giles ian wrote:
>
> Hi Illyoung Choi,
> *
> *
> *Is it possible for you to share the code for the entire thing. i.e. *
> *
> *
> *1.Parsing*
> *2. Modifying
> *
> On Tuesday, June 21, 2011 8:09:12 PM UTC-7, Illyoung Choi wrote:
>>
>> Hi All.
>>
>> Last day, I made a simple application for parsing an Android Resource
>> File (*.arsc) and modifying resource strings.
>>
>> I think this thing might be a help for someone, so I'll share the
>> structure of *.arsc that I understood.
>>
>> Since I could not spend many hours for this, my understanding is not
>> perfect and might be slightly wrong.
>>
>>
>> I patched string resource from *.apk.
>> Simply extracted *.apk with 7zip and got the resources.arsc file.
>>
>> Below are the structure of *.arsc
>>
>> struct ANDROID_RESOURCE_HEADER
>> {
>> int signature; // 0x000c0002, I assume this is a signature
>> int nImageLength; // total ARSC file size (bytes)
>> int nUnknown1[2]; // still unknown (not important for modifying
>> strings)
>> int nStringBlockLength; // total StringBlock(see below) size
>> int nStringCount; // total number of String Resources
>> int nUnknown2[4]; // still unknown  (not important for modifying
>> strings)
>> }
>>
>> "struct ANDROID_RESOURCE_HEADER" is a header of ARSC file image.
>> So simply you can read this header information from file.
>>
>> After this header, you will meet the StringBlock
>>
>> StringBlock has 2Sections
>> {
>> [String Offset]
>> [String Data]
>> }
>>
>> String Offset Section has Offset Values of Specific Strings from
>> StringBlock Start Address.
>>
>> String Data Section has 2 Part
>>
>> String Data
>> {
>> [Length]
>> [String]
>> }
>>
>> Length part is 2byte. but, in AscII Mode, uses only 1byte.
>> Before reading String, you must check whether it is "Unicode" or
>> "AscII" format.
>>
>> in Unicode format, Length part will be used with 2bytes.
>> normally it is "0x??, 0x00" (only if it is not longer than 256 bytes)
>>
>> in AscII format, Length part will be used with 1bytes. but, they also
>> used second byte for mirroring.
>> if string length has a value 7, you will meet "0x07, 0x07"
>>
>> So, I checked whether both bytes have same value to check string
>> format.
>>
>>
>> Lastly, actual string data will be after this length part with "Zero
>> Terminal"
>> in Unicode format, surely, Zero Terminal will be 2 byte of zero.
>>
>>
>>
>> Whenever you change the string of this ARSC file, you should
>> recalculate these.
>> Length Part of String Data
>> String Offset of StringBlock
>> nImageLength of Header
>> nStringBlockLength of Header
>>
>>
>> After doing these all.
>> Simply, remove all JAR Signature (META-INF folder) from package.
>> Re-Archive with Zip and rename with *.apk.
>> Resign with your certificate by using "jarsigner" of JDK
>>
>>
>>
>> Thanks.
>
>  --
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Android Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to android-developers+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
>
>
> --
> Yaron Reinharts
> Smart Drive 
> Applicationshttp://www.poncho.co.il/gateaway.phphttps://market.android.com/details?id=com.poncho.gsm.gate.activities
>
>   --
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Android Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to android-developers+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to t

Re: [android-developers] Re: can _ever_ the intent received by a BroadcastReceiver onReceive() method be null?

2013-07-11 Thread Palmer Eldritch
a this is a step to the right direction ;)
notice they don't check for null

now any places the  ReceiverData object is initialized ?

btw search in grepcode Sucks big time ! could you in the name of Mordor 
tell me what I should make out from here : 
http://grepcode.com/search?query=ReceiverData&n=

compare : 
http://androidxref.com/4.2.2_r1/search?q=ReceiverData&defs=&refs=&path=&hist=&project=abi&project=bionic&project=bootable&project=build&project=cts&project=dalvik&project=development&project=device&project=docs&project=external&project=frameworks&project=gdk&project=hardware&project=libcore&project=libnativehelper&project=ndk&project=packages&project=pdk&project=prebuilts&project=sdk&project=system

In froyo the intent is just passed in :

http://androidxref.com/2.2.3/xref/frameworks/base/core/java/android/app/ActivityThread.java#1563

In 4.2.2 we have the same in a constructor : 
http://androidxref.com/4.2.2_r1/xref/frameworks/base/core/java/android/app/ActivityThread.java#648

Now scheduleReceiver we have in ApplicationThreadNative : 
http://androidxref.com/4.2.2_r1/xref/frameworks/base/core/java/android/app/ApplicationThreadNative.java#758
 and in ActivityThread : 
http://androidxref.com/4.2.2_r1/xref/frameworks/base/core/java/android/app/ActivityThread.java#645

What's the difference ?

Anyway in ApplicationThreadNative it is called here 
http://androidxref.com/4.2.2_r1/xref/frameworks/base/core/java/android/app/ApplicationThreadNative.java#197
 
and it is passed an intent from : 

http://androidxref.com/4.2.2_r1/xref/frameworks/base/core/java/android/app/ApplicationThreadNative.java#189

So Intent intent = Intent.CREATOR.createFromParcel(data);

but this is where I give up - where is this "data" (a Parcel instance) 
created ?






On Thursday, July 11, 2013 5:54:07 PM UTC+3, Piren wrote:
>
> i'm pretty sure it's impossible to guarantee something like that... i 
> don't think part of their new programmer orientation is "if you ever touch 
> the code that runs BroadcastReceiver.onReceive...never send a null intent".
>
> Either way, at least on android 4.2.2_r1, it seems like it's impossible to 
> get a null intent. feel free to verify this is true for all previous 
> versions as well (and don't forget to keep checking this method every time 
> they make a new build).
>
> http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.2.2_r1/android/app/ActivityThread.java#2335
>
>
> On Thursday, July 11, 2013 4:09:27 PM UTC+3, Palmer Eldritch wrote:
>>
>> That's nice advice - but in this case I think one should have a guarantee
>>
>> Does it make sense to receive a null intent ? Is it even possible with 
>> the current android code ?
>>
>> On Thursday, July 11, 2013 9:46:00 AM UTC+3, Piren wrote:
>>>
>>> No point of being sure here... even if the current code is structured in 
>>> a way that it shouldn't be null, nothing says it will stay like that in all 
>>> future code revisions.
>>> Ever since i started getting null exceptions from android (not 
>>> NullPointerException... a Null instead of an exception) i learned it's 
>>> always a good idea to check for nulls when you're supposed to receive an 
>>> object.
>>>
>>> On Thursday, July 11, 2013 6:01:13 AM UTC+3, Palmer Eldritch wrote:

 I suspect it can't be null *by construction* - I just can't pin it 
 down in code (or in docs)

 It's nice to be sure

 Can somebody point to the relevant code parts ?

 I mean what paths lead to the onReceive being triggered ? Can we have a 
 null intent in any of them ?

 On Thursday, July 11, 2013 4:18:09 AM UTC+3, TreKing wrote:
>
>
> On Wed, Jul 10, 2013 at 4:14 PM, Palmer Eldritch wrote:
>
>> I mean nobody knows ??
>>
>> Do you ever check the intent for being null and if not why ?
>>
>
> Here's what you do. Assume it will not be null, then use ACRA or some 
> other bug-reporting tool to handle uncaught exceptions. If you get a null 
> pointer exception from here, you know it can be null.
>
> You're welcome.
>
>
> -
> TreKing  - 
> Chicago transit tracking app for Android-powered devices
>  


-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more option

Re: [android-developers] Re: Modifying an String of Android Resource File (*.arsc)

2013-07-11 Thread Yaron Reinharts

No need to reinvent the wheel:
https://code.google.com/p/android-apktool/

Hope this helps
Yaron
On 07/11/2013 02:13 AM, giles ian wrote:

Hi Illyoung Choi,
*
*
*Is it possible for you to share the code for the entire thing. i.e. *
*
*
*1.Parsing*
*2. Modifying
*
On Tuesday, June 21, 2011 8:09:12 PM UTC-7, Illyoung Choi wrote:

Hi All.

Last day, I made a simple application for parsing an Android Resource
File (*.arsc) and modifying resource strings.

I think this thing might be a help for someone, so I'll share the
structure of *.arsc that I understood.

Since I could not spend many hours for this, my understanding is not
perfect and might be slightly wrong.


I patched string resource from *.apk.
Simply extracted *.apk with 7zip and got the resources.arsc file.

Below are the structure of *.arsc

struct ANDROID_RESOURCE_HEADER
{
int signature; // 0x000c0002, I assume this is a signature
int nImageLength; // total ARSC file size (bytes)
int nUnknown1[2]; // still unknown (not important for modifying
strings)
int nStringBlockLength; // total StringBlock(see below) size
int nStringCount; // total number of String Resources
int nUnknown2[4]; // still unknown  (not important for modifying
strings)
}

"struct ANDROID_RESOURCE_HEADER" is a header of ARSC file image.
So simply you can read this header information from file.

After this header, you will meet the StringBlock

StringBlock has 2Sections
{
[String Offset]
[String Data]
}

String Offset Section has Offset Values of Specific Strings from
StringBlock Start Address.

String Data Section has 2 Part

String Data
{
[Length]
[String]
}

Length part is 2byte. but, in AscII Mode, uses only 1byte.
Before reading String, you must check whether it is "Unicode" or
"AscII" format.

in Unicode format, Length part will be used with 2bytes.
normally it is "0x??, 0x00" (only if it is not longer than 256 bytes)

in AscII format, Length part will be used with 1bytes. but, they also
used second byte for mirroring.
if string length has a value 7, you will meet "0x07, 0x07"

So, I checked whether both bytes have same value to check string
format.


Lastly, actual string data will be after this length part with "Zero
Terminal"
in Unicode format, surely, Zero Terminal will be 2 byte of zero.



Whenever you change the string of this ARSC file, you should
recalculate these.
Length Part of String Data
String Offset of StringBlock
nImageLength of Header
nStringBlockLength of Header


After doing these all.
Simply, remove all JAR Signature (META-INF folder) from package.
Re-Archive with Zip and rename with *.apk.
Resign with your certificate by using "jarsigner" of JDK



Thanks.

--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google 
Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to android-developers+unsubscr...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.





--
Yaron Reinharts
Smart Drive Applications
http://www.poncho.co.il/gateaway.php
https://market.android.com/details?id=com.poncho.gsm.gate.activities


--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups "Android Developers" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Re: can _ever_ the intent received by a BroadcastReceiver onReceive() method be null?

2013-07-11 Thread Piren
i'm pretty sure it's impossible to guarantee something like that... i don't 
think part of their new programmer orientation is "if you ever touch the 
code that runs BroadcastReceiver.onReceive...never send a null intent".

Either way, at least on android 4.2.2_r1, it seems like it's impossible to 
get a null intent. feel free to verify this is true for all previous 
versions as well (and don't forget to keep checking this method every time 
they make a new build).
http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.2.2_r1/android/app/ActivityThread.java#2335


On Thursday, July 11, 2013 4:09:27 PM UTC+3, Palmer Eldritch wrote:
>
> That's nice advice - but in this case I think one should have a guarantee
>
> Does it make sense to receive a null intent ? Is it even possible with the 
> current android code ?
>
> On Thursday, July 11, 2013 9:46:00 AM UTC+3, Piren wrote:
>>
>> No point of being sure here... even if the current code is structured in 
>> a way that it shouldn't be null, nothing says it will stay like that in all 
>> future code revisions.
>> Ever since i started getting null exceptions from android (not 
>> NullPointerException... a Null instead of an exception) i learned it's 
>> always a good idea to check for nulls when you're supposed to receive an 
>> object.
>>
>> On Thursday, July 11, 2013 6:01:13 AM UTC+3, Palmer Eldritch wrote:
>>>
>>> I suspect it can't be null *by construction* - I just can't pin it down 
>>> in code (or in docs)
>>>
>>> It's nice to be sure
>>>
>>> Can somebody point to the relevant code parts ?
>>>
>>> I mean what paths lead to the onReceive being triggered ? Can we have a 
>>> null intent in any of them ?
>>>
>>> On Thursday, July 11, 2013 4:18:09 AM UTC+3, TreKing wrote:


 On Wed, Jul 10, 2013 at 4:14 PM, Palmer Eldritch wrote:

> I mean nobody knows ??
>
> Do you ever check the intent for being null and if not why ?
>

 Here's what you do. Assume it will not be null, then use ACRA or some 
 other bug-reporting tool to handle uncaught exceptions. If you get a null 
 pointer exception from here, you know it can be null.

 You're welcome.


 -
 TreKing  - Chicago 
 transit tracking app for Android-powered devices
  
>>>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Re: can _ever_ the intent received by a BroadcastReceiver onReceive() method be null?

2013-07-11 Thread Palmer Eldritch
That's nice advice - but in this case I think one should have a guarantee

Does it make sense to receive a null intent ? Is it even possible with the 
current android code ?

On Thursday, July 11, 2013 9:46:00 AM UTC+3, Piren wrote:
>
> No point of being sure here... even if the current code is structured in a 
> way that it shouldn't be null, nothing says it will stay like that in all 
> future code revisions.
> Ever since i started getting null exceptions from android (not 
> NullPointerException... a Null instead of an exception) i learned it's 
> always a good idea to check for nulls when you're supposed to receive an 
> object.
>
> On Thursday, July 11, 2013 6:01:13 AM UTC+3, Palmer Eldritch wrote:
>>
>> I suspect it can't be null *by construction* - I just can't pin it down 
>> in code (or in docs)
>>
>> It's nice to be sure
>>
>> Can somebody point to the relevant code parts ?
>>
>> I mean what paths lead to the onReceive being triggered ? Can we have a 
>> null intent in any of them ?
>>
>> On Thursday, July 11, 2013 4:18:09 AM UTC+3, TreKing wrote:
>>>
>>>
>>> On Wed, Jul 10, 2013 at 4:14 PM, Palmer Eldritch wrote:
>>>
 I mean nobody knows ??

 Do you ever check the intent for being null and if not why ?

>>>
>>> Here's what you do. Assume it will not be null, then use ACRA or some 
>>> other bug-reporting tool to handle uncaught exceptions. If you get a null 
>>> pointer exception from here, you know it can be null.
>>>
>>> You're welcome.
>>>
>>>
>>> -
>>> TreKing  - Chicago 
>>> transit tracking app for Android-powered devices
>>>  
>>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Record phonecall over Bluetooth

2013-07-11 Thread Fred Niggle
for personal uses I have a script on a laptop which watches the android
device bluetooth name to change to INCALL(to start nearby laptop/desktop
recording audio) and i have an android app which changes the name during
call in progress - but yes actually recording both sides of a call from an
app that is receiving the call is very hit and miss.


On 11 July 2013 07:39, Piren  wrote:

> He probably didn't notice he's recording the sound of the speaker...
>
>
> On Wednesday, July 10, 2013 9:12:03 PM UTC+3, Kristopher Micinski wrote:
>
>> How do you record a phone call normally when no headsets are
>> connected?  You shouldn't be able to do this, ...
>>
>> Kris
>>
>> On Wed, Jul 10, 2013 at 1:48 PM,   wrote:
>> > I want to record a phone call on Android when a Bluetooth headset is
>> > connected. I'm able to record a Phone call normally when no headsets
>> are
>> > connected. When I connect a Bluetooth headset the API records the phone
>> call
>> > but there is no audio. Do I need to route the call via Bluetooth and if
>> yes
>> > how could this be done?
>> >
>> > --
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups "Android Developers" group.
>> > To post to this group, send email to android-d...@**googlegroups.com
>> > To unsubscribe from this group, send email to
>> > android-developers+**unsubscr...@googlegroups.com
>> > For more options, visit this group at
>> > http://groups.google.com/**group/android-developers?hl=en
>> > ---
>> > You received this message because you are subscribed to the Google
>> Groups
>> > "Android Developers" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> an
>> > email to android-developers+**unsubscr...@googlegroups.com.
>> > For more options, visit 
>> > https://groups.google.com/**groups/opt_out.
>>
>> >
>> >
>>
>  --
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Android Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to android-developers+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 
Sent from an Ubuntu Desktop.

Ubuntu Speech 
inputis
now available on Google Play, along with Magnetic
Door Alarm 
app
.

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Re: Android Open Accessory

2013-07-11 Thread psyco
is there any one who works with AOA 1.0 ?

Le jeudi 11 juillet 2013 08:59:00 UTC+1, psyco a écrit :
>
> hi all,
>
> am developing an android application that communicates with a board 
> (arduino) via USB cable 
>
> am using Android open accessory 1.0 protocol ( AOA1.0)
>
> i establish the USB communication and every thing works fine but my Galaxy 
> nexus smartphone becomes hotter and the app blocks sometimes
>
>
> I have a theorie that the board is sending a lot of data to the smartphone 
> ( about 1800 byte in one second) that the android device can't handle 
>
> does any one have this probleme before?
>
> any ideas ?
>
> thx,
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Vertical Datepicker

2013-07-11 Thread Nikolay Konstantinov
Hi guys, 

I'm wondering if is it possible to switch the orientation of a DatePicker. 
I mean by default the numberPicker with the day, month and year appears 
first(if you look from left to right and horizontally) and the CalendarView 
appears second. I want the same order but vertically, i.e. NumberPicker and 
below him - CalendarView.

Thank you in advance 

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Android Open Accessory

2013-07-11 Thread psyco
hi all,

am developing an android application that communicates with a board 
(arduino) via USB cable 

am using Android open accessory 1.0 protocol ( AOA1.0)

i establish the USB communication and every thing works fine but my Galaxy 
nexus smartphone becomes hotter and the app blocks sometimes


I have a theorie that the board is sending a lot of data to the smartphone 
( about 1800 byte in one second) that the android device can't handle 

does any one have this probleme before?

any ideas ?

thx,

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.