[android-developers] need help on https (code for http included)

2009-09-04 Thread DaRolla

hello,

I need some help on https connections.

I am using this code to connect to my http servlet in order to stream
objects and recieve object streams:

.
.
.
import lgpl.haustein.Base64Encoder;
import java.net.URL;
import java.net.URLConnection;
.
.
.
private String login;
private String password;
.
.
.
URL url = new URL(ANDROID_HTTP_SERVER);
URLConnection connection = url.openConnection();
connection.setDoOutput(true);
connection.setDoInput(true);
String encoding = Base64Encoder.encode(login + : + password);
connection.setRequestProperty(Authorization, Basic  + encoding);
.
.
.

The lgpl.haustein.Base64Encoder I have found here:
http://www.winterwell.com/software/jtwitter.php

I really do not know how to work with https. especially the licence is
not valid, so I need to ignore it automatically.

Thanks for your help.

Greetings,
Marco

PS: I am working with SDK 1.1 R1, so please don't send me SDK 1.5
code...
--~--~-~--~~~---~--~~
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] problems removing childs from view

2009-04-29 Thread DaRolla

hello,

I have some problems removing views.

Inside my xml I have a LinearLayout with a ScrollView with a
TableLayout.

Into this I am adding (using Java) childs, which are LinearLayouts (no
TableRows).

This works fine.

Now I want to remove some childs, which are LinearLayouts.

linearlayout.setVisibility(View.GONE) works finde but doesnt remove
the Object itself.

tablelayout.removeView(linearlayout) works only under strange
circumstances: removing the last element of my list works fine.
removing some element in the middle throws this exception:

Uncaught handler: thread main exiting due to 
uncaught exception
java.lang.NullPointerException
at 
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1207)
at 
android.view.ViewGroup.drawChild(ViewGroup.java:1434)
at 
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1208)
at android.view.View.draw(View.java:5571)
at 
android.widget.FrameLayout.draw(FrameLayout.java:324)
at 
android.view.ViewGroup.drawChild(ViewGroup.java:1436)
at 
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1208)
at 
android.view.ViewGroup.drawChild(ViewGroup.java:1434)
at 
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1208)
at 
android.view.ViewGroup.drawChild(ViewGroup.java:1434)
at 
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1208)
at 
android.view.ViewGroup.drawChild(ViewGroup.java:1434)
at 
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1208)
at android.view.View.draw(View.java:5465)
at 
android.widget.FrameLayout.draw(FrameLayout.java:324)

linearlayout.removeAllViews() I tried in order to clear all childs of
my linearlayout (which are some buttons and textviews in fact), but
this doesnt change anything.

Any idea what I am doing wrong?

Greetings,
DaRolla
--~--~-~--~~~---~--~~
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] changing language on demand?

2009-04-23 Thread DaRolla

hello,

I need to change the language of a running apk on demand.

So the texts are set in xml to @strings/name

And there are different strings.xml inside values-de values-en values-
tr and so on.

Is there a way to tell android to update the layout in order to change
the strings automatically?

Or do I have to replace all of them by hand using findById().setText
(R.strings.name) ?

Greetings
DaRolla
--~--~-~--~~~---~--~~
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] Castor unmarshalling with Android's SAX DOM implementation throws: The 'namespace-prefix' feature is not supported while the 'namespaces' feature is enabled

2009-04-21 Thread DaRolla

hello,

in order to generate Java classes from XML schema I use Castor.

These classes have unmarshalling methods for loading and parsing XML
files.

In JDK I'd use Xerces as SAX DOM implementation.

As I understood Android it comes with its own implementation.

Trying to unmarshal the XML file in Android this Exception is thrown:

org.exolab.castor.xml.MarshalException: The 'namespace-prefix' feature
is not supported while the 'namespaces' feature is enabled.

Things are working fine in JDK.

So I think its thing of Androids SAX DOM implementation.

Can you please help me how to get rid of this error?

Here's a part of the XSD:

?xml version=1.0 encoding=UTF-8?
xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema;
elementFormDefault=qualified attributeFormDefault=unqualified
xs:element name=sport...

And here's part of the XML:

?xml version=1.0 encoding=UTF-8?
sports xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xsi:noNamespaceSchemaLocation=sports.xsd
sport id=soccer...

Thanks for help.

