Android Open Source - ShortcutsOfPower_Android Main N P






From Project

Back to project page ShortcutsOfPower_Android.

License

The source code is released under:

GNU General Public License

If you think the Android project ShortcutsOfPower_Android 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 com.networkprofiles;
/*from w w  w. ja va 2 s. c  o  m*/
import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

import com.networkprofiles.utils.ConstantsNP;

public class MainNP extends Activity {
    
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
        Button buttonAbout = (Button) findViewById(R.id.buttonAbout);
        Button buttonMoreApps = (Button) findViewById(R.id.buttonMoreApps);
        
        if(!prefs.getBoolean(ConstantsNP.PREF_EULA, false)) {
      Intent i = new Intent(this, SOPEula.class);
      startActivity(i);
      finish();
    }
        
        buttonAbout.setOnClickListener(new OnClickListener() {
      @Override
      public void onClick(View v) {
        AlertDialog.Builder ad = new AlertDialog.Builder(MainNP.this);
        ad.setTitle(MainNP.this.getResources().getString(R.string.app_name));
        ad.setMessage(MainNP.this.getResources().getString(R.string.about_message));
        ad.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
          @Override
          public void onClick(DialogInterface dialog, int which) {
            //do nothing
          }
        });
        ad.show();
      }
    });
        
        buttonMoreApps.setOnClickListener(new OnClickListener() {
      @Override
      public void onClick(View v) {
        Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(ConstantsNP.MY_STORE_PAGE));
        startActivity(i);
      }
    });
    }
}




Java Source Code List

com.networkprofiles.MainNP.java
com.networkprofiles.SOPEula.java
com.networkprofiles.utils.ConstantsNP.java
com.networkprofiles.utils.MyNetControll.java
com.networkprofiles.utils.NPReceiver.java
com.networkprofiles.widget.NPWidgetCell.java
com.networkprofiles.widget.NPWidgetDisplay.java
com.networkprofiles.widget.NPWidgetGps.java
com.networkprofiles.widget.NPWidgetMobileData.java
com.networkprofiles.widget.NPWidgetService.java
com.networkprofiles.widget.NPWidgetSound.java