tag:blogger.com,1999:blog-68457581106479758012024-03-04T23:57:27.629-08:00PadiBenihAnonymoushttp://www.blogger.com/profile/14801365119439063593noreply@blogger.comBlogger12125tag:blogger.com,1999:blog-6845758110647975801.post-72850579733974135592015-11-03T06:41:00.000-08:002015-11-03T06:51:12.792-08:00Android Programming - Zoom Image View<div dir="ltr" style="text-align: left;" trbidi="on">
Assalamu'alaikum.<br />
<div>
<br /></div>
<div>
Hari ni aku try satu contoh untuk buat app yg ada fungsi "ZOOM gambar"</div>
<div>
<br /></div>
<div>
Rujukan akau adalah dari link berikut:</div>
<div>
<br /></div>
<div>
http://www.c-sharpcorner.com/UploadFile/88b6e5/multi-touch-panning-pinch-zoom-image-view-in-android-using/.</div>
<div>
<br /></div>
<div>
Aku copy sebiji macam yg dia buat :). Alhamdulillah senang sangat :). Semoga Mr. <a class="userName" href="http://www.c-sharpcorner.com/members/chintan-rathod2" id="ctl00_AboutAuthor1_AuthorName" style="background-color: white; color: #ff6600; cursor: pointer; font-family: BebasNeueRegular; font-size: 26px; outline: none 0px; padding: 0px; text-decoration: none;">Chintan Rathod</a> dipermudahkan urusannya & mendapat hidayah asbab perkongsian ilmu ni.</div>
<div>
<br /></div>
<div>
Berikut adalah coding yg aku copy & paste dlm android project aku. Jgan tanya aku apa maksud setiap line dlm coding tu... aku copy & paste je :)</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
Create hello world android project. Lepas tu create Java class. </div>
<div>
<br /></div>
<div>
<b><span style="color: red; font-family: "arial" , "helvetica" , sans-serif; font-size: large;">TouchImageView</span></b></div>
<div>
<b><span style="color: red; font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><br /></span></b></div>
<div>
<pre style="background-color: white; font-family: 'Courier New'; font-size: 9pt;"><span style="color: navy; font-weight: bold;">package </span>com.hobby.azbiha.besarkanimage;
<span style="color: navy; font-weight: bold;">import </span>android.widget.ImageView;
<span style="color: navy; font-weight: bold;">import </span>android.content.Context;
<span style="color: navy; font-weight: bold;">import </span>android.graphics.Matrix;
<span style="color: navy; font-weight: bold;">import </span>android.graphics.PointF;
<span style="color: navy; font-weight: bold;">import </span>android.graphics.drawable.Drawable;
<span style="color: navy; font-weight: bold;">import </span>android.util.AttributeSet;
<span style="color: navy; font-weight: bold;">import </span>android.util.Log;
<span style="color: navy; font-weight: bold;">import </span>android.view.MotionEvent;
<span style="color: navy; font-weight: bold;">import </span>android.view.ScaleGestureDetector;
<span style="color: navy; font-weight: bold;">import </span>android.view.View;
<span style="color: grey; font-style: italic;">//import android.widget.ImageView;</span><span style="color: grey; font-style: italic;">/**</span><span style="color: grey; font-style: italic;"> * Created by Samsung on 11/3/2015.</span><span style="color: grey; font-style: italic;"> */</span><span style="color: navy; font-weight: bold;">public class </span>TouchImageView <span style="color: navy; font-weight: bold;">extends </span>ImageView {
Matrix <span style="color: #660e7a; font-weight: bold;">matrix</span>;
<span style="color: grey; font-style: italic;">// We can be in one of these 3 states</span><span style="color: grey; font-style: italic;"> </span><span style="color: navy; font-weight: bold;">static final int </span><span style="color: #660e7a; font-style: italic; font-weight: bold;">NONE </span>= <span style="color: blue;">0</span>;
<span style="color: navy; font-weight: bold;">static final int </span><span style="color: #660e7a; font-style: italic; font-weight: bold;">DRAG </span>= <span style="color: blue;">1</span>;
<span style="color: navy; font-weight: bold;">static final int </span><span style="color: #660e7a; font-style: italic; font-weight: bold;">ZOOM </span>= <span style="color: blue;">2</span>;
<span style="color: navy; font-weight: bold;">int </span><span style="color: #660e7a; font-weight: bold;">mode </span>= <span style="color: #660e7a; font-style: italic; font-weight: bold;">NONE</span>;
<span style="color: grey; font-style: italic;">// Remember some things for zooming</span><span style="color: grey; font-style: italic;"> </span>PointF <span style="color: #660e7a; font-weight: bold;">last </span>= <span style="color: navy; font-weight: bold;">new </span>PointF();
PointF <span style="color: #660e7a; font-weight: bold;">start </span>= <span style="color: navy; font-weight: bold;">new </span>PointF();
<span style="color: navy; font-weight: bold;">float </span><span style="color: #660e7a; font-weight: bold;">minScale </span>= <span style="color: blue;">1f</span>;
<span style="color: navy; font-weight: bold;">float </span><span style="color: #660e7a; font-weight: bold;">maxScale </span>= <span style="color: blue;">3f</span>;
<span style="color: navy; font-weight: bold;">float</span>[] <span style="color: #660e7a; font-weight: bold;">m</span>;
<span style="color: navy; font-weight: bold;">int </span><span style="color: #660e7a; font-weight: bold;">viewWidth</span>, <span style="color: #660e7a; font-weight: bold;">viewHeight</span>;
<span style="color: navy; font-weight: bold;">static final int </span><span style="color: #660e7a; font-style: italic; font-weight: bold;">CLICK </span>= <span style="color: blue;">3</span>;
<span style="color: navy; font-weight: bold;">float </span><span style="color: #660e7a; font-weight: bold;">saveScale </span>= <span style="color: blue;">1f</span>;
<span style="color: navy; font-weight: bold;">protected float </span><span style="color: #660e7a; font-weight: bold;">origWidth</span>, <span style="color: #660e7a; font-weight: bold;">origHeight</span>;
<span style="color: navy; font-weight: bold;">int </span><span style="color: #660e7a; font-weight: bold;">oldMeasuredWidth</span>, <span style="color: #660e7a; font-weight: bold;">oldMeasuredHeight</span>;
ScaleGestureDetector <span style="color: #660e7a; font-weight: bold;">mScaleDetector</span>;
Context <span style="color: #660e7a; font-weight: bold;">context</span>;
<span style="color: navy; font-weight: bold;">public </span>TouchImageView(Context context) {
<span style="color: navy; font-weight: bold;">super</span>(context);
sharedConstructing(context);
}
<span style="color: navy; font-weight: bold;">public </span>TouchImageView(Context context, AttributeSet attrs) {
<span style="color: navy; font-weight: bold;">super</span>(context, attrs);
sharedConstructing(context);
}
<span style="color: navy; font-weight: bold;">private void </span>sharedConstructing(Context context) {
<span style="color: navy; font-weight: bold;">super</span>.setClickable(<span style="color: navy; font-weight: bold;">true</span>);
<span style="color: navy; font-weight: bold;">this</span>.<span style="color: #660e7a; font-weight: bold;">context </span>= context;
<span style="color: #660e7a; font-weight: bold;">mScaleDetector </span>= <span style="color: navy; font-weight: bold;">new </span>ScaleGestureDetector(context, <span style="color: navy; font-weight: bold;">new </span>ScaleListener());
<span style="color: #660e7a; font-weight: bold;">matrix </span>= <span style="color: navy; font-weight: bold;">new </span>Matrix();
<span style="color: #660e7a; font-weight: bold;">m </span>= <span style="color: navy; font-weight: bold;">new float</span>[<span style="color: blue;">9</span>];
setImageMatrix(<span style="color: #660e7a; font-weight: bold;">matrix</span>);
setScaleType(ScaleType.<span style="color: #660e7a; font-style: italic; font-weight: bold;">MATRIX</span>);
setOnTouchListener(<span style="color: navy; font-weight: bold;">new </span>OnTouchListener() {
<span style="color: olive;">@Override</span><span style="color: olive;"> </span><span style="color: navy; font-weight: bold;">public boolean </span>onTouch(View v, MotionEvent event) {
<span style="color: #660e7a; font-weight: bold;">mScaleDetector</span>.onTouchEvent(event);
PointF curr = <span style="color: navy; font-weight: bold;">new </span>PointF(event.getX(), event.getY());
<span style="color: navy; font-weight: bold;">switch </span>(event.getAction()) {
<span style="color: navy; font-weight: bold;">case </span>MotionEvent.<span style="color: #660e7a; font-style: italic; font-weight: bold;">ACTION_DOWN</span>:
<span style="color: #660e7a; font-weight: bold;">last</span>.set(curr);
<span style="color: #660e7a; font-weight: bold;">start</span>.set(<span style="color: #660e7a; font-weight: bold;">last</span>);
<span style="color: #660e7a; font-weight: bold;">mode </span>= <span style="color: #660e7a; font-style: italic; font-weight: bold;">DRAG</span>;
<span style="color: navy; font-weight: bold;">break</span>;
<span style="color: navy; font-weight: bold;">case </span>MotionEvent.<span style="color: #660e7a; font-style: italic; font-weight: bold;">ACTION_MOVE</span>:
<span style="color: navy; font-weight: bold;">if </span>(<span style="color: #660e7a; font-weight: bold;">mode </span>== <span style="color: #660e7a; font-style: italic; font-weight: bold;">DRAG</span>) {
<span style="color: navy; font-weight: bold;">float </span>deltaX = curr.<span style="color: #660e7a; font-weight: bold;">x </span>- <span style="color: #660e7a; font-weight: bold;">last</span>.<span style="color: #660e7a; font-weight: bold;">x</span>;
<span style="color: navy; font-weight: bold;">float </span>deltaY = curr.<span style="color: #660e7a; font-weight: bold;">y </span>- <span style="color: #660e7a; font-weight: bold;">last</span>.<span style="color: #660e7a; font-weight: bold;">y</span>;
<span style="color: navy; font-weight: bold;">float </span>fixTransX = getFixDragTrans(deltaX, <span style="color: #660e7a; font-weight: bold;">viewWidth</span>, <span style="color: #660e7a; font-weight: bold;">origWidth </span>* <span style="color: #660e7a; font-weight: bold;">saveScale</span>);
<span style="color: navy; font-weight: bold;">float </span>fixTransY = getFixDragTrans(deltaY, <span style="color: #660e7a; font-weight: bold;">viewHeight</span>, <span style="color: #660e7a; font-weight: bold;">origHeight </span>* <span style="color: #660e7a; font-weight: bold;">saveScale</span>);
<span style="color: #660e7a; font-weight: bold;">matrix</span>.postTranslate(fixTransX, fixTransY);
fixTrans();
<span style="color: #660e7a; font-weight: bold;">last</span>.set(curr.<span style="color: #660e7a; font-weight: bold;">x</span>, curr.<span style="color: #660e7a; font-weight: bold;">y</span>);
}
<span style="color: navy; font-weight: bold;">break</span>;
<span style="color: navy; font-weight: bold;">case </span>MotionEvent.<span style="color: #660e7a; font-style: italic; font-weight: bold;">ACTION_UP</span>:
<span style="color: #660e7a; font-weight: bold;">mode </span>= <span style="color: #660e7a; font-style: italic; font-weight: bold;">NONE</span>;
<span style="color: navy; font-weight: bold;">int </span>xDiff = (<span style="color: navy; font-weight: bold;">int</span>) Math.<span style="font-style: italic;">abs</span>(curr.<span style="color: #660e7a; font-weight: bold;">x </span>- <span style="color: #660e7a; font-weight: bold;">start</span>.<span style="color: #660e7a; font-weight: bold;">x</span>);
<span style="color: navy; font-weight: bold;">int </span>yDiff = (<span style="color: navy; font-weight: bold;">int</span>) Math.<span style="font-style: italic;">abs</span>(curr.<span style="color: #660e7a; font-weight: bold;">y </span>- <span style="color: #660e7a; font-weight: bold;">start</span>.<span style="color: #660e7a; font-weight: bold;">y</span>);
<span style="color: navy; font-weight: bold;">if </span>(xDiff < <span style="color: #660e7a; font-style: italic; font-weight: bold;">CLICK </span>&& yDiff < <span style="color: #660e7a; font-style: italic; font-weight: bold;">CLICK</span>)
performClick();
<span style="color: navy; font-weight: bold;">break</span>;
<span style="color: navy; font-weight: bold;">case </span>MotionEvent.<span style="color: #660e7a; font-style: italic; font-weight: bold;">ACTION_POINTER_UP</span>:
<span style="color: #660e7a; font-weight: bold;">mode </span>= <span style="color: #660e7a; font-style: italic; font-weight: bold;">NONE</span>;
<span style="color: navy; font-weight: bold;">break</span>;
}
setImageMatrix(<span style="color: #660e7a; font-weight: bold;">matrix</span>);
invalidate();
<span style="color: navy; font-weight: bold;">return true</span>; <span style="color: grey; font-style: italic;">// indicate event was handled</span><span style="color: grey; font-style: italic;">
</span><span style="color: grey; font-style: italic;"> </span>}
});
}
<span style="color: navy; font-weight: bold;">public void </span>setMaxZoom(<span style="color: navy; font-weight: bold;">float </span>x) {
<span style="color: #660e7a; font-weight: bold;">maxScale </span>= x;
}
<span style="color: navy; font-weight: bold;">private class </span>ScaleListener <span style="color: navy; font-weight: bold;">extends </span>ScaleGestureDetector.SimpleOnScaleGestureListener {
<span style="color: olive;">@Override</span><span style="color: olive;"> </span><span style="color: navy; font-weight: bold;">public boolean </span>onScaleBegin(ScaleGestureDetector detector) {
<span style="color: #660e7a; font-weight: bold;">mode </span>= <span style="color: #660e7a; font-style: italic; font-weight: bold;">ZOOM</span>;
<span style="color: navy; font-weight: bold;">return true</span>;
}
<span style="color: olive;">@Override</span><span style="color: olive;"> </span><span style="color: navy; font-weight: bold;">public boolean </span>onScale(ScaleGestureDetector detector) {
<span style="color: navy; font-weight: bold;">float </span>mScaleFactor = detector.getScaleFactor();
<span style="color: navy; font-weight: bold;">float </span>origScale = <span style="color: #660e7a; font-weight: bold;">saveScale</span>;
<span style="color: #660e7a; font-weight: bold;">saveScale </span>*= mScaleFactor;
<span style="color: navy; font-weight: bold;">if </span>(<span style="color: #660e7a; font-weight: bold;">saveScale </span>> <span style="color: #660e7a; font-weight: bold;">maxScale</span>) {
<span style="color: #660e7a; font-weight: bold;">saveScale </span>= <span style="color: #660e7a; font-weight: bold;">maxScale</span>;
mScaleFactor = <span style="color: #660e7a; font-weight: bold;">maxScale </span>/ origScale;
} <span style="color: navy; font-weight: bold;">else if </span>(<span style="color: #660e7a; font-weight: bold;">saveScale </span>< <span style="color: #660e7a; font-weight: bold;">minScale</span>) {
<span style="color: #660e7a; font-weight: bold;">saveScale </span>= <span style="color: #660e7a; font-weight: bold;">minScale</span>;
mScaleFactor = <span style="color: #660e7a; font-weight: bold;">minScale </span>/ origScale;
}
<span style="color: navy; font-weight: bold;">if </span>(<span style="color: #660e7a; font-weight: bold;">origWidth </span>* <span style="color: #660e7a; font-weight: bold;">saveScale </span><= <span style="color: #660e7a; font-weight: bold;">viewWidth </span>|| <span style="color: #660e7a; font-weight: bold;">origHeight </span>* <span style="color: #660e7a; font-weight: bold;">saveScale </span><= <span style="color: #660e7a; font-weight: bold;">viewHeight</span>)
<span style="color: #660e7a; font-weight: bold;">matrix</span>.postScale(mScaleFactor, mScaleFactor, <span style="color: #660e7a; font-weight: bold;">viewWidth </span>/ <span style="color: blue;">2</span>, <span style="color: #660e7a; font-weight: bold;">viewHeight </span>/ <span style="color: blue;">2</span>);
<span style="color: navy; font-weight: bold;">else</span><span style="color: navy; font-weight: bold;">
</span><span style="color: navy; font-weight: bold;"> </span><span style="color: #660e7a; font-weight: bold;">matrix</span>.postScale(mScaleFactor, mScaleFactor, detector.getFocusX(), detector.getFocusY());
fixTrans();
<span style="color: navy; font-weight: bold;">return true</span>;
}
}
<span style="color: navy; font-weight: bold;">void </span>fixTrans() {
<span style="color: #660e7a; font-weight: bold;">matrix</span>.getValues(<span style="color: #660e7a; font-weight: bold;">m</span>);
<span style="color: navy; font-weight: bold;">float </span>transX = <span style="color: #660e7a; font-weight: bold;">m</span>[Matrix.<span style="color: #660e7a; font-style: italic; font-weight: bold;">MTRANS_X</span>];
<span style="color: navy; font-weight: bold;">float </span>transY = <span style="color: #660e7a; font-weight: bold;">m</span>[Matrix.<span style="color: #660e7a; font-style: italic; font-weight: bold;">MTRANS_Y</span>];
<span style="color: navy; font-weight: bold;">float </span>fixTransX = getFixTrans(transX, <span style="color: #660e7a; font-weight: bold;">viewWidth</span>, <span style="color: #660e7a; font-weight: bold;">origWidth </span>* <span style="color: #660e7a; font-weight: bold;">saveScale</span>);
<span style="color: navy; font-weight: bold;">float </span>fixTransY = getFixTrans(transY, <span style="color: #660e7a; font-weight: bold;">viewHeight</span>, <span style="color: #660e7a; font-weight: bold;">origHeight </span>* <span style="color: #660e7a; font-weight: bold;">saveScale</span>);
<span style="color: navy; font-weight: bold;">if </span>(fixTransX != <span style="color: blue;">0 </span>|| fixTransY != <span style="color: blue;">0</span>)
<span style="color: #660e7a; font-weight: bold;">matrix</span>.postTranslate(fixTransX, fixTransY);
}
<span style="color: navy; font-weight: bold;">float </span>getFixTrans(<span style="color: navy; font-weight: bold;">float </span>trans, <span style="color: navy; font-weight: bold;">float </span>viewSize, <span style="color: navy; font-weight: bold;">float </span>contentSize) {
<span style="color: navy; font-weight: bold;">float </span>minTrans, maxTrans;
<span style="color: navy; font-weight: bold;">if </span>(contentSize <= viewSize) {
minTrans = <span style="color: blue;">0</span>;
maxTrans = viewSize - contentSize;
} <span style="color: navy; font-weight: bold;">else </span>{
minTrans = viewSize - contentSize;
maxTrans = <span style="color: blue;">0</span>;
}
<span style="color: navy; font-weight: bold;">if </span>(trans < minTrans)
<span style="color: navy; font-weight: bold;">return </span>-trans + minTrans;
<span style="color: navy; font-weight: bold;">if </span>(trans > maxTrans)
<span style="color: navy; font-weight: bold;">return </span>-trans + maxTrans;
<span style="color: navy; font-weight: bold;">return </span><span style="color: blue;">0</span>;
}
<span style="color: navy; font-weight: bold;">float </span>getFixDragTrans(<span style="color: navy; font-weight: bold;">float </span>delta, <span style="color: navy; font-weight: bold;">float </span>viewSize, <span style="color: navy; font-weight: bold;">float </span>contentSize) {
<span style="color: navy; font-weight: bold;">if </span>(contentSize <= viewSize) {
<span style="color: navy; font-weight: bold;">return </span><span style="color: blue;">0</span>;
}
<span style="color: navy; font-weight: bold;">return </span>delta;
}
<span style="color: olive;">@Override</span><span style="color: olive;"> </span><span style="color: navy; font-weight: bold;">protected void </span>onMeasure(<span style="color: navy; font-weight: bold;">int </span>widthMeasureSpec, <span style="color: navy; font-weight: bold;">int </span>heightMeasureSpec) {
<span style="color: navy; font-weight: bold;">super</span>.onMeasure(widthMeasureSpec, heightMeasureSpec);
<span style="color: #660e7a; font-weight: bold;">viewWidth </span>= MeasureSpec.<span style="font-style: italic;">getSize</span>(widthMeasureSpec);
<span style="color: #660e7a; font-weight: bold;">viewHeight </span>= MeasureSpec.<span style="font-style: italic;">getSize</span>(heightMeasureSpec);
<span style="color: grey; font-style: italic;">//</span><span style="color: grey; font-style: italic;"> // Rescales image on rotation</span><span style="color: grey; font-style: italic;"> //</span><span style="color: grey; font-style: italic;"> </span><span style="color: navy; font-weight: bold;">if </span>(<span style="color: #660e7a; font-weight: bold;">oldMeasuredHeight </span>== <span style="color: #660e7a; font-weight: bold;">viewWidth </span>&& <span style="color: #660e7a; font-weight: bold;">oldMeasuredHeight </span>== <span style="color: #660e7a; font-weight: bold;">viewHeight</span><span style="color: #660e7a; font-weight: bold;">
</span><span style="color: #660e7a; font-weight: bold;"> </span>|| <span style="color: #660e7a; font-weight: bold;">viewWidth </span>== <span style="color: blue;">0 </span>|| <span style="color: #660e7a; font-weight: bold;">viewHeight </span>== <span style="color: blue;">0</span>)
<span style="color: navy; font-weight: bold;">return</span>;
<span style="color: #660e7a; font-weight: bold;">oldMeasuredHeight </span>= <span style="color: #660e7a; font-weight: bold;">viewHeight</span>;
<span style="color: #660e7a; font-weight: bold;">oldMeasuredWidth </span>= <span style="color: #660e7a; font-weight: bold;">viewWidth</span>;
<span style="color: navy; font-weight: bold;">if </span>(<span style="color: #660e7a; font-weight: bold;">saveScale </span>== <span style="color: blue;">1</span>) {
<span style="color: grey; font-style: italic;">//Fit to screen.</span><span style="color: grey; font-style: italic;">
</span><span style="color: grey; font-style: italic;"> </span><span style="color: navy; font-weight: bold;">float </span>scale;
Drawable drawable = getDrawable();
<span style="color: navy; font-weight: bold;">if </span>(drawable == <span style="color: navy; font-weight: bold;">null </span>|| drawable.getIntrinsicWidth() == <span style="color: blue;">0 </span>|| drawable.getIntrinsicHeight() == <span style="color: blue;">0</span>)
<span style="color: navy; font-weight: bold;">return</span>;
<span style="color: navy; font-weight: bold;">int </span>bmWidth = drawable.getIntrinsicWidth();
<span style="color: navy; font-weight: bold;">int </span>bmHeight = drawable.getIntrinsicHeight();
Log.<span style="font-style: italic;">d</span>(<span style="color: green; font-weight: bold;">"bmSize"</span>, <span style="color: green; font-weight: bold;">"bmWidth: " </span>+ bmWidth + <span style="color: green; font-weight: bold;">" bmHeight : " </span>+ bmHeight);
<span style="color: navy; font-weight: bold;">float </span>scaleX = (<span style="color: navy; font-weight: bold;">float</span>) <span style="color: #660e7a; font-weight: bold;">viewWidth </span>/ (<span style="color: navy; font-weight: bold;">float</span>) bmWidth;
<span style="color: navy; font-weight: bold;">float </span>scaleY = (<span style="color: navy; font-weight: bold;">float</span>) <span style="color: #660e7a; font-weight: bold;">viewHeight </span>/ (<span style="color: navy; font-weight: bold;">float</span>) bmHeight;
scale = Math.<span style="font-style: italic;">min</span>(scaleX, scaleY);
<span style="color: #660e7a; font-weight: bold;">matrix</span>.setScale(scale, scale);
<span style="color: grey; font-style: italic;">// Center the image</span><span style="color: grey; font-style: italic;">
</span><span style="color: grey; font-style: italic;"> </span><span style="color: navy; font-weight: bold;">float </span>redundantYSpace = (<span style="color: navy; font-weight: bold;">float</span>) <span style="color: #660e7a; font-weight: bold;">viewHeight </span>- (scale * (<span style="color: navy; font-weight: bold;">float</span>) bmHeight);
<span style="color: navy; font-weight: bold;">float </span>redundantXSpace = (<span style="color: navy; font-weight: bold;">float</span>) <span style="color: #660e7a; font-weight: bold;">viewWidth </span>- (scale * (<span style="color: navy; font-weight: bold;">float</span>) bmWidth);
redundantYSpace /= (<span style="color: navy; font-weight: bold;">float</span>) <span style="color: blue;">2</span>;
redundantXSpace /= (<span style="color: navy; font-weight: bold;">float</span>) <span style="color: blue;">2</span>;
<span style="color: #660e7a; font-weight: bold;">matrix</span>.postTranslate(redundantXSpace, redundantYSpace);
<span style="color: #660e7a; font-weight: bold;">origWidth </span>= <span style="color: #660e7a; font-weight: bold;">viewWidth </span>- <span style="color: blue;">2 </span>* redundantXSpace;
<span style="color: #660e7a; font-weight: bold;">origHeight </span>= <span style="color: #660e7a; font-weight: bold;">viewHeight </span>- <span style="color: blue;">2 </span>* redundantYSpace;
setImageMatrix(<span style="color: #660e7a; font-weight: bold;">matrix</span>);
}
fixTrans();
}
}</pre>
<pre style="background-color: white; font-family: 'Courier New'; font-size: 9pt;"></pre>
<pre style="background-color: white; font-family: 'Courier New'; font-size: 9pt;"></pre>
<pre style="background-color: white; font-family: 'Courier New'; font-size: 9pt;"></pre>
<pre style="background-color: white; font-family: 'Courier New'; font-size: 9pt;"><pre style="font-family: 'Courier New'; font-size: 9pt;">Aku copy image file dalam "drawable" folder.</pre>
<pre style="font-family: 'Courier New'; font-size: 9pt;"></pre>
<pre style="font-family: 'Courier New'; font-size: 9pt;"></pre>
</pre>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOMgNaqTEOzYOyzZkuFQNYEGxIvAtAK73jtA31TlAlwKU9-UYzLZOB5BIda_tRcWnilEF1Xc2f8R6e5yFej3U8dixVApWyTQrZY5Cgnda7ozJ9EbxIByPoWnuC2AGkF2PrJc43L70EaEQ/s1600/drawable.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOMgNaqTEOzYOyzZkuFQNYEGxIvAtAK73jtA31TlAlwKU9-UYzLZOB5BIda_tRcWnilEF1Xc2f8R6e5yFej3U8dixVApWyTQrZY5Cgnda7ozJ9EbxIByPoWnuC2AGkF2PrJc43L70EaEQ/s320/drawable.jpg" width="249" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<pre style="background-color: white; font-family: 'Courier New'; font-size: 9pt;"></pre>
<pre style="background-color: white; font-family: 'Courier New'; font-size: 9pt;"></pre>
<pre style="background-color: white; font-family: 'Courier New'; font-size: 9pt;">Last sekali beberapa line java coding dalam MainActivity.java.</pre>
<pre style="background-color: white; font-family: 'Courier New'; font-size: 9pt;">
</pre>
<pre style="background-color: white; font-family: 'Courier New'; font-size: 9pt;">
</pre>
<pre style="background-color: white; font-family: 'Courier New'; font-size: 9pt;"></pre>
<pre style="background-color: white;"><span style="color: red; font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><b>MainActivity.java</b></span></pre>
<pre style="background-color: white; font-family: 'Courier New'; font-size: 9pt;"></pre>
<br />
<pre style="background-color: white;"><pre style="font-family: 'Courier New'; font-size: 9pt;"><span style="color: navy; font-weight: bold;">package </span>com.hobby.azbiha.besarkanimage;
<span style="color: navy; font-weight: bold;">import </span>android.support.v7.app.AppCompatActivity;
<span style="color: navy; font-weight: bold;">import </span>android.os.Bundle;
<span style="color: navy; font-weight: bold;">public class </span>MainActivity <span style="color: navy; font-weight: bold;">extends </span>AppCompatActivity {
<span style="color: olive;">@Override</span><span style="color: olive;"> </span><span style="color: navy; font-weight: bold;">protected void </span>onCreate(Bundle savedInstanceState) {
<span style="color: navy; font-weight: bold;">super</span>.onCreate(savedInstanceState);
<span style="color: grey; font-style: italic;">//setContentView(R.layout.activity_main);</span><span style="color: grey; font-style: italic;"> </span>TouchImageView img = <span style="color: navy; font-weight: bold;">new </span>TouchImageView(<span style="color: navy; font-weight: bold;">this</span>);
img.setImageResource(R.drawable.<span style="color: #660e7a; font-style: italic; font-weight: bold;">faiz</span>);
img.setMaxZoom(<span style="color: blue;">4f</span>);
setContentView(img);
}
}</pre>
<pre style="font-family: 'Courier New'; font-size: 9pt;"></pre>
<pre style="font-family: 'Courier New'; font-size: 9pt;"></pre>
<pre style="font-family: 'Courier New'; font-size: 9pt;"></pre>
<pre style="font-family: 'Courier New'; font-size: 9pt;"></pre>
<pre style="font-family: 'Courier New'; font-size: 9pt;"></pre>
<pre><span style="color: blue; font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><b>Hasilnya Seperti Berikut:</b></span></pre>
<pre><span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><b>
</b></span></pre>
<pre><span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><b>
</b></span></pre>
<pre style="background-color: white;">
</pre>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjT2sv5YWVvVttAGmyktZfYjeKg69FZyWfM0WFS3BIoOh1xdE86liA4TWGMROEX4XaLT-jvK9zzPM29IXW6bOjMfqisobFuaruOjb6xM1utq_DybGC2drauQ41iJSxJnyl_SaiNoxdrRO0/s1600/Screenshot_2015-11-03-22-47-26%255B1%255D.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjT2sv5YWVvVttAGmyktZfYjeKg69FZyWfM0WFS3BIoOh1xdE86liA4TWGMROEX4XaLT-jvK9zzPM29IXW6bOjMfqisobFuaruOjb6xM1utq_DybGC2drauQ41iJSxJnyl_SaiNoxdrRO0/s320/Screenshot_2015-11-03-22-47-26%255B1%255D.jpeg" width="180" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieVeeBYo8O1A68-bYjwP4FLCxO8gIKZsugU7lbcykwY4CxqDhv9lp9KdRPQ51rmrAzkcmc9optbmTU1AgZ_Xun7UI0DujCxXkEWriO-t_udqYd85_W_oRS5K2IlSBEjJDGl6oJ_Hb3rJU/s1600/Screenshot_2015-11-03-22-47-40%255B1%255D.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieVeeBYo8O1A68-bYjwP4FLCxO8gIKZsugU7lbcykwY4CxqDhv9lp9KdRPQ51rmrAzkcmc9optbmTU1AgZ_Xun7UI0DujCxXkEWriO-t_udqYd85_W_oRS5K2IlSBEjJDGl6oJ_Hb3rJU/s320/Screenshot_2015-11-03-22-47-40%255B1%255D.jpeg" width="180" /></a></div>
<pre style="background-color: white;">
</pre>
<pre><span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><b>
</b></span></pre>
<pre><span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><b>
</b></span></pre>
<pre style="font-family: 'Courier New'; font-size: 9pt;"></pre>
</pre>
</div>
</div>
Anonymoushttp://www.blogger.com/profile/14801365119439063593noreply@blogger.com0tag:blogger.com,1999:blog-6845758110647975801.post-55415483053746110122014-11-20T02:13:00.002-08:002015-11-01T00:42:54.926-07:00Android programming - Phone Number Utility<div dir="ltr" style="text-align: left;" trbidi="on">
Click button utk buat call.<br />
<br />
Ini adalah salah satu fungsi dalam app Kad Jemputan aku. Tapi source code Kad Jemputan aku dah hilang :(. Jadi aku kena cari semula semua fungsi2 yang aku guna untuk Kad Jemputan.<br />
<br />
Salah satu fungsi yang aku guna adalah Phone Utility.<br />
<br />
Dari android studio, aku create New Project. Aku guna default source code yang Android Studio generate iaitu "Hello World". Menggunakan source code yang sama, aku tambah beberapa command line untuk Phone Utility. Semua command yg aku tambah di highlighted dengan warna kuning.<br />
<br />
Moga2 ini akan menjadi rujukan aku masa depan & sapa-sapa yang memerlukan. Somoga ada manfaat.<br />
<br />
<br />
<br />
Ada 3 file ni.<br />
<br />
<b><u><span style="color: red; font-family: Arial, Helvetica, sans-serif; font-size: large;">MainActivity.java</span></u></b><br />
<br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;">package com.hobby.azbiha.myapplication;</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;">import android.content.Intent;</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;">import android.net.Uri;</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;">import android.os.Bundle;</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;">import android.support.design.widget.FloatingActionButton;</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;">import android.support.design.widget.Snackbar;</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;">import android.support.v7.app.AppCompatActivity;</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;">import android.support.v7.widget.Toolbar;</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;">import android.view.View;</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;">import android.view.Menu;</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;">import android.view.MenuItem;</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;">import android.widget.Button;</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;">public class MainActivity extends AppCompatActivity<span style="background-color: yellow;"> implements View.OnClickListener</span>{</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> <span style="background-color: yellow;">Button b_Mariam, b_Maslina;</span></span><br />
<span style="background-color: yellow; font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> public static final String MARIAM = "012xxxxxxx";</span><br />
<span style="background-color: yellow; font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> public static final String MASLINA = "01xxxxxxx";</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> </span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> @Override</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> protected void onCreate(Bundle savedInstanceState) {</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> super.onCreate(savedInstanceState);</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> setContentView(R.layout.activity_main);</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> setSupportActionBar(toolbar);</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> <span style="background-color: yellow;"> Button b_Mariam = (Button) findViewById(R.id.btnMariam);</span></span><br />
<span style="background-color: yellow; font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> Button b_Maslina = (Button) findViewById(R.id.btnMaslina);</span><br />
<span style="background-color: yellow; font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> </span><br />
<span style="background-color: yellow;">
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> b_Mariam.setOnClickListener(this);</span></span><br />
<span style="background-color: yellow; font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> b_Maslina.setOnClickListener(this);</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> </span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> fab.setOnClickListener(new View.OnClickListener() {</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> @Override</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> public void onClick(View view) {</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> .setAction("Action", null).show();</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> }</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> });</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> }</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> @Override</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> public boolean onCreateOptionsMenu(Menu menu) {</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> // Inflate the menu; this adds items to the action bar if it is present.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> getMenuInflater().inflate(R.menu.menu_main, menu);</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> return true;</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> }</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> @Override</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> public boolean onOptionsItemSelected(MenuItem item) {</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> // Handle action bar item clicks here. The action bar will</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> // automatically handle clicks on the Home/Up button, so long</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> // as you specify a parent activity in AndroidManifest.xml.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> int id = item.getItemId();</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> //noinspection SimplifiableIfStatement</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> if (id == R.id.action_settings) {</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> return true;</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> }</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> return super.onOptionsItemSelected(item);</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> }</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> <span style="background-color: yellow;"> @Override</span></span><br />
<span style="background-color: yellow; font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> public void onClick(View arg1) {</span><br />
<span style="background-color: yellow; font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> switch (arg1.getId()) {</span><br />
<span style="background-color: yellow; font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> case R.id.btnMariam:</span><br />
<span style="background-color: yellow; font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> Intent b1 = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:" + MainActivity.MARIAM));</span><br />
<span style="background-color: yellow; font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> startActivity(b1);</span><br />
<span style="background-color: yellow; font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> break;</span><br />
<span style="background-color: yellow;"><span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> case R.id.btnMaslina:</span></span><br />
<span style="background-color: yellow; font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> Intent b2 = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:" + MainActivity.MASLINA));</span><br />
<span style="background-color: yellow; font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> startActivity(b2);</span><br />
<span style="background-color: yellow; font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> break;</span><br />
<span style="background-color: yellow;"><span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> }</span></span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> }</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;">}</span><br />
<div>
<br /></div>
<div>
<br /></div>
<div>
<b><span style="color: red; font-family: Arial, Helvetica, sans-serif; font-size: large;">AndroidManifest.xml</span></b></div>
<div>
<br /></div>
<div>
<pre style="font-family: 'Courier New'; font-size: 9pt;"><span style="background-color: white;"><span style="font-style: italic;"><?</span><span style="color: blue; font-weight: bold;">xml version=</span><span style="color: green; font-weight: bold;">"1.0" </span><span style="color: blue; font-weight: bold;">encoding=</span><span style="color: green; font-weight: bold;">"utf-8"</span><span style="font-style: italic;">?></span><<span style="background-color: #e4e4ff; color: navy; font-weight: bold;">manifest</span><span style="color: navy; font-weight: bold;"> </span><span style="color: blue; font-weight: bold;">xmlns:</span><span style="color: #660e7a; font-weight: bold;">android</span><span style="color: blue; font-weight: bold;">=</span><span style="color: green; font-weight: bold;">"http://schemas.android.com/apk/res/android"</span><span style="color: green; font-weight: bold;"> </span><span style="color: blue; font-weight: bold;">package=</span><span style="color: green; font-weight: bold;">"com.hobby.azbiha.myapplication" </span>>
<<span style="color: navy; font-weight: bold;">application</span><span style="color: navy; font-weight: bold;"> </span><span style="color: #660e7a; font-weight: bold;">android</span><span style="color: blue; font-weight: bold;">:allowBackup=</span><span style="color: green; font-weight: bold;">"true"</span><span style="color: green; font-weight: bold;"> </span><span style="color: #660e7a; font-weight: bold;">android</span><span style="color: blue; font-weight: bold;">:icon=</span><span style="color: green; font-weight: bold;">"@mipmap/ic_launcher"</span><span style="color: green; font-weight: bold;"> </span><span style="color: #660e7a; font-weight: bold;">android</span><span style="color: blue; font-weight: bold;">:label=</span><span style="color: green; font-weight: bold;">"@string/app_name"</span><span style="color: green; font-weight: bold;"> </span><span style="color: #660e7a; font-weight: bold;">android</span><span style="color: blue; font-weight: bold;">:supportsRtl=</span><span style="color: green; font-weight: bold;">"true"</span><span style="color: green; font-weight: bold;"> </span><span style="color: #660e7a; font-weight: bold;">android</span><span style="color: blue; font-weight: bold;">:theme=</span><span style="color: green; font-weight: bold;">"@style/AppTheme" </span>>
</span><span style="background-color: yellow;"><<span style="color: navy; font-weight: bold;">uses-permission </span><span style="color: #660e7a; font-weight: bold;">android</span><span style="color: blue; font-weight: bold;">:name=</span><span style="color: green; font-weight: bold;">"android.permission.CALL_PHONE" </span>/>
<<span style="color: navy; font-weight: bold;">uses-permission </span><span style="color: #660e7a; font-weight: bold;">android</span><span style="color: blue; font-weight: bold;">:name=</span><span style="color: green; font-weight: bold;">"android.permission.modify_phone_state" </span>/>
<<span style="color: navy; font-weight: bold;">uses-permission </span><span style="color: #660e7a; font-weight: bold;">android</span><span style="color: blue; font-weight: bold;">:name=</span><span style="color: green; font-weight: bold;">"android.permission.READ_PHONE_STATE" </span>/>
<<span style="color: navy; font-weight: bold;">uses-permission </span><span style="color: #660e7a; font-weight: bold;">android</span><span style="color: blue; font-weight: bold;">:name=</span><span style="color: green; font-weight: bold;">"android.permission.PROCESS_OUTGOING_CALLS" </span>/></span><span style="background-color: white;">
<</span><span style="background-color: white; color: navy; font-weight: bold;">activity</span><span style="background-color: white; color: navy; font-weight: bold;"> </span><span style="background-color: white; color: #660e7a; font-weight: bold;">android</span><span style="background-color: white; color: blue; font-weight: bold;">:name=</span><span style="background-color: white; color: green; font-weight: bold;">".MainActivity"</span><span style="background-color: white; color: green; font-weight: bold;"> </span><span style="background-color: white; color: #660e7a; font-weight: bold;">android</span><span style="background-color: white; color: blue; font-weight: bold;">:label=</span><span style="background-color: white; color: green; font-weight: bold;">"@string/app_name"</span><span style="background-color: white; color: green; font-weight: bold;"> </span><span style="background-color: white; color: #660e7a; font-weight: bold;">android</span><span style="background-color: white; color: blue; font-weight: bold;">:theme=</span><span style="background-color: white; color: green; font-weight: bold;">"@style/AppTheme.NoActionBar" </span><span style="background-color: white;">>
<</span><span style="background-color: white; color: navy; font-weight: bold;">intent-filter</span><span style="background-color: white;">>
<</span><span style="background-color: white; color: navy; font-weight: bold;">action </span><span style="background-color: white; color: #660e7a; font-weight: bold;">android</span><span style="background-color: white; color: blue; font-weight: bold;">:name=</span><span style="background-color: white; color: green; font-weight: bold;">"android.intent.action.MAIN" </span><span style="background-color: white;">/>
<</span><span style="background-color: white; color: navy; font-weight: bold;">category </span><span style="background-color: white; color: #660e7a; font-weight: bold;">android</span><span style="background-color: white; color: blue; font-weight: bold;">:name=</span><span style="background-color: white; color: green; font-weight: bold;">"android.intent.category.LAUNCHER" </span><span style="background-color: white;">/>
</</span><span style="background-color: white; color: navy; font-weight: bold;">intent-filter</span><span style="background-color: white;">>
</</span><span style="background-color: white; color: navy; font-weight: bold;">activity</span><span style="background-color: white;">>
</</span><span style="background-color: white; color: navy; font-weight: bold;">application</span><span style="background-color: white;">>
</</span><span style="background-color: #e4e4ff; color: navy; font-weight: bold;">manifest</span><span style="background-color: white;">></span></pre>
<pre style="background-color: white; font-family: 'Courier New'; font-size: 9pt;">
</pre>
<pre style="background-color: white; font-family: 'Courier New'; font-size: 9pt;">
</pre>
<pre style="background-color: white; font-family: 'Courier New'; font-size: 9pt;">
</pre>
<pre style="background-color: white; font-family: 'Courier New'; font-size: 9pt;"></pre>
<pre style="background-color: white; font-family: 'Courier New'; font-size: 9pt;"></pre>
<pre style="background-color: white;"><b><span style="color: red; font-family: Arial, Helvetica, sans-serif; font-size: large;">activity_main.xml</span></b></pre>
<pre style="background-color: white;"><b><span style="font-family: Arial, Helvetica, sans-serif; font-size: large;">
</span></b></pre>
<pre style="background-color: white; font-family: 'Courier New'; font-size: 9pt;"><pre style="font-family: 'Courier New'; font-size: 9pt;"><span style="font-style: italic;"><?</span><span style="color: blue; font-weight: bold;">xml version=</span><span style="color: green; font-weight: bold;">"1.0" </span><span style="color: blue; font-weight: bold;">encoding=</span><span style="color: green; font-weight: bold;">"utf-8"</span><span style="font-style: italic;">?></span><<span style="color: navy; font-weight: bold;">android.support.design.widget.CoordinatorLayout</span><span style="color: navy; font-weight: bold;"> </span><span style="color: blue; font-weight: bold;">xmlns:</span><span style="color: #660e7a; font-weight: bold;">android</span><span style="color: blue; font-weight: bold;">=</span><span style="color: green; font-weight: bold;">"http://schemas.android.com/apk/res/android"</span><span style="color: green; font-weight: bold;"> </span><span style="color: blue; font-weight: bold;">xmlns:</span><span style="color: #660e7a; font-weight: bold;">app</span><span style="color: blue; font-weight: bold;">=</span><span style="color: green; font-weight: bold;">"http://schemas.android.com/apk/res-auto"</span><span style="color: green; font-weight: bold;"> </span><span style="color: blue; font-weight: bold;">xmlns:</span><span style="color: #660e7a; font-weight: bold;">tools</span><span style="color: blue; font-weight: bold;">=</span><span style="color: green; font-weight: bold;">"http://schemas.android.com/tools" </span><span style="color: #660e7a; font-weight: bold;">android</span><span style="color: blue; font-weight: bold;">:layout_width=</span><span style="color: green; font-weight: bold;">"match_parent"</span><span style="color: green; font-weight: bold;"> </span><span style="color: #660e7a; font-weight: bold;">android</span><span style="color: blue; font-weight: bold;">:layout_height=</span><span style="color: green; font-weight: bold;">"match_parent" </span><span style="color: #660e7a; font-weight: bold;">android</span><span style="color: blue; font-weight: bold;">:fitsSystemWindows=</span><span style="color: green; font-weight: bold;">"true"</span><span style="color: green; font-weight: bold;"> </span><span style="color: #660e7a; font-weight: bold;">tools</span><span style="color: blue; font-weight: bold;">:context=</span><span style="color: green; font-weight: bold;">".MainActivity"</span>>
<<span style="color: navy; font-weight: bold;">android.support.design.widget.AppBarLayout </span><span style="color: #660e7a; font-weight: bold;">android</span><span style="color: blue; font-weight: bold;">:layout_height=</span><span style="color: green; font-weight: bold;">"wrap_content"</span><span style="color: green; font-weight: bold;"> </span><span style="color: #660e7a; font-weight: bold;">android</span><span style="color: blue; font-weight: bold;">:layout_width=</span><span style="color: green; font-weight: bold;">"match_parent" </span><span style="color: #660e7a; font-weight: bold;">android</span><span style="color: blue; font-weight: bold;">:theme=</span><span style="color: green; font-weight: bold;">"@style/AppTheme.AppBarOverlay"</span>>
<<span style="color: navy; font-weight: bold;">android.support.v7.widget.Toolbar </span><span style="color: #660e7a; font-weight: bold;">android</span><span style="color: blue; font-weight: bold;">:id=</span><span style="color: green; font-weight: bold;">"@+id/toolbar"</span><span style="color: green; font-weight: bold;"> </span><span style="color: #660e7a; font-weight: bold;">android</span><span style="color: blue; font-weight: bold;">:layout_width=</span><span style="color: green; font-weight: bold;">"match_parent" </span><span style="color: #660e7a; font-weight: bold;">android</span><span style="color: blue; font-weight: bold;">:layout_height=</span><span style="color: green; font-weight: bold;">"?attr/actionBarSize"</span><span style="color: green; font-weight: bold;"> </span><span style="color: #660e7a; font-weight: bold;">android</span><span style="color: blue; font-weight: bold;">:background=</span><span style="color: green; font-weight: bold;">"?attr/colorPrimary" </span><span style="color: #660e7a; font-weight: bold;">app</span><span style="color: blue; font-weight: bold;">:popupTheme=</span><span style="color: green; font-weight: bold;">"@style/AppTheme.PopupOverlay" </span>/>
</<span style="color: navy; font-weight: bold;">android.support.design.widget.AppBarLayout</span>>
<<span style="color: navy; font-weight: bold;">include </span><span style="color: blue; font-weight: bold;">layout=</span><span style="color: green; font-weight: bold;">"@layout/content_main" </span>/>
<<span style="color: navy; font-weight: bold;">android.support.design.widget.FloatingActionButton </span><span style="color: #660e7a; font-weight: bold;">android</span><span style="color: blue; font-weight: bold;">:id=</span><span style="color: green; font-weight: bold;">"@+id/fab"</span><span style="color: green; font-weight: bold;"> </span><span style="color: #660e7a; font-weight: bold;">android</span><span style="color: blue; font-weight: bold;">:layout_width=</span><span style="color: green; font-weight: bold;">"wrap_content" </span><span style="color: #660e7a; font-weight: bold;">android</span><span style="color: blue; font-weight: bold;">:layout_height=</span><span style="color: green; font-weight: bold;">"wrap_content"</span><span style="color: green; font-weight: bold;"> </span><span style="color: #660e7a; font-weight: bold;">android</span><span style="color: blue; font-weight: bold;">:layout_gravity=</span><span style="color: green; font-weight: bold;">"bottom|end" </span><span style="color: #660e7a; font-weight: bold;">android</span><span style="color: blue; font-weight: bold;">:layout_margin=</span><span style="color: green; font-weight: bold;">"@dimen/fab_margin"</span><span style="color: green; font-weight: bold;"> </span><span style="color: #660e7a; font-weight: bold;">android</span><span style="color: blue; font-weight: bold;">:src=</span><span style="color: green; font-weight: bold;">"@android:drawable/ic_dialog_email" </span>/>
</<span style="color: navy; font-weight: bold;">android.support.design.widget.CoordinatorLayout</span>></pre>
</pre>
<pre style="background-color: white; font-family: 'Courier New'; font-size: 9pt;">
</pre>
<pre style="background-color: white;"><b><span style="color: red; font-family: Arial, Helvetica, sans-serif; font-size: large;">content_main.xml</span></b></pre>
<pre style="background-color: white; font-family: 'Courier New'; font-size: 9pt;">
</pre>
<pre style="background-color: white; font-family: 'Courier New'; font-size: 9pt;">
</pre>
<pre style="font-family: 'Courier New'; font-size: 9pt;"><pre style="font-family: 'Courier New'; font-size: 9pt;"><span style="background-color: white; font-style: italic;"><?</span><span style="background-color: white; color: blue; font-weight: bold;">xml version=</span><span style="background-color: white; color: green; font-weight: bold;">"1.0" </span><span style="background-color: white; color: blue; font-weight: bold;">encoding=</span><span style="background-color: white; color: green; font-weight: bold;">"utf-8"</span><span style="background-color: white; font-style: italic;">?></span><span style="background-color: white;"><</span><span style="background-color: white; color: navy; font-weight: bold;">RelativeLayout </span><span style="background-color: white; color: blue; font-weight: bold;">xmlns:</span><span style="background-color: white; color: #660e7a; font-weight: bold;">android</span><span style="background-color: white; color: blue; font-weight: bold;">=</span><span style="background-color: white; color: green; font-weight: bold;">"http://schemas.android.com/apk/res/android"</span><span style="background-color: white; color: green; font-weight: bold;"> </span><span style="background-color: white; color: blue; font-weight: bold;">xmlns:</span><span style="background-color: white; color: #660e7a; font-weight: bold;">tools</span><span style="background-color: white; color: blue; font-weight: bold;">=</span><span style="background-color: white; color: green; font-weight: bold;">"http://schemas.android.com/tools"</span><span style="background-color: white; color: green; font-weight: bold;"> </span><span style="background-color: white; color: blue; font-weight: bold;">xmlns:</span><span style="background-color: white; color: #660e7a; font-weight: bold;">app</span><span style="background-color: white; color: blue; font-weight: bold;">=</span><span style="background-color: white; color: green; font-weight: bold;">"http://schemas.android.com/apk/res-auto" </span><span style="background-color: white; color: #660e7a; font-weight: bold;">android</span><span style="background-color: white; color: blue; font-weight: bold;">:layout_width=</span><span style="background-color: white; color: green; font-weight: bold;">"match_parent"</span><span style="background-color: white; color: green; font-weight: bold;"> </span><span style="background-color: white; color: #660e7a; font-weight: bold;">android</span><span style="background-color: white; color: blue; font-weight: bold;">:layout_height=</span><span style="background-color: white; color: green; font-weight: bold;">"match_parent" </span><span style="background-color: white; color: #660e7a; font-weight: bold;">android</span><span style="background-color: white; color: blue; font-weight: bold;">:paddingLeft=</span><span style="background-color: white; color: green; font-weight: bold;">"@dimen/activity_horizontal_margin"</span><span style="background-color: white; color: green; font-weight: bold;"> </span><span style="background-color: white; color: #660e7a; font-weight: bold;">android</span><span style="background-color: white; color: blue; font-weight: bold;">:paddingRight=</span><span style="background-color: white; color: green; font-weight: bold;">"@dimen/activity_horizontal_margin"</span><span style="background-color: white; color: green; font-weight: bold;"> </span><span style="background-color: white; color: #660e7a; font-weight: bold;">android</span><span style="background-color: white; color: blue; font-weight: bold;">:paddingTop=</span><span style="background-color: white; color: green; font-weight: bold;">"@dimen/activity_vertical_margin"</span><span style="background-color: white; color: green; font-weight: bold;"> </span><span style="background-color: white; color: #660e7a; font-weight: bold;">android</span><span style="background-color: white; color: blue; font-weight: bold;">:paddingBottom=</span><span style="background-color: white; color: green; font-weight: bold;">"@dimen/activity_vertical_margin"</span><span style="background-color: white; color: green; font-weight: bold;"> </span><span style="background-color: white; color: #660e7a; font-weight: bold;">app</span><span style="background-color: white; color: blue; font-weight: bold;">:layout_behavior=</span><span style="background-color: white; color: green; font-weight: bold;">"@string/appbar_scrolling_view_behavior"</span><span style="background-color: white; color: green; font-weight: bold;"> </span><span style="background-color: white; color: #660e7a; font-weight: bold;">tools</span><span style="background-color: white; color: blue; font-weight: bold;">:showIn=</span><span style="background-color: white; color: green; font-weight: bold;">"@layout/activity_main" </span><span style="background-color: white; color: #660e7a; font-weight: bold;">tools</span><span style="background-color: white; color: blue; font-weight: bold;">:context=</span><span style="background-color: white; color: green; font-weight: bold;">".MainActivity"</span><span style="background-color: white;">>
<</span><span style="background-color: white; color: navy; font-weight: bold;">TextView </span><span style="background-color: white; color: #660e7a; font-weight: bold;">android</span><span style="background-color: white; color: blue; font-weight: bold;">:text=</span><span style="background-color: white; color: green; font-weight: bold;">"Hello World!" </span><span style="background-color: white; color: #660e7a; font-weight: bold;">android</span><span style="background-color: white; color: blue; font-weight: bold;">:layout_width=</span><span style="background-color: white; color: green; font-weight: bold;">"wrap_content"</span><span style="background-color: white; color: green; font-weight: bold;"> </span><span style="background-color: white; color: #660e7a; font-weight: bold;">android</span><span style="background-color: white; color: blue; font-weight: bold;">:layout_height=</span><span style="background-color: white; color: green; font-weight: bold;">"wrap_content"</span><span style="background-color: white; color: green; font-weight: bold;"> </span><span style="background-color: white; color: #660e7a; font-weight: bold;">android</span><span style="background-color: white; color: blue; font-weight: bold;">:id=</span><span style="background-color: white; color: green; font-weight: bold;">"@+id/textView" </span><span style="background-color: white;">/>
</span><span style="background-color: yellow;"><<span style="color: navy; font-weight: bold;">Button</span><span style="color: navy; font-weight: bold;"> </span><span style="color: #660e7a; font-weight: bold;">android</span><span style="color: blue; font-weight: bold;">:layout_width=</span><span style="color: green; font-weight: bold;">"wrap_content"</span><span style="color: green; font-weight: bold;"> </span><span style="color: #660e7a; font-weight: bold;">android</span><span style="color: blue; font-weight: bold;">:layout_height=</span><span style="color: green; font-weight: bold;">"wrap_content"</span><span style="color: green; font-weight: bold;"> </span><span style="color: #660e7a; font-weight: bold;">android</span><span style="color: blue; font-weight: bold;">:text=</span><span style="color: green; font-weight: bold;">"Maslina"</span><span style="color: green; font-weight: bold;"> </span><span style="color: #660e7a; font-weight: bold;">android</span><span style="color: blue; font-weight: bold;">:id=</span><span style="color: green; font-weight: bold;">"@+id/btnMaslina"</span><span style="color: green; font-weight: bold;"> </span><span style="color: #660e7a; font-weight: bold;">android</span><span style="color: blue; font-weight: bold;">:layout_below=</span><span style="color: green; font-weight: bold;">"@+id/textView"</span><span style="color: green; font-weight: bold;"> </span><span style="color: #660e7a; font-weight: bold;">android</span><span style="color: blue; font-weight: bold;">:layout_alignParentLeft=</span><span style="color: green; font-weight: bold;">"true"</span><span style="color: green; font-weight: bold;"> </span><span style="color: #660e7a; font-weight: bold;">android</span><span style="color: blue; font-weight: bold;">:layout_alignParentStart=</span><span style="color: green; font-weight: bold;">"true"</span><span style="color: green; font-weight: bold;"> </span><span style="color: #660e7a; font-weight: bold;">android</span><span style="color: blue; font-weight: bold;">:layout_marginTop=</span><span style="color: green; font-weight: bold;">"34dp" </span>/>
<<span style="color: navy; font-weight: bold;">Button</span><span style="color: navy; font-weight: bold;"> </span><span style="color: #660e7a; font-weight: bold;">android</span><span style="color: blue; font-weight: bold;">:layout_width=</span><span style="color: green; font-weight: bold;">"wrap_content"</span><span style="color: green; font-weight: bold;"> </span><span style="color: #660e7a; font-weight: bold;">android</span><span style="color: blue; font-weight: bold;">:layout_height=</span><span style="color: green; font-weight: bold;">"wrap_content"</span><span style="color: green; font-weight: bold;"> </span><span style="color: #660e7a; font-weight: bold;">android</span><span style="color: blue; font-weight: bold;">:text=</span><span style="color: green; font-weight: bold;">"Mariam"</span><span style="color: green; font-weight: bold;"> </span><span style="color: #660e7a; font-weight: bold;">android</span><span style="color: blue; font-weight: bold;">:id=</span><span style="color: green; font-weight: bold;">"@+id/btnMariam"</span><span style="color: green; font-weight: bold;"> </span><span style="color: #660e7a; font-weight: bold;">android</span><span style="color: blue; font-weight: bold;">:layout_alignTop=</span><span style="color: green; font-weight: bold;">"@+id/textView"</span><span style="color: green; font-weight: bold;"> </span><span style="color: #660e7a; font-weight: bold;">android</span><span style="color: blue; font-weight: bold;">:layout_alignParentLeft=</span><span style="color: green; font-weight: bold;">"true"</span><span style="color: green; font-weight: bold;"> </span><span style="color: #660e7a; font-weight: bold;">android</span><span style="color: blue; font-weight: bold;">:layout_alignParentStart=</span><span style="color: green; font-weight: bold;">"true" </span>/></span><span style="background-color: white;">
</</span><span style="background-color: white; color: navy; font-weight: bold;">RelativeLayout</span><span style="background-color: white;">></span></pre>
</pre>
</div>
<div>
<br />
<span style="color: red; font-family: Arial, Helvetica, sans-serif; font-size: large;"><b>OUTPUT</b></span><br />
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWVvE3iOOM-axudxsy0gm8ZmTj0VtV8tO7-ZBsWfcj3s5U1Zis9F-BEv8wYwy9wX3iICunb_o323CzAu__kA2MJAdbo_QIv3_TN8TcRez_aaBRkR4SP16O1tp4Zfy4edzFo495OaVmLr4/s1600/main+page.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWVvE3iOOM-axudxsy0gm8ZmTj0VtV8tO7-ZBsWfcj3s5U1Zis9F-BEv8wYwy9wX3iICunb_o323CzAu__kA2MJAdbo_QIv3_TN8TcRez_aaBRkR4SP16O1tp4Zfy4edzFo495OaVmLr4/s320/main+page.jpg" width="180" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvarz4oLqgFKt1OZJ6Xs81EJXtZ0JlJ5FLXcb4NEUI-gHn76p4dGe1jfLUrEnNXn8EuodWjW4_pIlYf4hWi_IHHANTgAzzXxUcu7Akrk6DfvQX4x17B1KByCYsDq5V4D6798ARUSebAcY/s1600/phone+utility.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvarz4oLqgFKt1OZJ6Xs81EJXtZ0JlJ5FLXcb4NEUI-gHn76p4dGe1jfLUrEnNXn8EuodWjW4_pIlYf4hWi_IHHANTgAzzXxUcu7Akrk6DfvQX4x17B1KByCYsDq5V4D6798ARUSebAcY/s320/phone+utility.jpg" width="180" /></a></div>
<br /></div>
</div>
Anonymoushttp://www.blogger.com/profile/14801365119439063593noreply@blogger.com0tag:blogger.com,1999:blog-6845758110647975801.post-56295362701813026132013-04-22T21:10:00.000-07:002013-04-22T21:10:18.033-07:00<div dir="ltr" style="text-align: left;" trbidi="on">
Assalamu'alaikum,<div>
<br /></div>
<div>
Hmm... hari ni nak update sikit berkaitan excel macro...</div>
<div>
<br /></div>
<div>
Isteri baru start online business... jual sejadah putih, hand made... </div>
<div>
<br /></div>
<div>
https://www.facebook.com/SejadahPutihByMissmassCollection</div>
<div>
<br /></div>
<div>
Dia minta aku buat simple RESIT template... berkali2 gak dia minta bantuan... tak jalan gakk... last2 dia buat sendiri... heh heh... lps tu baru la aku terhegeh-hegeh nak tolong ... heh heh...</div>
<div>
<br /></div>
<div>
Bila aku "campur tangan"... sooo... start laaa terpikir... takkan nak buat benda niii manually ... hmmm... Mesti nak juga simpan data pelanggan ... toing toing toingg... idea maiii....</div>
<div>
<br /></div>
<div>
Maka terpikir lah aku untuk buat macro (excel macro untuk dia)... InshaAllah dengan macro tu mungkin boleh menyenangkan sedikit kerja di dari segi penyimpanan data pelanggan... Sepatutnya benda2 macam ni lebih baik pakai Ms Access... tp aku tak mahir pakai Access...</div>
<div>
<br /></div>
<div>
So apa yang aku buat adalah...</div>
<div>
<br /></div>
<div>
1- Worksheet untuk masukkan data pelanggan dan senarai sejadah yang dibelinya.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNete16g6UEYWOewHUQRP4yo9MqN6QVI92Cm8AGov9mer0nyXlo1_UXXmAXyWA2D69eQ-7iv5FwDbBGQy1Z_mHSozM6X8Ax32glBAvDbuNhc4-4uYpsU0is7LyYDTqrJfgg6AotbD4LAI/s1600/Antaramuka.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="297" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNete16g6UEYWOewHUQRP4yo9MqN6QVI92Cm8AGov9mer0nyXlo1_UXXmAXyWA2D69eQ-7iv5FwDbBGQy1Z_mHSozM6X8Ax32glBAvDbuNhc4-4uYpsU0is7LyYDTqrJfgg6AotbD4LAI/s640/Antaramuka.jpg" width="640" /></a></div>
<div>
<br /></div>
<div>
2- Data pelanggan dari worksehhet di atas akan dimasukkan kedalam worksheet SenaraiPenuh":</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhR9I3jmr5ChFHMPOCn71VfCae_M0xc1gzHFuaG8gOpzT3MlNsJ8BilxtxHJ93aMis94Iy6AmYoeDUrpf_nX_NiAgNjmGQ5F5kMd7wMAyL6G6rrxouRuwgQl7FwEq0rGPtBSqbWF9TRd68/s1600/Senarai+Penuh.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="298" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhR9I3jmr5ChFHMPOCn71VfCae_M0xc1gzHFuaG8gOpzT3MlNsJ8BilxtxHJ93aMis94Iy6AmYoeDUrpf_nX_NiAgNjmGQ5F5kMd7wMAyL6G6rrxouRuwgQl7FwEq0rGPtBSqbWF9TRd68/s640/Senarai+Penuh.jpg" width="640" /></a></div>
<div>
<br /></div>
<div>
Worksheet ini merupakan rekod pembelian dari pelanggan.</div>
<div>
<br /></div>
<div>
3- Dalam masa yang sama, data pelanggan dari worksheet pertama tadi juga dimasukkan kedalam worksheet "RESIT". Worksheet ini akan diprint dan diselitkan bersama sejadah yang dibeli oleh pelanggan.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj37BGoMGPcsR4Z5q4PaGBxToqW6F3XDIwb9PhWmprCv7YDgJt0DxDyaXOMPNKZx3_8VX-zfwNoDJhf4Z6PTm4FnBlV_HJg4NZW_9ykdpH4udQusYJVSQmWrNuFwKPdPCKbCqYIMh9iVxw/s1600/resit.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="298" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj37BGoMGPcsR4Z5q4PaGBxToqW6F3XDIwb9PhWmprCv7YDgJt0DxDyaXOMPNKZx3_8VX-zfwNoDJhf4Z6PTm4FnBlV_HJg4NZW_9ykdpH4udQusYJVSQmWrNuFwKPdPCKbCqYIMh9iVxw/s640/resit.jpg" width="640" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
Walaubagaimanapun, aku masih ada sedikit masalah lagi. Aku nak protect worksheet SenaraiPenuh tapi masih boleh diedit oleh macro...</div>
<div>
<br /></div>
<div>
Idea aku macam ni:</div>
<div>
- Run macro</div>
<div>
- Macro ambil semua parameter dari worksheet pertama.</div>
<div>
- Macro unprotect worksheet SenaraiPenuh dan isi data pelanggan</div>
<div>
- Macro protect semua worksheet.</div>
<div>
<br /></div>
<div>
Masalahnya macam bila protect/unprotect, excel akan request password utk unprotect/protect worksheet.</div>
<div>
So Macam mana nak bagi macro boleh keyin password yang direquest oleh excel. Hmmmmm...</div>
<div>
<br /></div>
<div>
Itu saja buat masa ni...</div>
<div>
<br /></div>
<div>
Wassalam</div>
<div>
<br /></div>
</div>
Anonymoushttp://www.blogger.com/profile/14801365119439063593noreply@blogger.com0tag:blogger.com,1999:blog-6845758110647975801.post-50882617369259882362013-01-25T01:06:00.000-08:002013-01-25T01:06:00.414-08:00Faraid Calculator Lite (Version 7) is published.<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
Improvement:<br />
- The improvement only for Bahasa Malaysia.<br />
- Allow more numbers of heirs.<br />
- Has a fix amount of nilai harta pusaka in RM25000.<br />
- Add function to show individual portion.<br />
- An email option is disabled from "Bhg Individu".<br />
<br />
Feel free to use it & please give your feedback for any problem or miscalculation. Any suggestion for an improvement are highly appreciated.<br />
<br />
If you think that this is useful, please remember me in your "dua".<br />
<br />
Thanks,<br />
<br />
Brs,<br />
AZH.<br />
</div>
Anonymoushttp://www.blogger.com/profile/14801365119439063593noreply@blogger.com0tag:blogger.com,1999:blog-6845758110647975801.post-37221603292103788262013-01-19T02:50:00.003-08:002013-01-19T02:50:56.725-08:00<div dir="ltr" style="text-align: left;" trbidi="on">
Assalamu'alaikum,<br />
<br />
Hmm dah lama x update status Faraid Calculator Lite....<br />
<br />
Alhamdulillah serta tiada daya dan upaya melainkan dengan izinNya. Minggu ni aku dapat mengemaskinikan calculator tu. Untuk version yang terbaru ni aku telah tambah fungsi untuk paparkan bahagian setiap waris.<br />
Selain dari itu, dari paparan pada bahagian setiap waris itu juga, mempunya "button" email. Dengan menekan button ini, app tersebut akan membuka email app di dalam android handphone/tablet serta mengisi info seperti yang tertera di dalam paparan bahagian individu. Had bilangan waris benarkan melebihi dari satu untuk lain-lain waris selain anak dan had bilangan anak (L) & anak (P) juga dibenarkan melebihi 2.<br />
<br />
Buat masa ini, version terbaru masih belum di upload ke "Google Play". Aku masih berfikir-fikir samada perlu atau tidak untuk aku menjualnya atau masih mengekalkan applikasi ini secara percuma. Harganya tidaklah semahal mana. Harga tersebut merupakan "kos" masa yang aku luangkan untuk menghasilkan app ini serta beberapa manipulasi & formula yang aku perlu buat untuk menghasilkan bahagian waris faraid di dalam bentuk pecahan.<br />
<br />
Memandangkan kebanyakan pengguna applikasi ini (dari statistik) adalah dari Indonesia, Malaysia dan Singapura, maka, aku tumpukan applikasi ini hanya di dalam Bahasa Malaysia. Aku yakin Bahasa Malaysia boleh juga difahami oleh pengguna di Indonesia & Singapura. Sekiranya ada permintaan untuk menukarkannya ke bahasa yang lain, maka barulah aku akan menghasilkannya untuk pengguna yang berbahasa tersebut.<br />
<br />
Di bawah ni aku "tampalkan" "snapshot" untuk Faraid Calculator versi terbaru:<br />
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_qAuE5SlPkoEbgFPx2QYlgKWVfBkqh2M8TSxL8yBy0tiQiaNGye8qZK95v_HUrwsJeXH_bHQjBwLI6XgJyBl4_6o3XovElYApVW8rmMVsNWtg_AeS0YckfZgn86bXZla9o6aIZb9-6n4/s1600/Antaramuka+Utama.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="192" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_qAuE5SlPkoEbgFPx2QYlgKWVfBkqh2M8TSxL8yBy0tiQiaNGye8qZK95v_HUrwsJeXH_bHQjBwLI6XgJyBl4_6o3XovElYApVW8rmMVsNWtg_AeS0YckfZgn86bXZla9o6aIZb9-6n4/s320/Antaramuka+Utama.jpg" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAJ7rhkRvXtywFXh6gk3ictU8mzQVyYLFxqfdOX-gp7Spyqrj6Z-uEjm1fB30shyphenhyphenUZtACKPGBUat5s-Xq95fUzJX74svvhdKa8Il8m2yfOmctuRxE7vcmme4ybqulSEav7aQ2vigAmQtE/s1600/Kira+Bahagian.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="179" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAJ7rhkRvXtywFXh6gk3ictU8mzQVyYLFxqfdOX-gp7Spyqrj6Z-uEjm1fB30shyphenhyphenUZtACKPGBUat5s-Xq95fUzJX74svvhdKa8Il8m2yfOmctuRxE7vcmme4ybqulSEav7aQ2vigAmQtE/s320/Kira+Bahagian.jpg" width="320" /></a></div>
<br />
Paparan utama untuk Faraid Calculator Versi baru (hampir sama dengan V6).<br />
- Tambahan:<br />
- Button "Bhg Individu" : Untuk memaparkan bahagian setiap waris faraid.<br />
- Bahagian "Nilai harta pusaka (RM)". Nilai yang dimasukkan akan diambil kira dan akan dipaparkan di dalam bahagian "Nilai (RM) untuk setiap waris yang berkaitan.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuhICjpUuIuvhKhucLC1s76GoqJdUrLWjh2tRiiQghsOe_QJA3gtoHqbzID0fbmpI4kSW59U3UhOofvwiJHMKAV5HenrH0dFtLdM442flAYg9JYVH9297e9BQ2hLSdRAi5sn8SWpltiMI/s1600/bahagian+Individu.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="193" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuhICjpUuIuvhKhucLC1s76GoqJdUrLWjh2tRiiQghsOe_QJA3gtoHqbzID0fbmpI4kSW59U3UhOofvwiJHMKAV5HenrH0dFtLdM442flAYg9JYVH9297e9BQ2hLSdRAi5sn8SWpltiMI/s320/bahagian+Individu.jpg" width="320" /></a></div>
<br />
Paparan Srtiap Individu merupakan paparan bahagian yang akan diperolehi oleh setiap waris.<br />
Bahagian yang dipaprkan boleh di-email dengan menekan "button" E-mail.<br />
<br />
<br />
<br />
Setakat ini dulu buat masa ni.<br />
<br />
Wassalam.<br />
<br />
~ AZH ~<br />
<br />
<br />
<br /></div>
Anonymoushttp://www.blogger.com/profile/14801365119439063593noreply@blogger.com0tag:blogger.com,1999:blog-6845758110647975801.post-68466518441445343022012-11-23T22:06:00.001-08:002012-11-23T22:06:08.766-08:00<div dir="ltr" style="text-align: left;" trbidi="on">
Sedikit update.<div>
<br /></div>
<div>
Hari ni aku buat random checking untuk Faraid Calculator aku.</div>
<div>
<br /></div>
<div>
Dari hasil ujian... kelihatannya semua kombinasi waris seolah2 berfungsi dengan betul & belum jumpa sebarang problem lagi. Walaubagaimana pun ujian akan diteruskan.</div>
<div>
<br /></div>
<div>
Hari ni juga aku menambah baik layout untuk faraid calculator tuu...</div>
<div>
<br /></div>
<div>
Alhamdulillah aku jumpa satu link untuk android coding yang berkaitan dengan apa yang aku cari (draw line utk table layout)...</div>
<div>
<br /></div>
<div>
linknya adalah seperti dibawah:</div>
<div>
<br /></div>
<div>
http://blog.intelligenia.com/2012/02/programacion-movil-en-android.html#more</div>
<div>
<br /></div>
<div>
http://stackoverflow.com/questions/2108456/how-can-i-create-a-table-with-borders-in-android.</div>
<div>
<br /></div>
<div>
<br /></div>
</div>
Anonymoushttp://www.blogger.com/profile/14801365119439063593noreply@blogger.com0tag:blogger.com,1999:blog-6845758110647975801.post-8901721909285141332012-11-04T19:53:00.001-08:002012-11-04T20:02:29.278-08:00<div dir="ltr" style="text-align: left;" trbidi="on">
Assalamu3alaikum Ustaz2 dan pakar2 pembahagian faraid,<br />
<br />
Jika menggunakan android gadjet... nak minta bantuan untuk test app niii (kalkulator untuk pembahagian faraid)...<br />
<br />
Tapi dlm versi ni... cuma boleh kira pembahagian dari suami/isteri, anak, ibu dan bapa sahaja. Yang lain2 tu inshaAllah akan ditambah dari masa ke semasa. Tapi sebelum tu... nak kena tambah2 ilmu lagi pasal pembahagian faraid nii... agar dengan itu applikasi ini dapat memberi menfaat kepada yang memrlukan. InshaAllah.<br />
<br />
Link applikasi:<br />
<br />
<a href="https://play.google.com/store/apps/details?id=com.padibenih.fcv2&feature=search_result#?t=W251bGwsMSwyLDEsImNvbS5wYWRpYmVuaWguZmN2MiJd">https://play.google.com/store/apps/details?id=com.padibenih.fcv2&feature=search_result#?t=W251bGwsMSwyLDEsImNvbS5wYWRpYmVuaWguZmN2MiJd</a><br />
<br />
Diharap dapat memberi komen untuk menambah baik applikasi ini.<br />
<br />
JazakAllah.<br />
<br />
AZH.</div>
Anonymoushttp://www.blogger.com/profile/14801365119439063593noreply@blogger.com0tag:blogger.com,1999:blog-6845758110647975801.post-86520961381105812472012-11-04T07:24:00.000-08:002012-11-04T07:24:18.716-08:00<div dir="ltr" style="text-align: left;" trbidi="on">
Assalamu3alaikum.<br />
<br />
InshaAllah, the new & improve version of Faraid Calculator Lite will be available in Google Play tomorrow.<br />
<br />
I wish this version will be more reliable & hopefully no more error such as in the previous version.<br />
<br />
<b>To those who already installed the 1st version. I would like to seek an apology due to many many many manyyyyy problems in the previous version.</b><br />
<b><br /></b>
<b>Hopefully this version is useful.</b><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKFxUQl0QYEy821I_Y-ps3MDr4kh3C-CbDEoCXyC9_m28rlERn74wbzlNqlRN4T_hU8RDMaJgcXcRM757GssCHDbD1UXizx4YDDVYYE05ZxwQ188WUTHnGzlQxTRnucYy3bsDWwgRqF3Q/s1600/bm.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKFxUQl0QYEy821I_Y-ps3MDr4kh3C-CbDEoCXyC9_m28rlERn74wbzlNqlRN4T_hU8RDMaJgcXcRM757GssCHDbD1UXizx4YDDVYYE05ZxwQ188WUTHnGzlQxTRnucYy3bsDWwgRqF3Q/s320/bm.jpg" width="213" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFfisrBw0WyF3aA1gzbYXAf4ltiQPwi1oYuRupejzbj3LNET106Zz1mCVIbTAS0KnmI6Ae-1r6Jw6uERFTK2JV4jFe0_eMv4v-U3y9ZWYzMw87jRC11GsrRppgLccrv-7d62XrQ3LDqWQ/s1600/result.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFfisrBw0WyF3aA1gzbYXAf4ltiQPwi1oYuRupejzbj3LNET106Zz1mCVIbTAS0KnmI6Ae-1r6Jw6uERFTK2JV4jFe0_eMv4v-U3y9ZWYzMw87jRC11GsrRppgLccrv-7d62XrQ3LDqWQ/s320/result.jpg" width="213" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
Please feel free to install it & your comment is very much appreciated.</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
Wassalam.</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
AZH.</div>
<br /></div>
Anonymoushttp://www.blogger.com/profile/14801365119439063593noreply@blogger.com0tag:blogger.com,1999:blog-6845758110647975801.post-59615982253742182652012-10-19T19:46:00.001-07:002012-10-19T19:46:29.248-07:00<div dir="ltr" style="text-align: left;" trbidi="on">
Alhamdulillah,<br />
<br />
Now the Faraid Calculator (Lite) can be download from google play.<br />
<br />
<a href="https://play.google.com/store/search?q=faraid&c=apps">https://play.google.com/store/search?q=faraid&c=apps</a><br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEij4Q4wid9TgsU4OQvHoEU8eXKWEoNe6_i98Rz3bMPRXIHQpXr9wXu63or2a5w6L6PRoy2bjCk1pVDhD5hKgtHSLngCzLUqEvGw5Fho6BQRjzyWrYQ3Ada04T6QQ4CxfqvLMdxQpIsE_zg/s1600/fc_icon_1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEij4Q4wid9TgsU4OQvHoEU8eXKWEoNe6_i98Rz3bMPRXIHQpXr9wXu63or2a5w6L6PRoy2bjCk1pVDhD5hKgtHSLngCzLUqEvGw5Fho6BQRjzyWrYQ3Ada04T6QQ4CxfqvLMdxQpIsE_zg/s320/fc_icon_1.png" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDIjWrP74aR33A243Z1qEAOvG8_TdMOCmddAD29hrsPknGfakWLstbe9E6rWU85Ph_RjRnWU3CdpQXmtZVnCT-nHNb3Hh3-89bFANyTxj14QdB892YKi1PdGjHh4jACdY122rH7gkKXXQ/s1600/Faraid+Calculator+-+interface+BI.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDIjWrP74aR33A243Z1qEAOvG8_TdMOCmddAD29hrsPknGfakWLstbe9E6rWU85Ph_RjRnWU3CdpQXmtZVnCT-nHNb3Hh3-89bFANyTxj14QdB892YKi1PdGjHh4jACdY122rH7gkKXXQ/s320/Faraid+Calculator+-+interface+BI.jpg" width="213" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXIMpUGc9mJvN9GIE019oIn63SdwJO33FEOu7K_9XrBcBBGJupsgZW9l-jQrLrkTUhgW0tr6V0NtNZZLSL0H5AQaxL5DxX7I_89CPzhcym7p88qJkyRn2izRQvvwsI4E6WxJEfw9U277g/s1600/FCL+Interface+BM.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXIMpUGc9mJvN9GIE019oIn63SdwJO33FEOu7K_9XrBcBBGJupsgZW9l-jQrLrkTUhgW0tr6V0NtNZZLSL0H5AQaxL5DxX7I_89CPzhcym7p88qJkyRn2izRQvvwsI4E6WxJEfw9U277g/s320/FCL+Interface+BM.jpg" width="213" /></a></div>
<br />
<br />
Please have a look & comments for are highly appreciated.<br />
<br />
Wassalam.<br />
<br />
AZH.</div>
Anonymoushttp://www.blogger.com/profile/14801365119439063593noreply@blogger.com4tag:blogger.com,1999:blog-6845758110647975801.post-29362163875391168882012-10-18T10:12:00.001-07:002012-10-18T10:12:55.758-07:00Faraid Calculator (Web Version).<div dir="ltr" style="text-align: left;" trbidi="on">
Please go to this URL.<br />
<br />
<a href="http://maths.usm.my/faraid/msl/default.html">http://maths.usm.my/faraid/msl/default.html</a><br />
<br />
This is one of my references.<br />
<br />
Wassalam.<br />
<br />
AZH.</div>
Anonymoushttp://www.blogger.com/profile/14801365119439063593noreply@blogger.com0tag:blogger.com,1999:blog-6845758110647975801.post-80047274808651364342012-10-17T00:42:00.001-07:002012-10-17T00:42:06.420-07:00Faraid Calculator Lite for android preparation<div dir="ltr" style="text-align: left;" trbidi="on">
Semalam aku menyusun semula coding untuk eclipse supaya lebih tersusun dan mudah diedit.<br />
<br />
Secara kasarnya, "coding" tersebut disusun dengan module sebegini:<br />
<br />
<b>Module 1</b>- Masukkan bilangan waris<br />
<br />
<b>Module 2</b>- Tekan butang (button) Kira.<br />
<br />
apa yang terjadi apabila button Kira ditekan???<br />
<br />
Berikut adalah susunan arahan yang berlaku:<br />
<br />
<b>Module 1 </b>- dapatkan bilangan waris<br />
<b>Module 2 -</b> Dapatkan bahagian setiap waris<br />
<b>Module 3</b>- Dapatkan baki harta setelah ditolak bahagian Ashabul Furud.<br />
- Dapatkan bahagian terkecil bagi bagi satu bahagian.<br />
- Dapatkan nilai bahagian bagi setiap waris masih belum mendapat bahagianny (contoh anak lelaki & perempuan).<br />
<b>Module 4 </b>- Display bahagian pada interface.<br />
<br />
Walaubagaimanapun, fungsi calculator ini masih belum begitu sempurna. Masih banyak lagi yang perlu ditambah & diperbaiki.<br />
<br />
Wassalam.<br />
<br />
AZH.<br />
<br />
Contoh:<br />
Gambar di bawah merupakan snapshot bagi fungsi yang boleh digunakan:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9ffDTZqoE-DtthWdNfx9rBfDtXNguwm_G2pQTwfyDzNbRviE8j1K8g7eHO7DtOiy-rKOC_PLyTToh93jkshWf6wMuI9LxbkBwv3O5xDwn7TnqWA_Z9kWHL0O3gR9cGjVdxDhQ5tuYMiM/s1600/Faraid+Calculator+-+Situasi+yang+belum+sempurna.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9ffDTZqoE-DtthWdNfx9rBfDtXNguwm_G2pQTwfyDzNbRviE8j1K8g7eHO7DtOiy-rKOC_PLyTToh93jkshWf6wMuI9LxbkBwv3O5xDwn7TnqWA_Z9kWHL0O3gR9cGjVdxDhQ5tuYMiM/s320/Faraid+Calculator+-+Situasi+yang+belum+sempurna.jpg" width="191" /></a></div>
<br />
Gambar di bawah merupakan contoh snapshot bagi situasi yang belum boleh berfungsi dengan betul. Tiada value pada kolum yang paling kanan sekali untuk isteri & anak lelaki.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJSXL20H4dGi8oFI9XhekpC3iaZE-zg4EpuPGJA3PYXAfjnsRsFb9nlFm7MQms2A7OCXoXD7Sds49zO7vjjGwsu-8Xwn6wwXQJPMRbrx8clr9OIQUFHJnZKTSmMAAjIQPx3Xd5NzMDHCI/s1600/Faraid+Calculator+-+Situasi+yang+belum+sempurna.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJSXL20H4dGi8oFI9XhekpC3iaZE-zg4EpuPGJA3PYXAfjnsRsFb9nlFm7MQms2A7OCXoXD7Sds49zO7vjjGwsu-8Xwn6wwXQJPMRbrx8clr9OIQUFHJnZKTSmMAAjIQPx3Xd5NzMDHCI/s320/Faraid+Calculator+-+Situasi+yang+belum+sempurna.jpg" width="191" /></a></div>
<br />
<br /></div>
Anonymoushttp://www.blogger.com/profile/14801365119439063593noreply@blogger.com1tag:blogger.com,1999:blog-6845758110647975801.post-73955845864616584762012-10-14T08:48:00.000-07:002012-10-14T09:07:26.627-07:00Faraid Calculator for android rekaan sendiri<div dir="ltr" style="text-align: left;" trbidi="on">
Sehingga hari ini (13/10/2012), aku telah berhasil mereka cipta "Faraid Calculator" untuk android hasil ciptaan sendiri berdasarkan ilmu yg ditimba dari youtube & simple training. Akan tetapi masih banyak yang perlu disiapkan. Buat masa ini aku hanga menumpukan kepada kes apabila:<br />
<br />
- Suami meninggal dan meninggalkan waris (isteri, anak & ibu & bapa).<br />
- Aplikasi sudah berfungsi, tetapi masih ada yang perlu diperbaiki (nilai pembahagian asal masih belum "menunjukkan" nilai pecahan yang terkecil). Aku inginkan aplikasi tersebut menunjukkan nilai aplikasi yang terkecil. Sebagai contoh:<br />
<br />
Suami meninggal dan meninggalkan seorang isteri, 3 orang anak lelaki & 3 orang anak perempuan. Maka expected nilainya haruslah seperti dibawah:<br />
<br />
Isteri = 1/8<br />
3 anak lelaki = 7/12<br />
3 anak perempuan = 7/24.<br />
<br />
akan tetapi, didalam aplikasi aku, nilainya adalah begini:<br />
<br />
<br />
Isteri = 1/8<br />
3 anak lelaki = 21/36<br />
3 anak perempuan = 21/72.<br />
<div>
<br />
<br />
<br /></div>
<div>
<b>Masalah aku adalah:</b></div>
<div>
Bagaimana dan apakah command atau formula yang sesuai untuk akau gunakan didalm <a href="http://www.eclipse.org/downloads/">eclipse</a> untuk menjadikan value 21/36 menjadi 7/12 & 21/72 menjadi 7/24. Dari sudut matematiknya, value tersebut hanya perlu dikalikan dengan 3/3, maka, dapatlah nilai seperti yang dikehendaki.</div>
<div>
<br /></div>
<div>
Akan tetapi aku tiada masalah dengan pecahan nombor genap. Contoh:</div>
<div>
<br /></div>
<div>
dari nilai 26/48 boleh dijadikan 13/24 dengan mengunakan <b>for</b> function. Contohnya seperti dibawah:</div>
<div>
<br /></div>
<div>
<div>
<i><span style="color: blue;"> for (int i = 0; i <= 5; i++) {</span></i></div>
<div>
<i><span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>if (nisbah_anak_l % 2 == 0 && bhg_a_l % 2 == 0) {</span></i></div>
<div>
<i><span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>nisbah_anak_l = nisbah_anak_l / 2;</span></i></div>
<div>
<i><span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>bhg_a_l = bhg_a_l / 2;</span></i></div>
<div>
<i><span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}</span></i></div>
<div>
<i><span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>if (nisbah_anak_l % 2 != 0 || bhg_a_l % 2 != 0) {</span></i></div>
<div>
<i><span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>// nisbah_anak_l = nisbah_anak_l/2;</span></i></div>
<div>
<i><span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>// bhg_a_l = bhg_a_l/2;</span></i></div>
<div>
<i><span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>i = 6;</span></i></div>
<div>
<i><span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}</span></i></div>
<div>
<i><span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}</span></i></div>
</div>
<div>
<br /></div>
<div>
Apa ya yang harus aku lakukan untuk menyelesaikan masalah aku ni???<br />
<br />
Inilah contoh interface Faraid Calculator aku:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjamAfD7rWqqvDbiYFfgECVc9yOUOmGo1YoCuQka6ydlFXa9y-X0wfZklSP-ombbDSNtkPizmL5O2BjZd_ZzF9IYXAIxQL_8SLBCNBSuC7bJKIDh1WO7VaDHtrxZ7fySCqzHke8ksqbkn4/s1600/Faraid+Calculator+-+interface.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjamAfD7rWqqvDbiYFfgECVc9yOUOmGo1YoCuQka6ydlFXa9y-X0wfZklSP-ombbDSNtkPizmL5O2BjZd_ZzF9IYXAIxQL_8SLBCNBSuC7bJKIDh1WO7VaDHtrxZ7fySCqzHke8ksqbkn4/s320/Faraid+Calculator+-+interface.jpg" width="191" /></a></div>
<br />
<br />
Doa2kan semoga aku akan berjaya menghasilkannya untuk manfaat ramai. Amin.</div>
<div>
<br /></div>
</div>
Anonymoushttp://www.blogger.com/profile/14801365119439063593noreply@blogger.com2