Greetings,
DaRolla


--~--~-~--~~~---~--~~
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] java.lang.StackOverflowError when deserializing

2009-04-21 Thread DaRolla

hi,

I've got a strange problem here doing object de/serialization.

In Java (JDK 1.6) I serialize some objects.

In Android (SDK 1.1) I deserialize them.

This work quite nice in general.


In order to work with a server object (that uses Castor un/
marshalling) I do it like I always do. Same routines. Well, this time
the file is only 172kb (my routines works pretty well with 2,4mb
files) but the interlacing is quite deep. So it all starts with a
class containing 2 ArrayLists. I tried de/serializing just
ArrayListString and this works very well. But the XML file (which is
unmarshalled with Castor and serialized in JDK) has 7000 lines. So I
get this StackOverflowError.

java.lang.StackOverflowError
at java.io.ObjectInputStream.readFieldValues(ObjectInputStream.java:
1038)
at java.io.ObjectInputStream.readFields(ObjectInputStream.java:1006)
at java.util.ArrayList.readObject(ArrayList.java:713)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at java.io.ObjectInputStream.readObjectForClass(ObjectInputStream.java:
1390)
at java.io.ObjectInputStream.readHierarchy(ObjectInputStream.java:
1311)
at java.io.ObjectInputStream.readNewObject(ObjectInputStream.java:
1977)
at java.io.ObjectInputStream.readNonPrimitiveContent
(ObjectInputStream.java:823)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:2145)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:2098)
at java.io.ObjectInputStream.readFieldValues(ObjectInputStream.java:
1160)
at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:
435)
at java.io.ObjectInputStream.readObjectForClass(ObjectInputStream.java:
1405)
at java.io.ObjectInputStream.readHierarchy(ObjectInputStream.java:
1311)
at java.io.ObjectInputStream.readNewObject(ObjectInputStream.java:
1977)
at java.io.ObjectInputStream.readNonPrimitiveContent
(ObjectInputStream.java:823)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:2145)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:2098)
at java.io.ObjectInputStream.readFieldValues(ObjectInputStream.java:
1160)
at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:
435)
at java.io.ObjectInputStream.readObjectForClass(ObjectInputStream.java:
1405)
at java.io.ObjectInputStream.readHierarchy(ObjectInputStream.java:
1311)
at java.io.ObjectInputStream.readNewObject(ObjectInputStream.java:
1977)
...

Do you have any ideas what to do?

Greetings  thanks,
DaRolla
--~--~-~--~~~---~--~~
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] Is there a Castor for Android?

2009-04-17 Thread DaRolla

Hello,

I need Castor for Android. Using the castor-1.2-xml.jar won't work at
all. The exception is: java.lang.VerifyError:
org.exolab.castor.xml.Introspector

So I tried to copy the Castor sources to my Android project in order
to let Eclipse decide which part isn't compatible.

Well, it's just one class: org.exolab.castor.dsml.jndi.JNDIProducer

This class imports javax.naming.*, and thats forbidden inside Android.


So, I think there might be other users that got the same problem as me
and maybe solved it?


Greetings,
DaRolla
--~--~-~--~~~---~--~~
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 terminate an APK on emulator?

2009-04-16 Thread DaRolla

Hello :)

I'd like to know how to terminate / kill an APK on emulator. Most
times I reinstall the APK, but I was wondering if there is a better
way because I simply need to restart my APK...

Greetings,
DaRolla
--~--~-~--~~~---~--~~
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] HttpsURLConnection

2009-04-15 Thread DaRolla
 the partial or complete certificate chain provided by the
peer,
 * build a certificate path to a trusted root and return if it can
be
 * validated and is trusted for server SSL authentication based on
the
 * authentication type. The authentication type is the key exchange
 * algorithm portion of the cipher suites represented as a String,
such
 * as RSA, DHE_DSS. Note: for some exportable cipher suites, the
key
 * exchange algorithm is determined at run time during the handshake.
For
 * instance, for TLS_RSA_EXPORT_WITH_RC4_40_MD5, the authType should
be
 * RSA_EXPORT when an ephemeral RSA key is used for the key exchange,
and
 * RSA when the key from the server certificate is used. Checking is
 * case-sensitive.
 * @param chain codeX509Certificate[]/code the peer certificate
