HTTPS POST (SSL) with Multipart - HTTPURLConnection or HTTPClient(Apache library)

by Prabhu » Tue, 25 Jan 2011 02:51:06 GMT


Sponsored Links
 Hi All,

I am developing a Android Client which will ipload files to a server
using HTTPS POSRT with Multipart.
As i have read  there are two ways to do this:

1. Use HttpURLCoennection and embed the multipart data and then send
it.
2. Use Apache provided mime for multipart and then use HTTPClient.

What is the recommeneded way from above.

I have read that

HTTPURLConnection is buggy in android
and the post implementatino is not that clean as we have to literally
create the data stream with boundaries.

HTTPClient: the code is cleaner and fewer :) , but we have add extra
jar file for multipart support.

Any recommenation in this will be helpful.

Thanks,
Prabhu

-- 



Other Threads

1. analysis of media player library

Hi all,
           i want to know POSIX compliance of media player library.and
what are the other factors which need to be taken in to consideration
while porting it on to some another paltform?



Regards,
Dhananjay
--~--~---------~--~----~------------~-------~--~----~
unsubscribe: [EMAIL PROTECTED]
website: 

2. Problem in Android-JNI IPC

Hello folks,

I have implemented a JNI layer for communication between the Android
Java Application and Android Native C code.
However, we are facing issues with IPC in this JNI layer.

I tried the following IPC approaches:

1. Socket in JNI layer: C Sockets to communicate with the underlying C
based processes.
                                I get an error in bind().

Sample code:

   fd_recv_es = socket(AF_INET,SOCK_DGRAM,0);

   if (0 > fd_recv_es)

   {

       return (FAILURE);

   }



   bzero(&es_recv_addr, sizeof(es_recv_addr));

   es_recv_addr.sin_family = AF_INET;

   es_recv_addr.sin_port = htons(self_port);

   es_recv_addr.sin_addr.s_addr = inet_addr(self_ip.str);

   memset(&(es_recv_addr.sin_zero), '\0', 8);

   if ( -1 == bind( fd_recv_es,(struct sockaddr*)(&es_recv_addr),
sizeof(struct sockaddr_in)))   // Fails here

   {

       return (FAILURE);

   }



2. Message Q in JNI layer: Linux based message queue to communicate
with the underlying C based processes.

                                   I get an error in creating the
message queue.

Sample Code:

      struct my_msgbuf buf;

      int msqid, i;

      key_t key;

      if ((key = ftok("/data/IPC/dummy", 'B')) == -1)

      {

          perror("ftok");

          exit(1);

      }

      if ((msqid = msgget(key, 0644 | IPC_CREAT)) == -1)     // Fails
here

      {

         perror("msgget");

         exit(1);

      }



Both these approaches work perfectly fine when I use them in an
Android C executable,
and we are getting this problem only when we use them in a JNI DLL.

The linking command for the building JNI DLL is:
ALIB       := $(NDK_BASE)/toolchain/arm-eabi/lib/gcc/arm-eabi/4.2.1/
libgcc.a
$(CC) -nostdlib -Wl,-soname,libApp.so -Wl,-shared,-Bsymbolic
-L$(NDK_BASE)/lib $^ $(LIBS) -o libApp.so -Wl,--no-undefined
$(ALIB)

Has anyone faced a similar issues with IPC(with C executables) in JNI
layer?
Also, are there are some other flags required for building a JNI DLL
that I've missed out on.
Any pointers in this direction shall be really helpful.

Thanks,
Pankaj

--~--~---------~--~----~------------~-------~--~----~

3. android:gravity in ImageView

4. MMS Pics

5. Capturing frames form MediaPlayer

6. Android porting problem - LCD BPP

7. How to open a .dex file with emulator?