Pintu Air Bogor Jebol! Jakarta Siaga 1 Banjir

by Agus Hamonangan » Sat, 13 Feb 2010 01:40:24 GMT


Sponsored Links
 Boss bisa di jelaskan pintu air mana yg jebol? (lokasinya di bogor)

sol




-- 
"



Pintu Air Bogor Jebol! Jakarta Siaga 1 Banjir

by Agus Hamonangan » Sat, 13 Feb 2010 01:56:30 GMT


 Saya paham Boss Renner,

Yang saya tanyakan yg jebol, udah cek news kok ga ada yg jebol, apa karena
saya ngantuk ya ...

2010/2/13 Renner Chen <rc.milest...@gmail.com>


-- 
"


Sponsored Links


Pintu Air Bogor Jebol! Jakarta Siaga 1 Banjir

by riki rokhman azis » Sat, 13 Feb 2010 02:00:50 GMT


 Maaf, kata kata "jebol" saya dapet dari sms temen saya yg orang bogor....


Salam

Riki

2010/2/13 Agus Hamonangan <id.andr...@gmail.com>


-- 
"



Pintu Air Bogor Jebol! Jakarta Siaga 1 Banjir

by imron » Sat, 13 Feb 2010 02:04:49 GMT


 kabar terbarunya bukan dah surut
 http://bit.ly/dmu4mu 

< http://bit.ly/dmu4mu> ;





-- 
"



Pintu Air Bogor Jebol! Jakarta Siaga 1 Banjir

by Renner Chen » Sat, 13 Feb 2010 02:06:32 GMT


 Oh maksudnya "jebol"-nya mungkin kalimat bombastis yah bro AH, mungkin saja
artiannya ambang batas normal si air yang sudah >250cm di pintu air
tersebut, ditakutkan akan meluas dan membuat jakarta dapat "hadiah
pre-imlek" hueheehehe....

--
sending from my Android
cyanogen (mod) beta5




Maaf, kata kata "jebol" saya dapet dari sms temen saya yg orang bogor....


Salam

Riki

2010/2/13 Agus Hamonangan <id.andr...@gmail.com>



-- 
"



Other Threads

1. Urgent HELP pls - Video Recording

Hi

Am new to android development , need to build a POC on video record
and saving it in SDcard.  I got some sample in which audio recording
in working but not the video . Could someone help me to solve this
issue .  below are the current code where video is not working .  i
have commented the video related code as it was throwing some error.

Java Code : VideoTest.java

package com.app.test;
/**
 * @author Pankaj
 *
 */
import java.io.File;
import java.io.FileDescriptor;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;

import org.json.JSONException;
import org.json.JSONObject;

import android.app.Activity;
import android.content.ContentResolver;
import android.content.ContentValues;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.graphics.PixelFormat;
import android.hardware.Camera;
import android.media.MediaRecorder;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.os.StatFs;
import android.provider.MediaStore;
import android.provider.MediaStore.Images;
import android.text.format.DateFormat;
import android.util.Log;
import android.view.KeyEvent;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.widget.SimpleCursorAdapter;
/**
 * @author Pankaj
 *
 */
public class VideoTest extends Activity {
        private static final long NO_STORAGE_ERROR = -1L;
        private static final long CANNOT_STAT_ERROR = -2L;
        private static final long LOW_STORAGE_THRESHOLD = 512L * 1024L;

        private static final int STORAGE_STATUS_OK = 0;
        private static final int STORAGE_STATUS_LOW = 1;
        private static final int STORAGE_STATUS_NONE = 2;

        private static final boolean SWITCH_CAMERA = true;
        private static final boolean SWITCH_VIDEO = false;
        private boolean recording = false;
        private ContentValues mCurrentVideoValues;
        private int mStorageStatus = STORAGE_STATUS_OK;
        private FileDescriptor mCameraVideoFileDescriptor;
        private ContentResolver mContentResolver;
        private MediaRecorder recorder;
        private Context context;
        private ContentValues values = new ContentValues(3);

