Android Open Source - WifiAlbum Web Server Service






From Project

Back to project page WifiAlbum.

License

The source code is released under:

MIT License

If you think the Android project WifiAlbum listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package in.zerob13.android.wifialbum.httpserver;
/*from w w  w  .j  a  v  a2  s.co  m*/
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.IBinder;
import android.util.Log;

/**
 * Created by zerob13 on 9/15/14.
 */
public class WebServerService extends Service {
    private WebServer server = null;
    private WebServerTask mServerTask = null;

    @Override
    public void onCreate() {
        Log.i("HTTPSERVICE", "Creating and starting httpService");
        super.onCreate();
        mServerTask = new WebServerTask(this);
        mServerTask.execute();


    }

    @Override
    public void onDestroy() {
        Log.i("HTTPSERVICE", "Destroying httpService");
        server.stopServer();
        super.onDestroy();
    }


    @Override
    public IBinder onBind(Intent intent) {
        return null;
    }


    private class WebServerTask extends AsyncTask {

        private Context mContext;
        public WebServerTask(Context aContext){
            mContext=aContext;
        }

        @Override
        protected Object doInBackground(Object[] objects) {
            server = new WebServer(mContext);
            server.startServer();
            return null;
        }


    }
}




Java Source Code List

in.zerob13.android.wifialbum.ApplicationTest.java
in.zerob13.android.wifialbum.WifiActivity.java
in.zerob13.android.wifialbum.httpserver.AssetsHandler.java
in.zerob13.android.wifialbum.httpserver.FileHandler.java
in.zerob13.android.wifialbum.httpserver.HomeCommandHandler.java
in.zerob13.android.wifialbum.httpserver.WebServerService.java
in.zerob13.android.wifialbum.httpserver.WebServer.java
in.zerob13.android.wifialbum.utils.Utils.java