JBoss Community

Re: EJB3 as a server, android as a client

created by Pavan Kumar Mantha in EJB3 - View the full discussion

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.

Reply to this message by going to Community

Start a new discussion in EJB3 at Community