chain
 * @param authType codeString/code the authentication type based
on
 * the client certificate
 */
public void checkServerTrusted( X509Certificate[] chain, String
authType ) {
}
}



public class HostnameVerifierImpl implements HostnameVerifier {

// Log4J
private static Logger logger = Logger.getLogger
( HostnameVerifierImpl.class );

/**
 * Verify that the host name is an acceptable match with the server's
authentication scheme.
 * @param hostname codeString/code the host name
 * @param session codeSSLSession/code SSLSession used on the
connection to hos
 */
public boolean verify( String hostname, SSLSession session ) {

if( ! hostname.equals( session.getPeerHost() ) ) {
logger.warn( Das Zertifikat  + session.getPeerHost() 
+  passt
nicht zum Host  + hostname );
}
return true;
}
}



the problem inside android is, that base64encoder isnt integrated.

i've found a working one inside the jar: 
http://www.winterwell.com/software/jtwitter.php

but its still not working. ssl seems not to be inside android :(

can you help me on this?

I can send the exception later...

greetings
darolla
--~--~-~--~~~---~--~~
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] [TextView] What are that XML Attributes in JAVA ?

2009-04-04 Thread DaRolla

Hi,

I need to programm this XML in JAVA. Some I figured out, some not. Can
you help me on the missing ones?


TextView android:layout_width=150px
  android:layout_height=wrap_content
  android:text=Bladidadi
  android:layout_gravity=center_vertical
  android:textColor=#ff /


TextView tv = new TextView(this);

//android:layout_width=150px
tv.setWidth(150);

//android:layout_height=wrap_content
???

//android:text=Bladidadi
tv.setText(Bladidadi);

//android:layout_gravity=center_vertical
tv.setGravity(Gravity.CENTER_VERTICAL);

//android:textColor=#ff
tv.setTextColor(Color.rgb(0xff, 0xff,0xff));// tv.setTextColor
(0xff) doesn't work somehow


Greetings,
DaRolla
--~--~-~--~~~---~--~~
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 add --core-library to Eclipse ?

2009-03-26 Thread DaRolla

hi,

I need to know how to add the parameter --core-library to Eclipse,
especially to DEX.

I managed to work around with activitycreator and ant scripts
(build.xml), but this way it takes too long.

Where can I configure this?

Thanks,
DaRolla
--~--~-~--~~~---~--~~
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] global object? (singleton, intends, db)

2009-03-17 Thread DaRolla

hello,

in order to communicate with the server I need a huge global object
(class with some hashmaps).

all my activities (about 10) need that huge global object.

wich options do I have?

I am thinking about passing the object using intends and about the
possibility to make the object a singleton.

using the db will be much too slow.


any ideas?

greetings  thanks for reading,
DaRolla
--~--~-~--~~~---~--~~
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] I need to use jbossall-client.jar

2009-03-17 Thread DaRolla

hello,

I need to use some jars inside android. well, most of them work. It
seems that the standard java compiled jars are decompiled and compiled
into dalvik format (for example Log4J.jar).

The only jar that makes troubles is jbossall-client.jar.

Eclipse console says:

Attempt to include a core VM class in something other than a core
library.
It is likely that you have attempted to include the core library from
a desktop
virtual machine into an application, which will most assuredly not
work. If
you really intend to build a core library -- which is only appropriate
as
part of creating a full virtual machine binary, as opposed to
compiling an
application -- then use the --core-library option to suppress this
error
message. If you go ahead and use --core-library but are in fact
building
an application, then please be aware that your build will still fail
at some
point; you will simply be denied the pleasure of reading this helpful
error
message.

So I tried to remove the javax package from the jar.

Now Eclipse console says:

Conversion to Dalvik format failed: Unable to execute dex: null

:(

Who can help me on this?

Greetings,
DaRolla

--~--~-~--~~~---~--~~
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] need help on --core-library

2009-03-17 Thread DaRolla

hello,

I need to build a java.beans.PropertyChangeListener which is part of
JDK (rt.jar) but not part of Dalvik.

Trying to copy the sources to my Application I get this:

