Belajardengan.com merupakan domain blog lama dari delajardengan.blogspot.com. Mohon kritik dan sarannya untuk perkembangan blog ini.
email: blog.tkx.pnp@gmail.com

WebClient - Windows Phone 1

♠ Posted by Unknown in

 WebClient - Windows Phone 1

MainPage.xaml
<phone:PhoneApplicationPage
    x:Class="tesWebClient2.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="True">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
            <TextBlock x:Name="ApplicationTitle" Text="MY APPLICATION" Style="{StaticResource PhoneTextNormalStyle}"/>
            <TextBlock x:Name="PageTitle" Text="page name" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
        </StackPanel>

        <!--ContentPanel - place additional content here-->
        <StackPanel x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            <Button Content="Call WebClient" Width="250" Click="Button_Click" />
            <TextBlock Text="Web Client Target:" Style="{StaticResource PhoneTextNormalStyle}" Foreground="{StaticResource PhoneAccentBrush}" />
            <TextBlock Text="http://www.google.com" TextWrapping="Wrap" Margin="20,0,0,0" x:Name="TextBlockTargetUri" />
            <TextBlock Text="Elapsed Time:" Style="{StaticResource PhoneTextNormalStyle}" Foreground="{StaticResource PhoneAccentBrush}" />
            <TextBox Height="71" Name="textBox1" Text="http://www.google.com" Width="460" />
            <TextBlock Text="tbd" TextWrapping="Wrap" Margin="20,0,0,0" x:Name="TextBlockElapsedTime" />

            <TextBlock Text="WebClient Call Results:" Style="{StaticResource PhoneTextNormalStyle}" Foreground="{StaticResource PhoneAccentBrush}" />
            <TextBlock x:Name="TextBlockResults" Text="results go here" Margin="20,0,0,0" TextWrapping="Wrap"/>
        </StackPanel>
    </Grid>

    <!--Sample code showing usage of ApplicationBar-->
    <!--<phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="Button 1"/>
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png" Text="Button 2"/>
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Text="MenuItem 1"/>
                <shell:ApplicationBarMenuItem Text="MenuItem 2"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>-->

</phone:PhoneApplicationPage>


MainPage.xaml.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;

namespace tesWebClient2
{
    public partial class MainPage : PhoneApplicationPage
    {
        private WebClient m_myWebClient;
        // Constructor
        public MainPage()
        {
            InitializeComponent();
            m_myWebClient = new WebClient();
            m_myWebClient.DownloadStringCompleted += new DownloadStringCompletedEventHandler(myWebClient_DownloadStringCompleted);       
        }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            TextBlockResults.Text = string.Empty;
            m_myWebClient.DownloadStringAsync(new System.Uri(textBox1.Text));
        }
        void myWebClient_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
        {
            TextBlockResults.Text = e.Result;
        }
    }
}
sumber: http://blogs.msdn.com/b/devfish/archive/2011/04/06/webclient-windows-phone-services-consumption-part-1.aspx

Latihan Logika

♠ Posted by Unknown
Latihan logika kali ini adalah array 3D..
berbentuk kubus 10X10X10.... diputar diagonal sebesar 180 derjat dengan titik sumbu 1/2 sisi CG dan 1/2 AE.  Sehingga sudut F menjadi sudut D...

Berikut hasilnya..// tapi masih bingung benar atau salah...

package c;

import java.util.Random;

/**
 *
 * @author Aan
 */
public class bj {
    public static void main(String[] args) {
        // TODO code application logic here
        Random r=new Random();
        int A[][][]=new int[10][10][10];
        int aa=0,bb=0,cc=0;
        for (int i = 0; i < A.length; i++) {

Instal Visual Studio Windows Phone

♠ Posted by Unknown
Bagi rekan-rekan yang ingin belajar pemograman Windows Phone dengan Visual Studio 2010. berikut ane share cara install dan contoh program sedehana Windows Phone..
Yang dibutuhkan adalah:
1. Visual C# 2010
2. SP1 Visual Studio
3. SDK Windows Phone
* OS min Vista atau Windows-7

C++ | contoh soal array

♠ Posted by Unknown in
/*
mis nilai random array 4x5
nilai A
a b c d e
f  g h  i  j
k l m n o
p q r s t

C++ | contoh mencari nilai genab, ganjil, dan modus pada array

♠ Posted by Unknown in
/* data berjumlah 50
berisi nilai random atau acak dari -10 s/d 10
cari nilai genap (1-10)
cari nilai ganjil (1-10)
cari nilai yang paling banyak muncul
 */
#include<iostream>
using namespace std;

int main(){
int iData[50],jlGe=0,jlGa=0;// diasumsikan jumlah array 50 dan diisi random

Tiga hari di Serang

♠ Posted by Unknown in
Kamis sore itu saya mendapatkan sebuah pesan singkat, isinya sangat mengagetkan saya. Karena besoknya jam 5 pagi saya dan teman saya Rahmi Wulan S mendapat kesempatan pergi bersama 2 staf IT Seamolec ke Serang Banten, tepatnya di SMAN1 Cinangka. Setiba di SMAN1 Cinangka kami langsung disambut oleh kepala sekolahnya, dan kami langsung dipersilahkan masuk kesebuah ruang kelas dimana disana kami telah ditunggu oleh 60 lebih kepala sekolah yang datang dari berbagai sekolah yang ada di Kabupaten Serang.  Dan pertemuan dengan kepala-kepala sekolah SMA-SMK

Aplikasi Android Client Server Sederhana (Menu Makanan Indonesia)

♠ Posted by Unknown in
A.       Pengenalan
Aplikasi  Resep Makanan Indonesia merupa aplikasi pencarian resep menu makanan Indonesia berbasis klien server. Berikut skema aplikasinya:


B.       StrukturDatabase
Database
Nama database : ‘mm’
C.       Struktur Program

A.       Sourcecode dan tampilan Aplikasi
1.      MmActivity.java