`
文章列表
private double[] getGPS() { LocationManager lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE); List<String> providers = lm.getProviders(true); /* Loop over the array backwards, and if you get an accurate location, then break out the loop*/ Location l = null; for (int i=pr ...
Intent intent = new Intent(); intent.setAction(android.content.Intent.ACTION_VIEW); File file = new File(\"/sdcard/test.mp4\"); intent.setDataAndType(Uri.fromFile(file), \"video/*\"); startActivity(intent); Intent intent = new Intent(); intent.setAction(android.content.Inte ...
public class FullScreen extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN) ...
import java.io.File; import android.os.Environment; import android.os.StatFs; public class MemoryStatus { static final int ERROR = -1; static public boolean externalMemoryAvailable() { return android.os.Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUNTED); } ...
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(editTextField.getWindowToken(), 0);
public static final int SOUND_EXPLOSION = 1; private SoundPool soundPool; private HashMap<Integer, Integer> soundPoolMap; private void initSounds() { soundPool = new SoundPool(4, AudioManager.STREAM_MUSIC, 100); soundPoolMap = new HashMap<Integer, Integer>(); soundPoolMap.put(SOUN ...
package com.o1.android.view; import java.util.ArrayList; import java.util.List; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; /** * This list adapter is derived from the " ...
什么是 sqlite ? sqlite 是一款轻量级的、基于文件的嵌入式数据库,2000年就已经诞生,经过7年多的发展,直到今天已经成为最流行的嵌入式数据库,包括google在内的公司在其桌面软件中亦使用 sqlite 存储用户数据。由此可以看出 ...
public static void ShowPicture(String fileName, ImageView pic){ // Calling Convention // ImageView pic=(ImageView)this.findViewById(R.id.picview); // JBRoutines.ShowPicture(Constants.PICTURE_FILE,pic); File f = new File(Environment.getExternalStorageDirectory(),fileName); FileInputStream is = ...
<ListView android:id=\"@android:id/list\" android:layout_width=\"fill_parent\" android:layout_height=\"fill_parent\" android:stackFromBottom=\"true\" android:transcriptMode=\"alwaysScroll\" />
Display display = ((WindowManager) getSystemService(WINDOW_SERVICE)).getDefaultDisplay(); int width = display.getWidth(); int height = display.getHeight(); int orientation = display.getOrientation();
package com.android.wifitester; import java.util.List; import android.app.Activity; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.net.wifi.ScanResult; import android.net.wifi.WifiManager; i ...
/** == XML Layout == * * <?xml version=\"1.0\" encoding=\"utf-8\"?> * <LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\" * android:orientation=\"vertical\" * android:layout_width=\"fill_parent\" * android:layout_ ...
public Bitmap getRemoteImage(final URL aURL) { try { final URLConnection conn = aURL.openConnection(); conn.connect(); final BufferedInputStream bis = new BufferedInputStream(conn.getInputStream()); final Bitmap bm = BitmapFactory.decodeStream(bis); bis.close(); return bm; } catch (IOExceptio ...
将tomcat注册为系统服务 在dos界面运行tomcat\bin\service.bar install 服务名称 这样就可以了
Global site tag (gtag.js) - Google Analytics