Attempt to include a core VM class in something other than a core
library.
It is likely that you have attempted to include the core library from
a desktop
virtual machine into an application, which will most assuredly not
work. If
you really intend to build a core library -- which is only appropriate
as
part of creating a full virtual machine binary, as opposed to
compiling an
application -- then use the --core-library option to suppress this
error
message. If you go ahead and use --core-library but are in fact
building
an application, then please be aware that your build will still fail
at some
point; you will simply be denied the pleasure of reading this helpful
error
message.

My solution:
1) build a core library with consisting out of
java.beans.PropertyChangeListener
2) integrate that library (jar?) into my application.

My question:
- how can I build a core library using eclipse?

greetings,
darolla
--~--~-~--~~~---~--~~
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] object serialization ???

2009-02-10 Thread DaRolla

hi,

I get nuts on this, who can help?

package de.test;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.io.Serializable;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;

public class SerialisiereAndroidActivity extends Activity {

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

try {
Serialisiere pi = new Serialisiere(3, Math.PI, pi);
((TextView) findViewById(R.id.tv1)).setText(Serialisiere:+
pi.toString());
pi.writeIt(pi.ser);
}
catch( Exception e) {
Log.d( SerialisiereAndroidActivity, e.toString() );
}
}

public class Serialisiere implements Serializable {

private static final long serialVersionUID =
-3922493985071195239L;

private int i;
private double d;
private String s;

public Serialisiere(int i, double d, String s) {
this.i = i;
this.d = d;
this.s = s;
}

public void writeIt(String filename) throws IOException {
FileOutputStream fos = openFileOutput(filename,
MODE_WORLD_WRITEABLE);
ObjectOutputStream oos = new ObjectOutputStream(fos);
oos.writeObject(Serialisiere.this);
oos.close();
fos.close();
}

@Override
public String toString() {
return i= + i +  d= + d +  s= + s;
}
}
}

the problem is:

oos.writeObject(Serialisiere.this);

this throws an java.io.NotSerializableException.

who can help me on this?

greetings,
darolla
--~--~-~--~~~---~--~~
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] windowAnimationStyle - ignored in theme?

2009-02-04 Thread DaRolla

Hi,

I'd like to have some fancy effects on my Activities when entering or
exiting.

So I tried to use theming.

But it seems that it's completly ignored?

themes.xml (activated in Manifest)
item name=android:windowAnimationStyle@style/Animation.Activity/
item

styles.xml
style name=Animation parent=android:Animation/
style name=Animation.Activity parent=android:Animation.Activity
item name=android:activityOpenEnterAnimation@anim/fade_in/
item
item name=android:activityOpenExitAnimation@anim/fade_in/
item
item name=android:activityCloseEnterAnimation@anim/fade_in/
item
item name=android:activityCloseExitAnimation@anim/fade_in/
item
/style

fade_in.xml
alpha xmlns:android=http://schemas.android.com/apk/res/android;
 android:fromAlpha=0.0 android:toAlpha=1.0
android:duration=1000 /

Greetings,
DaRolla

--~--~-~--~~~---~--~~
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] android-titlebar (iphone like backbutton)

2009-01-30 Thread DaRolla

hi,

I managed to customize the titlebar and add an iphone like backbutton.

http://code.google.com/p/android-titlebar/

greetings,
darolla

--~--~-~--~~~---~--~~
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] Re: Activity Title font

2009-01-30 Thread DaRolla

hi,

just take a look at
android\android-sdk-windows-1.0_r2\tools\lib\res\default\values
styles.xml and themes.xml

greetings,
darolla


On Jan 30, 11:42 am, AusR austinjr...@gmail.com wrote:
 Anyone know what the default Activity Title font size/style is?

 I'm creating a custom title but would like to match the other
 Activities.

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



[android-developers] Re: Activity Title font

2009-01-30 Thread DaRolla

hi,

just take a look at
android\android-sdk-windows-1.0_r2\tools\lib\res\default\values
styles.xml and themes.xml

greetings,
darolla

On 30 Jan., 11:42, AusR austinjr...@gmail.com wrote:
 Anyone know what the default Activity Title font size/style is?

 I'm creating a custom title but would like to match the other
 Activities.

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



[android-developers] Re: Activity Title font

2009-01-30 Thread DaRolla

http://code.google.com/p/android-titlebar/

On 30 Jan., 11:42, AusR austinjr...@gmail.com wrote:
 Anyone know what the default Activity Title font size/style is?

 I'm creating a custom title but would like to match the other
 Activities.

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