Re: [android-developers] Re: how to distribute a Library Project WITHOUT source code (as jar file) as some sort of SDK?

2012-01-27 Thread Klier Rainer


Am 26.01.2012 23:33, schrieb Mark Murphy:
> On Thu, Jan 26, 2012 at 5:25 PM, joebowbeer  wrote:
>> Mark Murphy writes:
>>
>>> You have to rewrite your [library] code to avoid using R. values, as they 
>>> will be wrong.
>>
>> The resource compiler was changed in r14 so that the identifiers in a
>> library project's R.java are no longer declared "final". This prevents
>> the constants from being inlined into library bytecode, and instead
>> forces these references to be resolved at runtime. In theory this
>> should allow your library to continue to use R. values. Though, as
>> explained in the r14 change docs, you won't be able to use resource
>> ids in switch statements.
>
> True, though I'm a bit hesitant to rely upon that behavior until they
> release the full library-project-as-distributable-JAR support.

it workes!

i did it this way:
1. first thing is to have the full library-project.
2. then i copied the whole library-project.
3. in the copy, i removed the source code.
4. in the app-project i added the source-less-library-project as android 
library (to get the R class with all the ids, which really aren't 
"final", and the other resources)
5. in the app-project i added the .jar file with all the binary classes 
from the full library-project, which was generated automatically (or by 
running "Project/Clean...") by eclipse as external jar-file.
6. the app coming out of the app-project was fully working!

so it seems, that you have to split up source code an resources from a 
library-project and add them separated (and on different places) from 
each other to the app-project.

-- 
Rainer Klier
Research & Development
xyzmo SIGNificant Group  | Austria | USA  | Germany
A-4052 Ansfelden, Haiderstraße 23
Tel.: +43 7229 88060-0, E-Mail: rainer.kl...@xyzmo.com

-- 
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


Re: [android-developers] how to distribute a Library Project WITHOUT source code (as jar file) as some sort of SDK?

2012-01-26 Thread Klier Rainer


Am 26.01.2012 18:03, schrieb Mark Murphy:
> On Thu, Jan 26, 2012 at 11:25 AM, Klier
> Rainer  wrote:
>> ahh, do you mean like suggested here:
>> http://blog.sofisoftware.com/post/2011/10/05/Android-Library-projects-and-Jars
>
>>
> Considering that's referencing some of my early work on the subject,
> yes. :-)

Ah, ok. ;-)

>> is it this book you are talking about?
>>
>> http://www.amazon.de/Coders-Guide-Advanced-Android-Development/dp/098167805X/ref=sr_1_cc_1?s=aps&ie=UTF8&qid=1327592129&sr=1-1-catcorr
>
>>
> Yes, though the Warescription digital edition is newer.

Warescription seems to be a good idea.
but how can i read any of the books offline?
and what will happen, when the subscription ends?
do i have access to the latest editions of the books that was actual 
when subscription ended?

>> is the 2nd edition offered by amazon.de new enough?
>
> Yes.

ok, so this topic is handled in this edition in detail?
that would be great.

>> or will that step not be necessary any more, when official support
>> for library-projects-as-JARs will be available?
>
> The plan, as I understand it, would avoid the whole
> getResources().getIdentifier() nonsense, and you wouldn't have to
> manually create the JAR and the "distribution" library project that
> uses it.

ok, understood.
anyway, i have to start with converting my current app-project to a 
library project.
maybe the next Android SDK update comes soon enough to help me avoid the 
thiings you said.

thanks a lot for pointing me to the right direction.
-- 
Rainer Klier
Research & Development
xyzmo SIGNificant Group  | Austria | USA  | Germany
A-4052 Ansfelden, Haiderstraße 23
Tel.: +43 7229 88060-0, E-Mail: rainer.kl...@xyzmo.com

-- 
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


Re: [android-developers] how to distribute a Library Project WITHOUT source code (as jar file) as some sort of SDK?

2012-01-26 Thread Klier Rainer
hi mark,

thank you for your fast response.

Am 26.01.2012 15:57, schrieb Mark Murphy:
> It is possible to create an Android library project that does not

ahh, do you mean like suggested here:
http://blog.sofisoftware.com/post/2011/10/05/Android-Library-projects-and-Jars

> You have to rewrite your code to avoid using R. values, as they
> will be wrong. You will have to look up all resource IDs using
> getResources().getIdentifier() and/or reflection.

you mean i should replace for example all
R.layout.identifier_1
to
getResources().getIdentifier("identifier_1", "layout", 
"full.package.name"); ?


