3 Replies Latest reply on Oct 11, 2012 11:30 PM by manthapavan

    EJB3 as a server, android as a client

    magma917

      I'm a new JBoss user, and I use Eclipse, after installed JBoss in eclipse Marketplace, I start create EJB project with JBoss, but when I set runtime in creating a new EJB project, it ask me to get run.jar. May I ask do I have to install JBoss outside eclipse.

       

      Moreover, I feel like develop android application which uses EJB as a server. I don't whether I can do it. And how to do it?

       

      Thanks

        • 1. Re: EJB3 as a server, android as a client
          manthapavan

          Hi Li Yan

           

          As part of your question, yes u need to install JBoss out side of your eclipse and configure that server path in Eclipse. installing JBoss doesn't mean u get server installed. regarding your android client intracting with server side EJB ill post it in few days.

           

          Thanks.

          • 2. Re: EJB3 as a server, android as a client
            magma917

            Hi, thanks for your instruction. May I ask how can I use EJB3 with JBoss as a server and Android application as a client. Thanks.

            • 3. Re: EJB3 as a server, android as a client
              manthapavan

              Hi Li Yan

               

              once you have developed the EJB component and Android Activity. You can code a Servlet that will internally call EJB. From Android you are free to call Servlet using HttpURLConnection Class in the API.

              pass the parameters to the servlet and from servlet pass them to EJB, and start your Business Logic.

               

                                  String urlString = "http://projectcontextpath/servletname"

               

                          URL url = new URL(urlString);

                          URLConnection connection = url.openConnection();

               

                          try {

                              HttpURLConnection httpConnection = (HttpURLConnection) connection;

                              httpConnection.setRequestMethod("GET");

                              httpConnection.connect();

                                      }catch(Exception e){

               

                                            e.printStackTrace();

                                       }

               

              Hope This helps you. Happy Coding.

              Thanks.