public void flashOn() { Camera camera = Camera.open(); Camera.Parameters parameters = camera.getParameters(); parameters.setFlashMode(Camera.Parameters.FLASH_MODE_TORCH); camera.setParameters(parameters); camera.startPreview(); } public void flashOff() { Camera camera = Camera.open(); Camera.Parameters parameters = camera.getParameters(); parameters.setFlashMode(Camera.Parameters.ANTIBANDING_OFF..
public void bluetoothOn(int requestCode) { BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter(); //if (!adapter.isEnabled()) adapter.enable(); //if(adapter.getState() == BluetoothAdapter.STATE_TURNING_ON || adapter.getState() == adapter.STATE_ON){ /*Intent intent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE); if (requestCode == 0) activity.startActivity(intent); else activity.s..
void vibrate(int millisecond) { Vibrator vibrator = (Vibrator)getSystemService(Context.VIBRATOR_SERVICE); vibrator.vibrate(millisecond); } void ringtone() { Uri notification = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION); Ringtone ringtone = RingtoneManager.getRingtone(getApplicationContext(), notification); ringtone.play(); }
public void resizeImageView(ImageView imageView, int imageID, int pixelX, int pixelY) { Bitmap bitmap = BitmapFactory.decodeResource(activity.getResources(), imageID); Bitmap bitmap2 = Bitmap.createScaledBitmap(bitmap, pixelX, pixelY, false); imageView.setImageBitmap(bitmap2); }
href링크 title툴팁 name앵커 ... 위로
function beep(wavFile){ wavFile = wavFile || "beep.wav" if (navigator.appName == 'Microsoft Internet Explorer') { var e = document.createElement('BGSOUND'); e.src = wavFile; e.loop =1; document.body.appendChild(e); document.body.removeChild(e); } else { var e = document.createElement('AUDIO'); var src1 = document.createElement('SOURCE'); src1.type= 'audio/wav'; src1.src= wavFile; e.appendChild(s..
$('body').on('focus', '[contenteditable]', function() { var $this = $(this); $this.data('before', $this.html()); return $this; }).on('blur', '[contenteditable]', function() { var $this = $(this); if ($this.data('before') !== $this.html()) { $this.data('before', $this.html()); $this.trigger('change'); } return $this; }); $("div.div_memo").on("change", function() { alert($(this).html()); });