> I have the instructions in _The Busy Coder's Guide to Advanced Android
> Development_ (http://commonsware.com/AdvAndroid), though the
> instructions are new enough that none of my free versions have them.

is it this book you are talking about?

http://www.amazon.de/Coders-Guide-Advanced-Android-Development/dp/098167805X/ref=sr_1_cc_1?s=aps&ie=UTF8&qid=1327592129&sr=1-1-catcorr

is the 2nd edition offered by amazon.de new enough?

> 1. Create an Android library project, with your source code and such –

you mean with source code AND resources?
like any usual library project.

> 2. Compile the Java source (e.g., ant compile) and turn it into a JAR file

would a Project/Clean... build from eclipse also produce the required 
jar? (menu "Project", menu-entry "Clean..." in eclipse)

i tried this whith the TicTacToeLib example from 
http://developer.android.com/resources/samples/TicTacToeLib/index.html
and it produced a file tictactoelib.jar under bin directory in the 
TicTacToeLib project.
this contains only .class files.

would that be the required jar file?

> 3. Create a distribution Android library project, with the same
> resources as the master library project, but no source code
> 4. Put the JAR file in the distribution Android library project's libs/
> directory
>
> The resulting distribution Android library project will have everything a
> main project will need, just without the source code."

ok, understood.

> Personally, I'd just wait a bit. I am hopeful that the official
> support for library-projects-as-JARs will be available soonish.

ok, how soon whould you expect?
hours?
days?
weeks?
months?
years?

i ask, because i have the order to build a SDK out of my app code

and i can't let my boss wait too long. ;-)

but as you said, i first have to create an Android library project 
including everything anyway.
so i can start with this.

or will that step not be necessary any more, when official support for 
library-projects-as-JARs will be available?
-- 
Rainer Klier
Research & Development
xyzmo SIGNificant Group  | Austria | USA  | Germany
A-4052 Ansfelden, Haiderstraße 23
Tel.: +43 7229 88060-0, E-Mail: rainer.kl...@xyzmo.com

-- 
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


[android-developers] how to distribute a Library Project WITHOUT source code (as jar file) as some sort of SDK?

2012-01-26 Thread Klier Rainer
hi android-developers,

i am trying to convert my existing (and working) app project into 2 
projects.
the first project (a library project) should act as a kind of SDK.
the second project should use the first and make the original app.

my goal is to be able to distribute the first project only as binary 
(WITHOUT source code) to other developers, so they can make their own 
apps with it.
the second project should also be distributed as example or reference 
implementation how to use the first project.

this way, i am using my own SDK to build my app again, and offer the SDK 
in binary-only-form to other developrs, so they can use it to build 
their apps.

Android library projects seem the perfect way for this.

BUT, i found (and tried) out, that it is not possible to pack the class 
files of the source code and the used resources (ids, layouts, 
images,) and the "R" class pointing to the resources into one jar 
file (or any other archive).

here is, what i read on:
http://developer.android.com/guide/developing/projects/index.html

"You cannot export a library project to a JAR file

A library cannot be distributed as a binary file (such as a JAR file). 
This will be added in a future version of the SDK Tools."


the only way is to supply the whole source code of the library project 
and let the second project use/reference to this source library project.

but i don't want/can give away my source code.


what is the best way how i can workaround this limitation?
has anybody of you a solution/trick/workaraound for this?

thanks in advance.
-- 
Rainer Klier
Research & Development
xyzmo SIGNificant Group  | Austria | USA  | Germany
A-4052 Ansfelden, Haiderstraße 23
Tel.: +43 7229 88060-0, E-Mail: rainer.kl...@xyzmo.com

-- 
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


Re: [android-developers] Fwd: consuming webservice using soap (wsdl file genrated in sap server)

2011-10-25 Thread Klier Rainer


Am 07.09.2011 10:13, schrieb arun kumar:
>
>
> -- Forwarded message --
> From: *arun kumar* mailto:arun.kata...@gmail.com>>
> Date: Wed, Sep 7, 2011 at 12:27 PM
> Subject: consuming webservice using soap (wsdl file genrated in sap server)
> To: android-developers@googlegroups.com
> 
>
>
> Hi
> how to consume webservice from sapserver...am having wsdl file created
> in sapserver...if i give the user id then the monthly salary will be
> display.
>
>
> public class Webservice extends Activity {
>
> private static final String NAMESPACE =
> "urn:sap-com:document:sap:soap:functions:mc-style";
> private static String URL = "myurl";
> private static final String METHOD_NAME = "ZemptrackEarnOview";
> private static final String SOAP_ACTION = "zemptrack_overview";
> private Edittext lblResult;
>
> /** Called when the activity is first created. */
> @Override
> public void onCreate(Bundle savedInstanceState) {
> super.onCreate(savedInstanceState);
> setContentView(R.layout.main);
> lblResult = (EditText) findViewById(R.id.editText1);
> SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
> Empnfo ei=new EmpInfo();
> ei.setValue(" 34343") ;

i think you forgot to add the Empnfo ei to the request.
i don't know what Empnfo is, but generally string properties are added 
to requests like this:

request.addProperty("name", value);

for non-string types it is done like this:

info = new PropertyInfo();
info.setName("name of property like in XML");
info.setValue(Object);
info.setType(Object.getClass());
Request.addProperty(info)


-- 
Rainer Klier
Research & Development
xyzmo SIGNificant Group  | Austria | USA  | Germany
A-4052 Ansfelden, Haiderstraße 23
Tel.: +43 7229 88060-0, E-Mail: rainer.kl...@xyzmo.com

-- 
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