        private SurfaceView preview=null;
        private SurfaceHolder previewHolder=null;
        private Camera camera=null;


        public void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                try {
                        setContentView(R.layout.camera);
                        preview=(SurfaceView)findViewById(R.id.surface);
                        // Hide the window title.
                        previewHolder=preview.getHolder();
                        previewHolder.addCallback(surfaceCallback);
                        
previewHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
                } catch (Exception e) {
                        e.getMessage();
                }

        }


        public boolean onKeyDown(int keyCode, KeyEvent event)   {
                try {
                        if (keyCode == KeyEvent.KEYCODE_DPAD_CENTER){
                                if (!recording) {
                                        takePicture();
                                        recording = true;
                                }else{
                                        stopRecorder();
                                        finish();
                                }
                                return true;
                        }
                        return super.onKeyDown(keyCode, event);
                } catch (Exception e) {
                        e.getMessage();
                }
                return true;
        }

        private void stopRecorder()     {
                try     {
                        if (recorder == null){
                                return;
                        }
                        recorder.stop();
                        recorder.reset();
                        recorder.release();
                        recording = false;
                        recorder = null;
                } catch (Exception e) {
                        e.getMessage();
                }
                finally {
                        if (recorder != null){
                                recorder.release();
                        }
                }
        }

        private void takePicture() {

                try {
                        recorder = new MediaRecorder();
                    String url = createVideoPath();
                    //Uri base = Uri.parse(url);
                    //Uri uri =  new Uri.Builder().scheme("content").authority
("file").appendPath(url).build();

            //camera.unlock();


                     ContentResolver contentResolver = getContentResolver();
                     Uri mBase = MediaStore.Video.Media.EXTERNAL_CONTENT_URI;
                     Uri newUri = contentResolver.insert(mBase, values);
                     mCameraVideoFileDescriptor = 
contentResolver.openFileDescriptor
(newUri, "rw").getFileDescriptor();
                     Cursor cursor = getContentResolver().query( newUri, null, 
null,
null, null);
                     String path = "";
                     while (cursor.moveToNext()) {
                         path = cursor.getString(1);
                     }
                    // could use setPreviewDisplay() to display a preview to
suitable View here
                      recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
                      
//recorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
                  recorder.setOutputFormat
(MediaRecorder.OutputFormat.THREE_GPP);
                  //recorder.setOutputFile(mCameraVideoFileDescriptor);
                  recorder.setOutputFile(path);
                  //recorder.setVideoFrameRate(15);
                  //recorder.setVideoSize(480, 320);
                  recorder.setAudioEncoder
(MediaRecorder.AudioEncoder.AMR_NB);
                  //recorder.setVideoEncoder
(MediaRecorder.VideoEncoder.H263);
                  //recorder.setPreviewDisplay(previewHolder.getSurface());

                    try {
                        //ecorder.setCamera(camera);
                        recorder.prepare();
                        } catch (Exception e) {
                                e.getMessage();
                        }
                    try {
                        recorder.start();
                        Thread.sleep(100000);
                    recorder.stop();
                    recorder.release();
                        } catch (Exception e) {
                                e.getMessage();
                        }
                } catch (Exception e) {
                        e.getMessage();
                }
        }

        SurfaceHolder.Callback surfaceCallback=new SurfaceHolder.Callback() {
                public void surfaceCreated(SurfaceHolder holder) {
                        camera=Camera.open();

                        try {
                                previewHolder  = holder;
                                camera.setPreviewDisplay(previewHolder);
                        }
                        catch (Throwable t) {
                                Log.e("Photographer","Exception in 
setPreviewDisplay()", t);
                        }
                }

                public void surfaceChanged(SurfaceHolder holder,
                                int format, int width,
                                int height) {
                        Camera.Parameters parameters=camera.getParameters();

                        parameters.setPreviewSize(width, height);
                        parameters.setPictureFormat(PixelFormat.JPEG);
                        camera.setParameters(parameters);
                        camera.startPreview();
                }

                public void surfaceDestroyed(SurfaceHolder holder) {
                        camera.stopPreview();
                        camera.release();
                        camera=null;
                }
        };

        private static final char[] kDigits = { '0', '1', '2', '3', '4', '5',
'6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };

        Camera.PictureCallback photoCallback=new Camera.PictureCallback() {
                public void onPictureTaken(byte[] data, Camera camera) {

                        JSONObject mLocationJSON = new JSONObject();
                        try {
                                mLocationJSON.put("latitude", "lat");

                                mLocationJSON.put("longitude", "long");
                                mLocationJSON.put("date", "date");

                                byte[] imgArray = data;

                                int length = imgArray.length;
                                char[] hex = new char[length * 2];
                                for (int i = 0; i < length; i++) {
                                        int value = (imgArray[i] + 256) % 256;
                                        int highIndex = value >> 4;
                                int lowIndex = value & 0x0f;
                                hex[i * 2 + 0] = kDigits[highIndex];
                                hex[i * 2 + 1] = kDigits[lowIndex];
                                }


                                //mLocationJSON.put("photo", new String(hex));
                                
//Photo.postLocationJSON("http://192.168.2.100:8080/Test/test",
mLocationJSON);
                        } catch (JSONException e) {
                                // TODO Auto-generated catch block
                                e.printStackTrace();
                        }
                        camera.startPreview();
                }
        };


        public String createVideoPath() {
                try {

                        long dateTaken = System.currentTimeMillis();
                        SimpleDateFormat dateFormat = new 
SimpleDateFormat("yyyy-MM-dd-
ss");
                        Date date = new Date(dateTaken);
                        String filepart = dateFormat.format(date);

                        String title = filepart;
                        String displayName = filepart + ".gp3"; // Used when 
emailing.
                        String cameraDirPath = 
Environment.getExternalStorageDirectory
().toString() + "/DCIM";
                        File cameraDir = new File(cameraDirPath);
                        cameraDir.mkdirs();

                        String filename = cameraDirPath + "/" + filepart + 
".3gp";
                        values = new ContentValues(7);
                        
values.put(android.provider.MediaStore.Video.Media.TITLE, title);
                        
values.put(android.provider.MediaStore.Video.Media.DISPLAY_NAME,
displayName);
                        
values.put(android.provider.MediaStore.Video.Media.DATE_TAKEN,
dateTaken);
                        
values.put(android.provider.MediaStore.Video.Media.MIME_TYPE,
"video/3gpp");
                        
values.put(android.provider.MediaStore.Video.Media.DATA, filename);
                        
values.put(android.provider.MediaStore.Video.Media.SIZE, 100000);
                        
values.put(android.provider.MediaStore.Video.Media.DATE_ADDED,
dateTaken);
                        
values.put(android.provider.MediaStore.Video.Media.DESCRIPTION,
displayName);
                        
values.put(android.provider.MediaStore.Video.Media.DURATION,
100000);
                        
values.put(android.provider.MediaStore.Video.Media.RESOLUTION,
100);


                        String mCameraVideoFilename = filename;
                        new File(mCameraVideoFilename).createNewFile();
                        Log.v("Video", "Current camera video filename: " +
mCameraVideoFilename);
                        mCurrentVideoValues = values;
                        return mCameraVideoFilename;
                } catch (Exception e) {
                        e.getMessage();
                }
                return "/sdcard/DCIM/test.mp4";
        }

        private String createName(long dateTaken) {
                return DateFormat.format("yyyy-MM-dd kk.mm.ss", 
dateTaken).toString
();
        }

        private int getStorageStatus(boolean mayHaveSd) {
                long remaining = mayHaveSd ? getAvailableStorage() :
NO_STORAGE_ERROR;
                if (remaining == NO_STORAGE_ERROR) {
                        return STORAGE_STATUS_NONE;
                }
                return remaining < LOW_STORAGE_THRESHOLD
                ? STORAGE_STATUS_LOW
                                : STORAGE_STATUS_OK;
        }

        private long getAvailableStorage() {
                try {
                        if (!hasStorage()) {
                                return NO_STORAGE_ERROR;
                        } else {
                                String storageDirectory =
                                        
Environment.getExternalStorageDirectory().toString();
                                StatFs stat = new StatFs(storageDirectory);
                                return (long) stat.getAvailableBlocks()
                                * (long) stat.getBlockSize();
                        }
                } catch (RuntimeException ex) {
                        // if we can't stat the filesystem then we don't know 
how many
                        // free bytes exist. It might be zero but just leave it
                        // blank since we really don't know.
                        return CANNOT_STAT_ERROR;
                }
        }

        public boolean hasStorage() {
                return hasStorage(true);
        }
        public boolean hasStorage(boolean requireWriteAccess) {
                String state = Environment.getExternalStorageState();

                if (Environment.MEDIA_MOUNTED.equals(state)) {
                        if (requireWriteAccess) {
                                boolean writable = checkFsWritable();
                                return writable;
                        } else {
                                return true;
                        }
                } else if (!requireWriteAccess
                                && 
Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) {
                        return true;
                }
                return false;
        }

        private boolean checkFsWritable() {
                // Create a temporary file to see whether a volume is really
writeable.
                // It's important not to put it in the root directory which may 
have
a
                // limit on the number of files.
                String directoryName =
                        Environment.getExternalStorageDirectory().toString() + 
"/DCIM";
                File directory = new File(directoryName);
                if (!directory.isDirectory()) {
                        if (!directory.mkdirs()) {
                                return false;
                        }
                }
                File f = new File(directoryName, ".probe");
                try {
                        // Remove stale file if any
                        if (f.exists()) {
                                f.delete();
                        }
                        if (!f.createNewFile()) {
                                return false;
                        }
                        f.delete();
                        return true;
                } catch (IOException ex) {
                        return false;
                }
        }
}

layout>camera.xml

<?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_height="fill_parent">
        <SurfaceView android:id="@+id/surface"
                android:layout_width="fill_parent"
android:layout_height="fill_parent">
        </SurfaceView>
        <LinearLayout android:orientation="horizontal"
                android:layout_height="wrap_content"
android:layout_width="fill_parent">
                <Button android:id="@+id/play" 
android:layout_height="wrap_content"
                        android:layout_width="wrap_content" android:text="Play" 
/>
        </LinearLayout>
        <VideoView android:id="@+id/videoView"
                android:layout_width="fill_parent"
android:layout_height="fill_parent">
        </VideoView>
</LinearLayout>

Mainefes xml
==========
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.app.test"
      android:versionCode="1"
      android:versionName="1.0">
    <application android:icon="@drawable/icon" android:label="@string/
app_name">
        <activity android:name=".VideoTest"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category
android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

    </application>
    <uses-sdk android:minSdkVersion="5" />
<uses-permission android:name="android.permission.INTERNET" />
 <uses-permission android:name="android.permission.CAMERA" />
 <uses-permission android:name="android.permission.RECORD_AUDIO" />
 <uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
</manifest>

-- 

2. Adding HeaderView to ListView results in occasional IndexOutOfBoundsException

I add header and footer views to my listview on activity creation:

        public void onCreate(final Bundle savedInstanceState)
        {
                super.onCreate(savedInstanceState);
...
                this.headerView = new TextView(this);
                this.headerView.setText(null);
                getListView().addHeaderView(headerView, null, false);
                this.footerView = new TextView(this);
                this.footerView.setText(null);
                getListView().addFooterView(footerView, null, false);
                setListAdapter(new SimpleAdapter(this, this.application
                                .getListAdapterData(), 
android.R.layout.simple_list_item_2,
                                new String[] { "name", "directions" }, new 
int[] {
                                                android.R.id.text1, 
android.R.id.text2 }));
        }


I only update the text of the views from a Handler:

        private final Handler handler = new Handler() {
                @Override
                public void handleMessage(final Message msg)
                {
...
                        myActivity.this.headerView.setText("some text");
                        myActivity.this.footerView.setText("some other text");
                        final SimpleAdapter simpleAdapter = (SimpleAdapter) 
getListAdapter
();
                        simpleAdapter.notifyDataSetChanged();
                }
        };

Yet maybe 20% of the time, I get an Exception and the activity dies:

Stack Trace:
D/AndroidRuntime(15300): Shutting down VM
W/dalvikvm(15300): threadid=3: thread exiting with uncaught exception
(group=0x4000fe70)
E/AndroidRuntime(15300): Uncaught handler: thread main exiting due to
uncaught exception
E/AndroidRuntime(15300): java.lang.IndexOutOfBoundsException: Invalid
location 0, size is 0
E/AndroidRuntime(15300): at java.util.ArrayList.get(ArrayList.java:
353)
E/AndroidRuntime(15300): at
android.widget.HeaderViewListAdapter.isEnabled
(HeaderViewListAdapter.java:136)
E/AndroidRuntime(15300): at android.widget.ListView.dispatchDraw
(ListView.java:2784)
E/AndroidRuntime(15300): at android.view.View.draw(View.java:5944)
E/AndroidRuntime(15300): at android.widget.AbsListView.draw
(AbsListView.java:2121)
E/AndroidRuntime(15300): at android.view.ViewGroup.drawChild
(ViewGroup.java:1486)
E/AndroidRuntime(15300): at android.view.ViewGroup.dispatchDraw
(ViewGroup.java:1228)
E/AndroidRuntime(15300): at android.view.ViewGroup.drawChild
(ViewGroup.java:1484)
E/AndroidRuntime(15300): at android.view.ViewGroup.dispatchDraw
(ViewGroup.java:1228)
E/AndroidRuntime(15300): at android.view.View.draw(View.java:5841)
E/AndroidRuntime(15300): at android.widget.FrameLayout.draw
(FrameLayout.java:352)
E/AndroidRuntime(15300): at android.view.ViewGroup.drawChild
(ViewGroup.java:1486)
E/AndroidRuntime(15300): at android.view.ViewGroup.dispatchDraw
(ViewGroup.java:1228)
E/AndroidRuntime(15300): at android.view.ViewGroup.drawChild
(ViewGroup.java:1484)
E/AndroidRuntime(15300): at android.view.ViewGroup.dispatchDraw
(ViewGroup.java:1228)
E/AndroidRuntime(15300): at android.view.View.draw(View.java:5841)
E/AndroidRuntime(15300): at android.widget.FrameLayout.draw
(FrameLayout.java:352)
E/AndroidRuntime(15300): at
com.android.internal.policy.impl.PhoneWindow$DecorView.draw
(PhoneWindow.java:1847)
E/AndroidRuntime(15300): at android.view.ViewRoot.draw(ViewRoot.java:
1217)
E/AndroidRuntime(15300): at android.view.ViewRoot.performTraversals
(ViewRoot.java:1030)
E/AndroidRuntime(15300): at android.view.ViewRoot.handleMessage
(ViewRoot.java:1482)
E/AndroidRuntime(15300): at android.os.Handler.dispatchMessage
(Handler.java:99)
E/AndroidRuntime(15300): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime(15300): at android.app.ActivityThread.main
(ActivityThread.java:3948)
E/AndroidRuntime(15300): at java.lang.reflect.Method.invokeNative
(Native Method)
E/AndroidRuntime(15300): at java.lang.reflect.Method.invoke
(Method.java:521)
E/AndroidRuntime(15300): at com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:782)
E/AndroidRuntime(15300): at com.android.internal.os.ZygoteInit.main
(ZygoteInit.java:540)
E/AndroidRuntime(15300): at dalvik.system.NativeStart.main(Native
Method)
I/Process (   59): Sending signal. PID: 15300 SIG: 3

My code is nowhere in that stack trace.
It feels like there may be some synchronization problems in the
backing list or adapter for header and footer views?
This is running on a Donut release.

Thanks for any help
...bjc

-- 

3. show outgoing call dialog while calling

4. Media Player:Plugin in

5. Programmatically switch resource files

6. media recorder error on start

7. Problems with calling method within RemoteViews object