<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1659275078292271790</id><updated>2024-10-25T17:51:52.249+09:00</updated><category term="Android"/><category term="メモ"/><category term="C#"/><category term="DB"/><category term="Java"/><category term="Oracle"/><category term="環境構築"/><category term="Axis2"/><category term="Silverlight"/><category term="入門"/><title type='text'>PG雑記帳</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://cheesecomer.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1659275078292271790/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://cheesecomer.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16433580304011475507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>13</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1659275078292271790.post-3299696927398958431</id><published>2013-02-28T15:52:00.001+09:00</published><updated>2013-02-28T15:57:59.670+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><title type='text'>[Android] ViewPager で、追加・削除を動的にこなしてみる。</title><content type='html'>以下の動作を実現したい！&lt;br /&gt;
&lt;br /&gt;
① FragmentAをFragmentStatePagerAdapterに追加&lt;br /&gt;
② FragmentBをFragmentStatePagerAdapterに追加&lt;br /&gt;
③ FragmentBをFragmentStatePagerAdapterから削除&lt;br /&gt;
④ FragmentCをFragmentStatePagerAdapterに追加&lt;br /&gt;
&lt;br /&gt;
サンプルなんかを見ながら、FragmentStatePagerAdapterを実装してみましたが、&lt;br /&gt;
③までは見た目上は上手くいくが、④を実行すると③で削除したインスタンスが復元してしまいます。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
いろいろ調べた結果、以下のことがわかりました。（勘違いなら指摘ください）&lt;br /&gt;
１． FragmentStatePagerAdapterはFragmentStatePagerAdapter#getItemで生成されたFragmentのインスタンスをメンバフィールドのListに保持している。&lt;br /&gt;
２． FragmentStatePagerAdapter#getItemでいくら別のインスタンスを返却しようとも、置き換わることは&lt;b&gt;ない&lt;/b&gt;&lt;br /&gt;
３． FragmentStatePagerAdapter#instantiateItemの実装として、メンバフィールドの値を返却する。&lt;br /&gt;
&lt;br /&gt;
上記を踏まえた場合、PagerAdapterから実装しないと無理ゲー。&lt;br /&gt;
仕方なく PagerAdapter を実装することにします。&lt;br /&gt;
&lt;br /&gt;
PagerAdapterの実装&lt;br /&gt;
&lt;pre class=&quot;brush:java;&quot;&gt;public class SectionsPagerAdapter  extends PagerAdapter {

    /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
     * Private instance fileds
     *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/

    private final Context context;

    private final List&amp;lt;Section&amp;gt; sections;

    private final FragmentManager fragmentManager;

    private FragmentTransaction currentTransaction = null;

    private ArrayList&amp;lt;Fragment.SavedState&amp;gt; savedStatuses = new ArrayList&amp;lt;Fragment.SavedState&amp;gt;();

    private ArrayList&amp;lt;Fragment&amp;gt; fragments = new ArrayList&amp;lt;Fragment&amp;gt;();

    private Fragment currentPrimaryItem = null;

    /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
     * public constructors
     *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/

    /**
     *
     * @param context
     */
    public SectionsPagerAdapter(Context context, FragmentManager fragmentManager) {
        this.context = context;
        this.sections = new ArrayList&amp;lt;Section&amp;gt;();
        this.fragmentManager = fragmentManager;
    }

    /**
     *
     * @param context
     */
    public SectionsPagerAdapter(Context context, FragmentManager fragmentManager, List&amp;lt;Section&amp;gt; fragmentPages) {
        this.context = context;
        this.sections = fragmentPages;
        this.fragmentManager = fragmentManager;
    }

    /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
     * FragmentStatePagerAdapter methods
     *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/

    public boolean isViewFromObject(View view, Object object) {
        return (((Fragment)object).getView() == view);
    }

    /** */
    @Override
    public int getCount() {
        return this.sections.size();
    }

    /** */
    @Override
    public CharSequence getPageTitle(int position) {
        return this.sections.get(position).getTitle();
    }

    @Override
    public int getItemPosition(Object object) {
        android.util.Log.v(&quot;SectionsPageAdapter&quot;, &quot;getItemPosition&quot;);
        int index = this.fragments.indexOf(object);
        return index != -1 ? index : PagerAdapter.POSITION_NONE;
    }

    @Override
    public void finishUpdate(ViewGroup container) {
        if (this.currentTransaction != null) {
            this.currentTransaction.commitAllowingStateLoss();
            this.currentTransaction = null;
            this.fragmentManager.executePendingTransactions();
        }
    }

    @Override
    public void setPrimaryItem(ViewGroup container, int position, Object object) {
        Fragment fragment = (Fragment) object;
        if (fragment != currentPrimaryItem) {
            if (currentPrimaryItem != null) {
                currentPrimaryItem.setMenuVisibility(false);
            }

            if (fragment != null) {
                fragment.setMenuVisibility(true);
            }

            currentPrimaryItem = fragment;
        }
    }

    @Override
    public Object instantiateItem(ViewGroup container, int position) {
        android.util.Log.v(&quot;SectionsPageAdapter&quot;, &quot;instantiateItem:&quot; + position);
        android.util.Log.v(&quot;SectionsPageAdapter&quot;, &quot;this.fragments.size():&quot; + this.fragments.size());
        if (this.currentTransaction == null) {
            this.currentTransaction = this.fragmentManager.beginTransaction();
        }

        if (this.fragments.size() &amp;gt; position) {
            Fragment fragment = (Fragment)this.fragments.get(position);
            if (fragment != null) {
                return fragment;
            }
        }

        Fragment fragment = this.instantiateFragment(position);
        if (this.savedStatuses.size() &amp;gt; position) {
            Fragment.SavedState fss = this.savedStatuses.get(position);
            if (fss != null) {
                try {
                    fragment.setInitialSavedState(fss);
                } catch (Exception ex) {
                    // Schon aktiv (kA was das heißt xD)
                    ex.printStackTrace();
                }
            }
        }

        while (this.fragments.size() &amp;lt;= position) {
            this.fragments.add(null);
        }

        fragment.setMenuVisibility(false);
        this.fragments.set(position, fragment);
        this.currentTransaction.add(container.getId(), fragment);

        return fragment;
    }

    @Override
    public void destroyItem(ViewGroup container, int position, Object object) {
        android.util.Log.v(&quot;SectionsPageAdapter&quot;, &quot;destroyItem:&quot; + position);

        Fragment fragment = (Fragment)object;

        if (this.currentTransaction == null) {
            this.currentTransaction = this.fragmentManager.beginTransaction();
        }

        //
        /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
         * 削除対象のFragmentがsectionsに存在するかを確認する。
         * 同一であると識別するのは、
         * ・クラス名が一致する
         * ・argumentsが一致する
         * の二点を満たした場合。
         * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
        String fullName = fragment.getClass().getName();
        Bundle arguments = fragment.getArguments();

        boolean isExist = false;
        for (Section section : this.sections) {
            // フラグメントのクラス名が一致するか
            if (section.getFragmentClassName().equals(fullName)) {
                if (section.getArguments() == null &amp;amp;&amp;amp; arguments == null) {
                    // 一致
                    isExist = true;
                } else if (section.getArguments() == null){
                    // NULL で 個数が０なら一致
                    isExist = arguments.keySet().size() == 0;
                } else if (arguments == null){
                    // NULL で 個数が０なら一致
                    isExist = section.getArguments().keySet().size() == 0;
                } else {
                    boolean isKeyMatch = true;

                    // 引数のキーを確認し、一致しない項目を探します。
                    for(String key : section.getArguments().keySet()) {
                        if (!arguments.containsKey(key)) {
                            // キーが欠落
                            isKeyMatch = false;
                            break;
                        }

                        if (!section.getArguments().get(key).equals(arguments.get(key))) {
                            // 値が不一致
                            isKeyMatch = false;
                            break;
                        }
                    }

                    isExist = isKeyMatch;
                }
            }

            // 存在した為、検索を中断する。
            if (isExist) {
                break;
            }
        }


        if (isExist) {
            while (this.savedStatuses.size() &amp;lt;= position) {
                this.savedStatuses.add(null);
            }

            this.savedStatuses.set(position, this.fragmentManager.saveFragmentInstanceState(fragment));

            while (this.fragments.size() &amp;lt;= position) {
                this.fragments.add(null);
            }

            this.fragments.set(position, null);
        } else {
        }

        this.currentTransaction.remove(fragment);
    }

    @Override
    public Parcelable saveState() {
        Bundle state = null;
        if (savedStatuses.size() &amp;gt; 0) {
            state = new Bundle();
            Fragment.SavedState[] fss = new Fragment.SavedState[savedStatuses.size()];
            savedStatuses.toArray(fss);
            state.putParcelableArray(&quot;states&quot;, fss);
        }

        for (int i = 0; i &amp;lt; fragments.size(); i++) {
            Fragment f = fragments.get(i);
            if (f != null) {
                if (state == null) {
                    state = new Bundle();
                }
                String key = &quot;f&quot; + i;
                fragmentManager.putFragment(state, key, f);
            }
        }

        return state;
    }

    @Override
    public void restoreState(Parcelable state, ClassLoader loader) {
        if (state != null) {
            Bundle bundle = (Bundle) state;
            bundle.setClassLoader(loader);
            Parcelable[] fss = bundle.getParcelableArray(&quot;states&quot;);
            savedStatuses.clear();
            fragments.clear();
            if (fss != null) {
                for (int i = 0; i &amp;lt; fss.length; i++) {
                    savedStatuses.add((Fragment.SavedState) fss[i]);
                }
            }
            Iterable&amp;lt;string&amp;gt; keys = bundle.keySet();
            for (String key : keys) {
                if (key.startsWith(&quot;f&quot;)) {
                    int index = Integer.parseInt(key.substring(1));
                    Fragment fragment = fragmentManager.getFragment(bundle, key);
                    if (fragment != null) {
                        while (fragments.size() &amp;lt;= index) {
                            fragments.add(null);
                        }
                        fragment.setMenuVisibility(false);
                        fragments.set(index, fragment);
                    } else {
                        android.util.Log.w(&quot;SectionsPageAdapter&quot;, &quot;Bad fragment at key &quot; + key);
                    }
                }
            }
        }
    }

    /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
     * public methods
     *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/

    /** */
    public Fragment instantiateFragment(int position) {
        if (this.sections.size() &amp;lt; position) {
            return null;
        }

        return Fragment.instantiate(
                this.context,
                this.sections.get(position).getFragmentClassName(),
                this.sections.get(position).getArguments());
    }

    /**
     * Sectionを追加する。
     *
     * @param resId タイトルに使う文字列リソースのID
     * @param fragmentClass フラグメントのクラス
     * @param arguments フラグメントを初期化するためのバンドル
     */
    public void addSection(int resId, Class fragmentClass, Bundle arguments) {
        this.addSection(this.context.getString(resId), fragmentClass, arguments);
    }

    /**
     * Sectionを追加する。
     *
     * @param title タイトル
     * @param fragmentClass フラグメントのクラス
     * @param arguments フラグメントを初期化するためのBundle
     */
    public void addSection(String title, Class fragmentClass, Bundle arguments) {
        this.sections.add(new Section(title, fragmentClass, arguments));

        // 新しくタブが追加されたことを通知しておく
        this.notifyDataSetChanged();
    }

    /**
     * Sectionを削除する
     * @param section 削除するSection
     */
    public void removePage(Section section) {
        if (this.getCount() == 1) { return; }

        int position = this.sections.indexOf(section);

        this.sections.remove(section);

        while (this.savedStatuses.size() &amp;lt;= position) {
            this.savedStatuses.add(null);
        }

        this.savedStatuses.remove(position);

        while (this.fragments.size() &amp;lt;= position) {
            this.fragments.add(null);
        }

        this.fragments.remove(position);

        this.notifyDataSetChanged();
    }

    /**
     * Sectionを削除する
     * @param position 削除するインデックス
     */
    public void removePage(int position) {
        if (this.getCount() == 1) { return; }

        this.sections.remove(position);

        while (this.savedStatuses.size() &amp;lt;= position) {
            this.savedStatuses.add(null);
        }

        this.savedStatuses.remove(position);

        while (this.fragments.size() &amp;lt;= position) {
            this.fragments.add(null);
        }

        this.fragments.remove(position);

        this.notifyDataSetChanged();
    }

    /**
     * 指定したSectionを取得する
     * @param position index
     * @return
     */
    public Section getSection(int position) {
        return this.sections.get(position);
    }

    /**
     * Section情報を全て取得する。
     * @return
     */
    public ArrayList&amp;lt;Section&amp;gt; getSections() {
        int size = this.getCount();
        ArrayList&amp;gt;Section&amp;lt; result = new ArrayList&amp;gt;Section&amp;lt;(size);
        for (int index = 0; index &amp;lt; size; index++) {
            result.add(this.sections.get(index));
        }

        return result;
    }

    /**
     * 指定されたSectionのindexを取得する。
     * @param section indexを取得するSection
     * @return
     */
    public int getSectionPosition(Section section) {
        return this.sections.indexOf(section);
    }
}
&lt;/pre&gt;
&lt;br /&gt;
上記で使用しているデータクラス&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush:java;&quot;&gt;public class Section  implements Parcelable {

    public static final Parcelable.Creator&amp;lt;Section&amp;gt; CREATOR = (
            new Parcelable.Creator&amp;lt;Section&amp;gt;() {
                public Section createFromParcel(Parcel in) {
                    Section result = new Section(in);
                    return result;
                }

                public Section[] newArray(int size) {
                    return new Section[size];
                }
            });

    /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
     * Private instance fields
     *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/

    /**
     * 表示するタイトル
     */
    private String title;

    /**
     * フラグメントのクラス名
     */
    private String fragmentClassName;

    /**
     * フラグメントに設定する引数情報
     */
    private Bundle arguments;

    /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
     * Public Getter/Setter
     *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/

    /**
     * タイトルを取得します。
     * @return
     */
    public String getTitle() {
        return this.title;
    }

    /**
     * フラグメントに設定する引数情報を取得します。
     * @return
     */
    public Bundle getArguments() {
        return this.arguments;
    }

    /**
     * フラグメントのクラス名を取得します。
     */
    public String getFragmentClassName() {
        return this.fragmentClassName;
    }

    /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
     * Private constructors
     *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/

    private Section(Parcel in) {
        this.title = in.readString();
        this.fragmentClassName = in.readString();
        this.arguments = in.readBundle();
    }

    /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
     * public constructors
     *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/

    /**
     *
     * @param title
     * @param fragmentClass
     * @param arguments
     */
    public Section(String title, Class fragmentClass, Bundle arguments) {
        this.title = title;
        this.fragmentClassName = fragmentClass.getName();
        this.arguments = arguments;
    }

    /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
     * Parcelable methods
     *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/

    /** */
    @Override
    public int describeContents() {
        return 0;
    }

    /** */
    @Override
    public void writeToParcel(Parcel out, int flags) {
        out.writeString(this.title);
        out.writeString(this.fragmentClassName);
        out.writeBundle(this.arguments);
    }
}&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
これで追加削除が自由自在！ひゃっはー！&lt;br /&gt;
もっと楽な方法がある気がします。</content><link rel='replies' type='application/atom+xml' href='http://cheesecomer.blogspot.com/feeds/3299696927398958431/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://cheesecomer.blogspot.com/2013/02/android-viewpager.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1659275078292271790/posts/default/3299696927398958431'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1659275078292271790/posts/default/3299696927398958431'/><link rel='alternate' type='text/html' href='http://cheesecomer.blogspot.com/2013/02/android-viewpager.html' title='[Android] ViewPager で、追加・削除を動的にこなしてみる。'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16433580304011475507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1659275078292271790.post-3246599851036010825</id><published>2012-06-20T10:51:00.000+09:00</published><updated>2012-06-20T10:51:08.042+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="メモ"/><category scheme="http://www.blogger.com/atom/ns#" term="入門"/><title type='text'>[Android][入門] DialogにViewを設定する際にDialog規定のテーマを適応する</title><content type='html'>タイトルだけだと何を言ってるかわからないと思います。すみません、日本語が不得手なので。&lt;br /&gt;
&lt;br /&gt;
サクッと本題。&lt;br /&gt;
&lt;br /&gt;
ダイアログにレイアウトファイルから生成したビューを設定するとします。&lt;br /&gt;
&lt;br /&gt;
【レイアウトファイル】&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;pre class=&quot;brush:xml;&quot;&gt;&amp;lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
    android:layout_width=&quot;match_parent&quot;
    android:layout_height=&quot;match_parent&quot;
    android:orientation=&quot;vertical&quot; &amp;gt;
    &amp;lt;TextView
        android:layout_height=&quot;wrap_content&quot;
        android:layout_width=&quot;wrap_content&quot;
        android:text=&quot;Hello !&quot; /&amp;gt;
&amp;lt;/LinearLayout&amp;gt;
&lt;/pre&gt;
&lt;br /&gt;
【MyActivity クラス】&lt;br /&gt;
&lt;pre class=&quot;brush:java;&quot;&gt;public class MyActivity extends Activity {
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        LayoutInflater inflater =
                (LayoutInflater)this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        View view = inflater.inflate(R.layout.sample, null);
        new AlertDialog.Builder(this)
        .setView(view)
        .create()
        .show();
    }
}
&lt;/pre&gt;
&lt;br /&gt;
【AndroidManifest.xml】&lt;br /&gt;
&lt;pre class=&quot;brush:xml;&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;
&amp;lt;manifest xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
    package=&quot;com.goodfornothing.android.test&quot;
    android:versionCode=&quot;1&quot;
    android:versionName=&quot;1.0&quot; &amp;gt;

    &amp;lt;uses-sdk android:minSdkVersion=&quot;8&quot; /&amp;gt;

    &amp;lt;application
        android:icon=&quot;@drawable/ic_launcher&quot;
        android:label=&quot;@string/app_name&quot; &amp;gt;
        &amp;lt;activity
            android:name=&quot;.MyActivity&quot;
            android:label=&quot;@string/app_name&quot;
            android:theme=&quot;@android:style/Theme.Black&quot;&amp;gt;
            &amp;lt;intent-filter&amp;gt;
                &amp;lt;action android:name=&quot;android.intent.action.MAIN&quot; /&amp;gt;
                &amp;lt;category android:name=&quot;android.intent.category.LAUNCHER&quot; /&amp;gt;
            &amp;lt;/intent-filter&amp;gt;
        &amp;lt;/activity&amp;gt;
    &amp;lt;/application&amp;gt;
&amp;lt;/manifest&amp;gt;
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
出力結果はこうなります。
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9kghho1MF6MEvWsOO9fF1hFOGXf3llRj_Qtdtq-6PZgpoQlvj4iU01byxSdEdH_KoeZ-JJkzeToHE4mewmlNJCNH9qXWfLWyNhi8Z_7EHdXaxusm5tvBOKZlbO9ps_l3y4AQS3BhQ49tj/s1600/device-2012-06-20-102146.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9kghho1MF6MEvWsOO9fF1hFOGXf3llRj_Qtdtq-6PZgpoQlvj4iU01byxSdEdH_KoeZ-JJkzeToHE4mewmlNJCNH9qXWfLWyNhi8Z_7EHdXaxusm5tvBOKZlbO9ps_l3y4AQS3BhQ49tj/s320/device-2012-06-20-102146.png&quot; width=&quot;192&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
そりゃそうだという感じ。&lt;br /&gt;
&lt;br /&gt;
ではThemeを&amp;nbsp;@android:style/Theme.Light に変更した場合はどうなるでしょうか。&lt;br /&gt;
&lt;br /&gt;
【AndroidManifest.xml】&lt;br /&gt;
&lt;pre class=&quot;brush:xml;&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;
&amp;lt;manifest xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
    package=&quot;com.goodfornothing.android.test&quot;
    android:versionCode=&quot;1&quot;
    android:versionName=&quot;1.0&quot; &amp;gt;

    &amp;lt;uses-sdk android:minSdkVersion=&quot;8&quot; /&amp;gt;

    &amp;lt;application
        android:icon=&quot;@drawable/ic_launcher&quot;
        android:label=&quot;@string/app_name&quot; &amp;gt;
        &amp;lt;activity
            android:name=&quot;.MyActivity&quot;
            android:label=&quot;@string/app_name&quot;
            android:theme=&quot;@android:style/Theme.Light&quot;&amp;gt;
            &amp;lt;intent-filter&amp;gt;
                &amp;lt;action android:name=&quot;android.intent.action.MAIN&quot; /&amp;gt;
                &amp;lt;category android:name=&quot;android.intent.category.LAUNCHER&quot; /&amp;gt;
            &amp;lt;/intent-filter&amp;gt;
        &amp;lt;/activity&amp;gt;
    &amp;lt;/application&amp;gt;
&amp;lt;/manifest&amp;gt;
&lt;/pre&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNbIeGRaSd3bggCy9lrRW5Trlbner9iIglpg5BK0lIPZ3Vy6LWzQ77hgrNPPQxNiF0sv1bMbfih_jKXsLgY8m8Ftr4HvV2s6k37qrLuGjmT8UOcuqtXC6Lm6T9bGs8WVCNQ-cPyvJk_dpE/s1600/device-2012-06-20-103136.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNbIeGRaSd3bggCy9lrRW5Trlbner9iIglpg5BK0lIPZ3Vy6LWzQ77hgrNPPQxNiF0sv1bMbfih_jKXsLgY8m8Ftr4HvV2s6k37qrLuGjmT8UOcuqtXC6Lm6T9bGs8WVCNQ-cPyvJk_dpE/s320/device-2012-06-20-103136.png&quot; width=&quot;192&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;思ったダイアログと別物です。誰ですか。&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;文字色が暗すぎるため、&lt;/span&gt;なんだかとても見辛くなりました。&lt;br /&gt;
&lt;br /&gt;
これはActivityのThemeの文字色に引きずられているためです。&lt;br /&gt;
AlertDialog#&lt;span style=&quot;background-color: white;&quot;&gt;getLayoutInflater() より取得した&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;LayoutInflater を通して View を生成すると、&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;期待通りのDialogが表示されます。&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
【MyActivity クラス】&lt;br /&gt;
&lt;pre class=&quot;brush:java;&quot;&gt;public class MyActivity extends Activity {
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        AlertDialog dialog = new AlertDialog.Builder(this).create();

        LayoutInflater inflater = dialog.getLayoutInflater();
        View view = inflater.inflate(R.layout.sample, null);

        dialog.setView(view);
        dialog.show();
    }
}
&lt;/pre&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9nLQfwhkOFkrq_-jcxraV5yoyhut-FNRdrqhjMFGm0QCajaC-lzHMi7zWUJKfaoKj-D39C8DDBng_uK5sq0yvEMNwcSUaoAox2XxsQi4JV5ZFB8urhnS2Vl0GpxiQNDpNQXJ5KvlRBeoU/s1600/device-2012-06-20-104311.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9nLQfwhkOFkrq_-jcxraV5yoyhut-FNRdrqhjMFGm0QCajaC-lzHMi7zWUJKfaoKj-D39C8DDBng_uK5sq0yvEMNwcSUaoAox2XxsQi4JV5ZFB8urhnS2Vl0GpxiQNDpNQXJ5KvlRBeoU/s320/device-2012-06-20-104311.png&quot; width=&quot;192&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
期待通りですね。</content><link rel='replies' type='application/atom+xml' href='http://cheesecomer.blogspot.com/feeds/3246599851036010825/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://cheesecomer.blogspot.com/2012/06/android-dialogviewdialog.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1659275078292271790/posts/default/3246599851036010825'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1659275078292271790/posts/default/3246599851036010825'/><link rel='alternate' type='text/html' href='http://cheesecomer.blogspot.com/2012/06/android-dialogviewdialog.html' title='[Android][入門] DialogにViewを設定する際にDialog規定のテーマを適応する'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16433580304011475507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9kghho1MF6MEvWsOO9fF1hFOGXf3llRj_Qtdtq-6PZgpoQlvj4iU01byxSdEdH_KoeZ-JJkzeToHE4mewmlNJCNH9qXWfLWyNhi8Z_7EHdXaxusm5tvBOKZlbO9ps_l3y4AQS3BhQ49tj/s72-c/device-2012-06-20-102146.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1659275078292271790.post-162505264504228741</id><published>2012-06-13T13:56:00.002+09:00</published><updated>2012-06-13T13:56:40.324+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="メモ"/><title type='text'>DPI値を取得する方法</title><content type='html'>// DPI値を取得する&lt;br /&gt;
TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 6, this.getResources().getDisplayMetrics())</content><link rel='replies' type='application/atom+xml' href='http://cheesecomer.blogspot.com/feeds/162505264504228741/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://cheesecomer.blogspot.com/2012/06/dpi.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1659275078292271790/posts/default/162505264504228741'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1659275078292271790/posts/default/162505264504228741'/><link rel='alternate' type='text/html' href='http://cheesecomer.blogspot.com/2012/06/dpi.html' title='DPI値を取得する方法'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16433580304011475507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1659275078292271790.post-3338314342964828149</id><published>2012-06-11T14:41:00.002+09:00</published><updated>2012-06-13T01:24:18.150+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><title type='text'>AndroidでSilverlightのWrapPanel風のViewGroupが欲しい　その２</title><content type='html'>&lt;a href=&quot;http://cheesecomer.blogspot.com/2012/06/androidsilverlightwrappanelviewgroup.html&quot; target=&quot;_blank&quot;&gt;前回&lt;/a&gt;作ったコントロールでは、動的にadd もしくは remove した時に正常に動作しませんでした。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
今回は ViewGroup を直接継承し実装してみました。&lt;br /&gt;
子要素の配置を行うためいに&amp;nbsp;ViewGroup#onLayout&amp;nbsp;をオーバーライドします。&lt;br /&gt;
ここで&amp;nbsp;View#getWidth の戻り値は&amp;nbsp;0　となってしまうため、&amp;nbsp;View#getMeasuredWidthを使用します。&lt;br /&gt;
ですが、素の状態では&amp;nbsp;View#getMeasuredWidth の戻り値も 0 となり、コントロールのサイズを取得できません。&lt;br /&gt;
そこでまず&amp;nbsp;ViewGroup#onMeasure をオーバーライドし子要素に対してView#measureを呼び出します。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
以下の呪文を記述&lt;/div&gt;
&lt;div&gt;
&lt;pre class=&quot;brush:java;&quot;&gt;    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        final int width = View.resolveSize(getSuggestedMinimumWidth(), widthMeasureSpec);
        final int height = View.resolveSize(getSuggestedMinimumHeight(), heightMeasureSpec);
        this.setMeasuredDimension(width, height);

        int childWidthSpec = MeasureSpec.makeMeasureSpec(width, MeasureSpec.UNSPECIFIED);
        int childHeightSpec = MeasureSpec.makeMeasureSpec(height, MeasureSpec.UNSPECIFIED);

        int childCount = getChildCount();
        for (int i = 0; i &amp;lt; childCount; i++) {
            getChildAt(i).measure(childWidthSpec, childHeightSpec);
        }
    }
&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
これを書けば、View#getMeasuredWidthで値が取得できるようになります。&lt;br /&gt;
ちゃんと理解してはいない。&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
あとは前回 View#onWindowFocusChangedのなかに書いてた事をView#onLayoutに記述してやればOK。&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;pre class=&quot;brush:java;&quot;&gt;    @Override
    protected void onLayout(boolean changed, int l, int t, int r, int b) {

        int count = this.getChildCount();

        // 行の高さ
        int rowHeight = 0;

        // 現在の行の幅
        int currentRowWidth = 0;

        int rowMaxWidth = this.getWidth();

        int top = 0;

        for (int i = 0; i &amp;lt; count; i++) {
            View child = this.getChildAt(i);
            if (child.getVisibility() != View.GONE) {

                int childWidth = child.getMeasuredWidth();
                int childHeight = child.getMeasuredHeight();

                if (rowMaxWidth &amp;lt; currentRowWidth + childWidth) {
                    // はみ出すので演算をやり直す。
                    // 次行の位置を設定
                    top += rowHeight &amp;lt; childHeight ? childHeight : rowHeight;
                    // 現在行の高さを初期化
                    rowHeight = 0;
                    // 現在行の幅を初期化
                    currentRowWidth = 0;
                }

                // コントロールを適切な位置に配置
                child.layout(
                    currentRowWidth,
                    top,
                    currentRowWidth + childWidth,
                    top + childHeight);

                // 行の高さを更新する必要があるか
                rowHeight =
                    rowHeight &amp;lt; childHeight ? childHeight : rowHeight;

                // 現在のコントロール幅を合計値に加算する
                currentRowWidth += childWidth;
            }
        }
    }
&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
良い感じ良い感じ。&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
実際にはMarginなんかが設定されるハズ。&lt;br /&gt;
なの以下の クラス をInner Classとして作成。&lt;/div&gt;
&lt;div&gt;
&lt;pre class=&quot;brush:java;&quot;&gt;    public static class LayoutParams extends MarginLayoutParams {

        public LayoutParams(Context context, AttributeSet attr) { super(context, attr); }

        public LayoutParams(int width, int height) { super(width, height); }

        public LayoutParams(ViewGroup.LayoutParams source) { super(source); }

        public LayoutParams(MarginLayoutParams source) { super(source); }
    }
&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
MarginLayoutParams を継承しただけ。今後を考えてInner Classとした。&lt;br /&gt;
このクラスを定義しただけで、(WrapLayout.LayoutParams)child.getLayoutParams() なんてした日には楽しい結末(ClassCastException)が待っているので、 
以下の Method を Override &lt;br /&gt;
&lt;div&gt;
・&amp;nbsp;ViewGroup#generateLayoutParams&lt;br /&gt;
・&amp;nbsp;ViewGroup#generateDefaultLayoutParams&lt;br /&gt;
・&amp;nbsp;ViewGroup#checkLayoutParams&lt;br /&gt;
・&amp;nbsp;ViewGroup#generateLayoutParams&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;pre class=&quot;brush:java;&quot;&gt;    @Override
    public WrapLayout.LayoutParams generateLayoutParams(AttributeSet attrs) {
        return new WrapLayout.LayoutParams(getContext(), attrs);
    }

    @Override
    protected WrapLayout.LayoutParams generateDefaultLayoutParams() {
        return new WrapLayout.LayoutParams(WrapLayout.LayoutParams.WRAP_CONTENT, WrapLayout.LayoutParams.WRAP_CONTENT);
    }

    @Override
    protected boolean checkLayoutParams(ViewGroup.LayoutParams p) {
        return p instanceof WrapLayout.LayoutParams;
    }

    @Override
    protected WrapLayout.LayoutParams generateLayoutParams(ViewGroup.LayoutParams p) {
        return new WrapLayout.LayoutParams(p);
    }
&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
設定された margin を使って配置を行うように ViewGroup#onLayout に修正を加える。&lt;/div&gt;
&lt;div&gt;
&lt;pre class=&quot;brush:java;&quot;&gt;    @Override
    protected void onLayout(boolean changed, int l, int t, int r, int b) {

        int count = this.getChildCount();

        // 行の高さ
        int rowHeight = 0;

        // 現在の行の幅
        int currentRowWidth = 0;

        int rowMaxWidth = this.getWidth();

        int top = 0;

        for (int i = 0; i &amp;lt; count; i++) {
            View child = this.getChildAt(i);
            if (child.getVisibility() != View.GONE) {
                WrapLayout.LayoutParams lp =
                        (WrapLayout.LayoutParams)child.getLayoutParams();

                int childWidth = child.getMeasuredWidth();
                int childHeight = child.getMeasuredHeight();

                int childTotaWidth = childWidth + lp.rightMargin + lp.leftMargin;
                int childTotalHeight = childHeight + lp.topMargin + lp.bottomMargin;

                if (rowMaxWidth &amp;lt; currentRowWidth + childTotaWidth) {
                    // はみ出すので演算をやり直す。
                    // 高さを設定
                    top += rowHeight &amp;lt; childTotalHeight ? childTotalHeight : rowHeight;
                    // 現在行の高さを初期化
                    rowHeight = 0;
                    // 現在行の幅を初期化
                    currentRowWidth = 0;
                }

                child.layout(
                    currentRowWidth + lp.leftMargin,
                    top + lp.topMargin,
                    currentRowWidth + childWidth + lp.rightMargin,
                    top + childHeight + lp.bottomMargin);

                rowHeight =
                    rowHeight &amp;lt; childTotalHeight ? childTotalHeight : rowHeight;
                currentRowWidth += childTotaWidth;
            }
        }
    }
&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
これでMarginが有効になったWrapLayoutの出来上がり。&lt;br /&gt;
&lt;br /&gt;
ソースコード全文(import等は割愛)&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;pre class=&quot;brush:java;&quot;&gt;public class WrapLayout extends ViewGroup {

    //==================================================================
    // constructor
    //==================================================================
    public WrapLayout(Context context) { super(context); }

    public WrapLayout(Context context, AttributeSet attrs) { super(context, attrs); }

    public WrapLayout(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); }

    //==================================================================
    // public methods
    //==================================================================

    @Override
    public WrapLayout.LayoutParams generateLayoutParams(AttributeSet attrs) {
        return new WrapLayout.LayoutParams(getContext(), attrs);
    }

    //==================================================================
    // protected methods
    //==================================================================
    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        final int width = View.resolveSize(getSuggestedMinimumWidth(), widthMeasureSpec);
        final int height = View.resolveSize(getSuggestedMinimumHeight(), heightMeasureSpec);
        this.setMeasuredDimension(width, height);

        int childWidthSpec = MeasureSpec.makeMeasureSpec(width, MeasureSpec.UNSPECIFIED);
        int childHeightSpec = MeasureSpec.makeMeasureSpec(height, MeasureSpec.UNSPECIFIED);

        int childCount = getChildCount();
        for (int i = 0; i &amp;lt; childCount; i++) {
            getChildAt(i).measure(childWidthSpec, childHeightSpec);
        }
    }

    @Override
    protected void onLayout(boolean changed, int l, int t, int r, int b) {

        int count = this.getChildCount();

        // 行の高さ
        int rowHeight = 0;

        // 現在の行の幅
        int currentRowWidth = 0;

        int rowMaxWidth = this.getWidth();

        int top = 0;

        for (int i = 0; i &amp;lt; count; i++) {
            View child = this.getChildAt(i);
            if (child.getVisibility() != View.GONE) {
                WrapLayout.LayoutParams lp =
                        (WrapLayout.LayoutParams)child.getLayoutParams();

                int childWidth = child.getMeasuredWidth();
                int childHeight = child.getMeasuredHeight();

                int childTotaWidth = childWidth + lp.rightMargin + lp.leftMargin;
                int childTotalHeight = childHeight + lp.topMargin + lp.bottomMargin;

                if (rowMaxWidth &amp;lt; currentRowWidth + childTotaWidth) {
                    // はみ出すので演算をやり直す。
                    // 高さを設定
                    top += rowHeight &amp;lt; childTotalHeight ? childTotalHeight : rowHeight;
                    // 現在行の高さを初期化
                    rowHeight = 0;
                    // 現在行の幅を初期化
                    currentRowWidth = 0;
                }

                child.layout(
                    currentRowWidth + lp.leftMargin,
                    top + lp.topMargin,
                    currentRowWidth + childWidth + lp.rightMargin,
                    top + childHeight + lp.bottomMargin);

                rowHeight =
                    rowHeight &amp;lt; childTotalHeight ? childTotalHeight : rowHeight;
                currentRowWidth += childTotaWidth;
            }
        }
    }

    @Override
    protected WrapLayout.LayoutParams generateDefaultLayoutParams() {
        return new WrapLayout.LayoutParams(WrapLayout.LayoutParams.WRAP_CONTENT, WrapLayout.LayoutParams.WRAP_CONTENT);
    }

    @Override
    protected boolean checkLayoutParams(ViewGroup.LayoutParams p) {
        return p instanceof WrapLayout.LayoutParams;
    }

    @Override
    protected WrapLayout.LayoutParams generateLayoutParams(ViewGroup.LayoutParams p) {
        return new WrapLayout.LayoutParams(p);
    }

    //==================================================================
    // inner class
    //==================================================================

    public static class LayoutParams extends MarginLayoutParams {

        public LayoutParams(Context context, AttributeSet attr) { super(context, attr); }

        public LayoutParams(int width, int height) { super(width, height); }

        public LayoutParams(ViewGroup.LayoutParams source) { super(source); }

        public LayoutParams(MarginLayoutParams source) { super(source); }
    }
}
&lt;/pre&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cheesecomer.blogspot.com/feeds/3338314342964828149/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://cheesecomer.blogspot.com/2012/06/androidsilverlightwrappanelviewgroup_11.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1659275078292271790/posts/default/3338314342964828149'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1659275078292271790/posts/default/3338314342964828149'/><link rel='alternate' type='text/html' href='http://cheesecomer.blogspot.com/2012/06/androidsilverlightwrappanelviewgroup_11.html' title='AndroidでSilverlightのWrapPanel風のViewGroupが欲しい　その２'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16433580304011475507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1659275078292271790.post-8761312015176416301</id><published>2012-06-06T14:05:00.000+09:00</published><updated>2012-06-11T13:21:00.511+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><title type='text'>AndroidでSilverlightのWrapPanel風のViewGroupが欲しい</title><content type='html'>AndroidでSilverlightのWrapPanelのように自動で折り返すViewGroupが欲しいです。&lt;br /&gt;
デフォルトじゃないみたいなので、いろいろ漁ってると以下の記事を発見。&lt;br /&gt;
&lt;br /&gt;
・&lt;a href=&quot;http://d.hatena.ne.jp/tomstay/20110405/1301991853&quot; target=&quot;_blank&quot;&gt;Androidでボタンを横に並べて自動で折り返す&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
ほほー。RelativeLayoutでござるか。&lt;br /&gt;
&lt;br /&gt;
使　っ　た　こ　と　な　い　ん　で　す　よ　ね　。&lt;br /&gt;
&lt;br /&gt;
上記の記事を使いまわしが効くようにコントロール化してみました。&lt;br /&gt;
かなり適当。&lt;br /&gt;
&lt;pre class=&quot;brush:java;&quot;&gt;public class WrapLayout extends RelativeLayout {

    public WrapLayout(Context context) {
        super(context);
    }

    public WrapLayout(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public WrapLayout(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }

    @Override
    public void addView(View child) {
        // idが未設定の場合は乱数でどうにかする。
        if (child.getId() == -1) { child.setId(new Random(System.currentTimeMillis()).nextInt(Integer.MAX_VALUE)); }

        super.addView(child);
    }

    @Override
    public void addView(View child, int width, int height) {
        // idが未設定の場合は乱数でどうにかする。
        if (child.getId() == -1) { child.setId(new Random(System.currentTimeMillis()).nextInt(Integer.MAX_VALUE)); }

        super.addView(child, width, height);
    }

    @Override
    public void addView(View child, ViewGroup.LayoutParams params) {
        // idが未設定の場合は乱数でどうにかする。
        if (child.getId() == -1) { child.setId(new Random(System.currentTimeMillis()).nextInt(Integer.MAX_VALUE)); }

        super.addView(child, params);
    }

    @Override
    public void addView(View child, int index) {
        // idが未設定の場合は乱数でどうにかする。
        if (child.getId() == -1) { child.setId(new Random(System.currentTimeMillis()).nextInt(Integer.MAX_VALUE)); }

        super.addView(child, index);
    }

    @Override
    public void addView(View child, int index, ViewGroup.LayoutParams params) {
        // idが未設定の場合は乱数でどうにかする。
        if (child.getId() == -1) { child.setId(new Random(System.currentTimeMillis()).nextInt(Integer.MAX_VALUE)); }

        super.addView(child, index, params);
      }

    @Override
    public void onWindowFocusChanged(boolean hasWindowFocus) {

        super.onWindowFocusChanged(hasWindowFocus);

        // 子供の数を取得
        int l = this.getChildCount();
        // 無いなら何もしない
        if (l == 0) {
          return;
        }

        // ディスプレイの横幅を取得
        WindowManager wm = (WindowManager) this.getContext().getSystemService(Context.WINDOW_SERVICE);
        Display display = wm.getDefaultDisplay();

        // 1行最大長
        int max = display.getWidth();

        // 一番最初は基点となるので何もしない
        View pline = this.getChildAt(0);
        // 現在の１行の長さ
        int currentTotal = pline.getWidth();
        for (int i = 1; i &amp;lt; l; i++) {
            int w = this.getChildAt(i).getWidth();
            RelativeLayout.LayoutParams layoutParams =
                    (RelativeLayout.LayoutParams) this.getChildAt(i).getLayoutParams();

            // 横幅を超えないなら前のボタンの右に出す
            if (max &amp;gt; currentTotal + w) {
                // 現在長に処理対象コントロール長を加算
                currentTotal += w;
                layoutParams.addRule(RelativeLayout.ALIGN_TOP, this.getChildAt(i - 1).getId());
                layoutParams.addRule(RelativeLayout.RIGHT_OF, this.getChildAt(i - 1).getId());
            } else {
                // 横最大長を超過した場合は折り返す
                layoutParams.addRule(RelativeLayout.BELOW, pline.getId());

                // 基点を変更
                pline = this.getChildAt(i);

                // 長さをリセット
                currentTotal = pline.getWidth();
            }
        }
    }
}&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
わかってます。onWindowFocusChangedにaddViewしたらダメじゃね？ってのはわかってます。&lt;br /&gt;
とりあえずです。&lt;br /&gt;
[[Activity]]&lt;br /&gt;
&lt;pre class=&quot;brush:java;&quot;&gt;public class MainActivity extends Activity {
    /** Called when the activity is first created. */

    String[] strings = { &quot;てｓｔ１&quot;, &quot;てｓｔ２&quot;, &quot;てｓｔ３&quot;, &quot;てｓｔ４&quot;, &quot;てｓｔ５&quot;, &quot;てｓｔ６&quot;, &quot;てｓｔ７&quot;, &quot;てｓｔ８&quot;, &quot;てｓｔ９&quot;, &quot;てｓｔ１０&quot;, &quot;てｓｔ１１１１１１a&quot;, &quot;てｓｔ１１１&quot;, &quot;てｓｔ２３４&quot;};
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        WrapLayout layout = (WrapLayout)this.findViewById(R.id.FixedGridLayout);
        for (String string : strings) {
            Button btn = new Button(this);
            btn.setText(string);
            //btn.setId(random.nextInt(Integer.MAX_VALUE));
            layout.addView(btn);
        }
    }
}&lt;/pre&gt;
[[出力結果]]&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZd9BgvDKbZYLHqQiLZ2mRTVvZhGc48O4wuy8zKbMCkkvchsu0bfFRZVOlrLmCrZm5ISqOX2BWZ2lbN6JqsJ8gSAGD7xcf092uzxc1KvcVivDpLwgF5NbGsrJDsIIYM7waSmmCPwHF26zu/s1600/device-2012-06-06-135941.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZd9BgvDKbZYLHqQiLZ2mRTVvZhGc48O4wuy8zKbMCkkvchsu0bfFRZVOlrLmCrZm5ISqOX2BWZ2lbN6JqsJ8gSAGD7xcf092uzxc1KvcVivDpLwgF5NbGsrJDsIIYM7waSmmCPwHF26zu/s320/device-2012-06-06-135941.png&quot; width=&quot;192&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
良い感じ。</content><link rel='replies' type='application/atom+xml' href='http://cheesecomer.blogspot.com/feeds/8761312015176416301/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://cheesecomer.blogspot.com/2012/06/androidsilverlightwrappanelviewgroup.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1659275078292271790/posts/default/8761312015176416301'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1659275078292271790/posts/default/8761312015176416301'/><link rel='alternate' type='text/html' href='http://cheesecomer.blogspot.com/2012/06/androidsilverlightwrappanelviewgroup.html' title='AndroidでSilverlightのWrapPanel風のViewGroupが欲しい'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16433580304011475507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZd9BgvDKbZYLHqQiLZ2mRTVvZhGc48O4wuy8zKbMCkkvchsu0bfFRZVOlrLmCrZm5ISqOX2BWZ2lbN6JqsJ8gSAGD7xcf092uzxc1KvcVivDpLwgF5NbGsrJDsIIYM7waSmmCPwHF26zu/s72-c/device-2012-06-06-135941.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1659275078292271790.post-2799998822631319200</id><published>2012-06-05T17:08:00.001+09:00</published><updated>2013-01-08T15:31:34.073+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Silverlight"/><title type='text'>[Silverlight] UIスレッド上で処理を実行する。</title><content type='html'>&lt;pre class=&quot;sourcecode&quot;&gt;System.Windows.&lt;span class=&quot;usertype&quot;&gt;Deployment&lt;/span&gt;.Current.Dispatcher.BeginInvoke(() =&amp;gt;{ .... });

&lt;/pre&gt;
</content><link rel='replies' type='application/atom+xml' href='http://cheesecomer.blogspot.com/feeds/2799998822631319200/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://cheesecomer.blogspot.com/2012/06/ui.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1659275078292271790/posts/default/2799998822631319200'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1659275078292271790/posts/default/2799998822631319200'/><link rel='alternate' type='text/html' href='http://cheesecomer.blogspot.com/2012/06/ui.html' title='[Silverlight] UIスレッド上で処理を実行する。'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16433580304011475507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1659275078292271790.post-8005296951644007183</id><published>2012-06-05T16:33:00.001+09:00</published><updated>2012-06-06T00:34:05.534+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="DB"/><category scheme="http://www.blogger.com/atom/ns#" term="Oracle"/><category scheme="http://www.blogger.com/atom/ns#" term="メモ"/><title type='text'>Triggerでシーケンス値を自動採番</title><content type='html'>&lt;br /&gt;
以下のようなテーブルが存在したとする。&lt;br /&gt;
テーブル名 : [MST_Magazine]&lt;br /&gt;
フィールド&lt;br /&gt;
&lt;br /&gt;
&lt;table border=&quot;1&quot; style=&quot;background-color: white; color: #666666; font-family: &#39;ＭＳ Ｐゴシック&#39;, Osaka, &#39;ヒラギノ角ゴ Pro W3&#39;, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; text-align: left;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;th&gt;項目名&lt;/th&gt;&lt;th&gt;型&lt;/th&gt;&lt;th&gt;備考&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;ID&lt;/td&gt;&lt;td&gt;数値&lt;/td&gt;&lt;td&gt;PK 連番でデータを格納&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Publisher_ID&lt;/td&gt;&lt;td&gt;数値&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Name&lt;/td&gt;&lt;td&gt;文字列&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
このようなテーブルではIDはシーケンスでの採番となる。&lt;br /&gt;
しかし、OracleではSQLServerのように、型として自動採番の型が存在しない。&lt;br /&gt;
&lt;br /&gt;
そこで、トリガを用いて自動採番を行う。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;sourcecode&quot;&gt;CREATE OR REPLACE TRIGGER TRG_MST_Magazine_ID
BEFORE Insert
ON MST_Magazine
FOR EACH ROW
BEGIN
    IF :NEW.ID  IS NULL THEN
        SELECT SEQ_Magazine_ID.NEXTVAL INTO :NEW.ID FROM DUAL;
    END IF;
END;
&lt;/pre&gt;
&lt;br /&gt;
上記のトリガは、MST_MagazineテーブルへのInsert時に起動し、&lt;br /&gt;
InsertされたMST_Magazine.ID項目がNULLの場合、SEQ_Magazine_ID.Nextvalの値を使用する。&lt;br /&gt;
&lt;br /&gt;
これにより、IDを指定せずMST_MagazineテーブルへのInsertを行った場合は自動で数値が採番される。</content><link rel='replies' type='application/atom+xml' href='http://cheesecomer.blogspot.com/feeds/8005296951644007183/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://cheesecomer.blogspot.com/2012/06/trigger.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1659275078292271790/posts/default/8005296951644007183'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1659275078292271790/posts/default/8005296951644007183'/><link rel='alternate' type='text/html' href='http://cheesecomer.blogspot.com/2012/06/trigger.html' title='Triggerでシーケンス値を自動採番'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16433580304011475507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1659275078292271790.post-2711378446476039409</id><published>2012-06-05T16:30:00.002+09:00</published><updated>2012-06-06T00:30:11.560+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="メモ"/><title type='text'>HtmlPage.Window.Navigate で cookie を使用する。</title><content type='html'>&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Silverlightなんかで、画面を切り替えるときに HtmlPage.Window.Navigate で遷移させたりしますけども、&lt;br /&gt;
その時にCookieを使用したいと思いました。&lt;br /&gt;
&lt;br /&gt;
System.Net.Cookieとかあるからこれを使うのかと思ったけども、どうやら違う。&lt;br /&gt;
こいつはHttpWebRequestの時に使うみたい。&lt;br /&gt;
それじゃあ、こまります。&lt;br /&gt;
ええ、困りますとも。&lt;br /&gt;
だって画面遷移をさせたいんだから。&lt;br /&gt;
&lt;br /&gt;
さてどうするかと言うと、System.Windows.Browser.HtmlPageのDocumentプロパティのSetPropertyで設定してあげればいいんでがす。&lt;br /&gt;
&lt;br /&gt;
[[サンプル]]&lt;br /&gt;
&lt;pre class=&quot;code&quot; style=&quot;background-color: #f0f0f0; border: 1px solid rgb(170, 170, 170); overflow: auto; padding: 5px;&quot;&gt;&lt;span style=&quot;font-family: &#39;ＭＳ ゴシック&#39;, sans-serif; line-height: 1;&quot;&gt;&lt;span class=&quot;usertype&quot; style=&quot;color: #2b91af;&quot;&gt;HtmlPage&lt;/span&gt;.Document.SetProperty( &lt;span class=&quot;string&quot; style=&quot;color: #a31515;&quot;&gt;&quot;cookie&quot;&lt;/span&gt;, &lt;span class=&quot;string&quot; style=&quot;color: #a31515;&quot;&gt;&quot;Key1=Value1&quot;&lt;/span&gt; );
        &lt;span class=&quot;usertype&quot; style=&quot;color: #2b91af;&quot;&gt;HtmlPage&lt;/span&gt;.Document.SetProperty( &lt;span class=&quot;string&quot; style=&quot;color: #a31515;&quot;&gt;&quot;cookie&quot;&lt;/span&gt;, &lt;span class=&quot;string&quot; style=&quot;color: #a31515;&quot;&gt;&quot;Key2=Value2&quot;&lt;/span&gt; );
        &lt;span class=&quot;usertype&quot; style=&quot;color: #2b91af;&quot;&gt;HtmlPage&lt;/span&gt;.Window.Navigate
        (
            &lt;span class=&quot;keyword&quot; style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;usertype&quot; style=&quot;color: #2b91af;&quot;&gt;Uri&lt;/span&gt;( &lt;span class=&quot;string&quot; style=&quot;color: #a31515;&quot;&gt;&quot;&lt;a href=&quot;http://..../&quot; rel=&quot;noreferrer&quot; style=&quot;color: #ac462f; cursor: help; display: inline !important; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;http://....&lt;/a&gt;&quot;&lt;/span&gt;, &lt;span class=&quot;usertype&quot; style=&quot;color: #2b91af;&quot;&gt;UriKind&lt;/span&gt;.RelativeOrAbsolute),
            &lt;span class=&quot;string&quot; style=&quot;color: #a31515;&quot;&gt;&quot;_self&quot;&lt;/span&gt;
        );
&lt;/span&gt;&lt;span style=&quot;font-family: &#39;MS PGothic&#39;;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
で、Cookie情報を取得するには HtmlPage.Document.Cookies プロパティに格納される。&lt;br /&gt;
これは文字列でﾄﾞﾊﾞｰっと入ってるので、いいように加工して使うしか無いんでしょうか。&lt;br /&gt;
めんどくさい。&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://cheesecomer.blogspot.com/feeds/2711378446476039409/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://cheesecomer.blogspot.com/2012/06/htmlpagewindownavigate-cookie.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1659275078292271790/posts/default/2711378446476039409'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1659275078292271790/posts/default/2711378446476039409'/><link rel='alternate' type='text/html' href='http://cheesecomer.blogspot.com/2012/06/htmlpagewindownavigate-cookie.html' title='HtmlPage.Window.Navigate で cookie を使用する。'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16433580304011475507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1659275078292271790.post-4633983608647084082</id><published>2012-06-05T16:28:00.003+09:00</published><updated>2012-06-05T17:33:01.705+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="メモ"/><title type='text'>LINQで配列</title><content type='html'>&lt;pre class=&quot;sourcecode&quot;&gt;&lt;br /&gt;
&lt;span class=&quot;rem&quot;&gt;// AからZまでのchar型の配列を生成&lt;/span&gt;
&lt;span class=&quot;keyword&quot;&gt;var&lt;/span&gt; az = &lt;span class=&quot;keyword&quot;&gt;new&lt;/span&gt; (&lt;span class=&quot;usertype&quot;&gt;List&lt;/span&gt;&amp;lt;&lt;span class=&quot;keyword&quot;&gt;char&lt;/span&gt;&amp;gt;)(System.Linq.&lt;span class=&quot;usertype&quot;&gt;Enumerable&lt;/span&gt;.Range(&lt;span class=&quot;string&quot;&gt;&#39;A&#39;&lt;/span&gt;, &lt;span class=&quot;string&quot;&gt;&#39;Z&#39;&lt;/span&gt; - &lt;span class=&quot;string&quot;&gt;&#39;A&#39;&lt;/span&gt; + 1).Select(i =&amp;gt; (&lt;span class=&quot;keyword&quot;&gt;char&lt;/span&gt;)i).ToArray());&lt;br /&gt;
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://cheesecomer.blogspot.com/feeds/4633983608647084082/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://cheesecomer.blogspot.com/2012/06/linq.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1659275078292271790/posts/default/4633983608647084082'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1659275078292271790/posts/default/4633983608647084082'/><link rel='alternate' type='text/html' href='http://cheesecomer.blogspot.com/2012/06/linq.html' title='LINQで配列'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16433580304011475507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1659275078292271790.post-440913806081929708</id><published>2010-06-10T23:42:00.000+09:00</published><updated>2012-06-06T23:45:18.367+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="DB"/><category scheme="http://www.blogger.com/atom/ns#" term="Oracle"/><category scheme="http://www.blogger.com/atom/ns#" term="環境構築"/><title type='text'>Windows7にOracle10g R2 を入れてみた</title><content type='html'>&lt;br /&gt;
以前Windows7にOracle10ｇR1を入れようとして発狂したエントリ を書きましたが、&lt;br /&gt;
R2ならいけるよーとのコメントをいただいたので、今更やってみました。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
とりあえずそのままインストールしようとして、&lt;br /&gt;
Versionが対応外なんですけ？的なエラー&lt;br /&gt;
じゃあ、Varsionをごまかせ☆と、setup.exeのプロパティから互換性タブの値をチョロッと編集。&lt;br /&gt;
ここはR1での作業と一緒。&lt;br /&gt;
さてさてどうなることか。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
あれ？なんかインストールできましたけど？&lt;br /&gt;
あれ？DBにも接続できましたけど？&lt;br /&gt;
&lt;br /&gt;
わおｗｗｗｗｗｗｗｗｗｗ&lt;br /&gt;
&lt;br /&gt;
あの苦労は一体・・・&lt;br /&gt;
oracle10g用のSQLをSQLServer2005用にコンバージョンした苦労って・・・&lt;br /&gt;
&lt;br /&gt;
とりあえず、select * from PRODUCT_COMPONENT_VERSIONして取得した結果&lt;br /&gt;
&lt;br /&gt;
Oracle Database 10g Enterprise Edition&lt;br /&gt;
10.2.0.3.0&lt;br /&gt;
Prod&lt;br /&gt;
&lt;br /&gt;
うん入ってるね。&lt;br /&gt;
これで幸せ。</content><link rel='replies' type='application/atom+xml' href='http://cheesecomer.blogspot.com/feeds/440913806081929708/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://cheesecomer.blogspot.com/2010/06/windows7oracle10g-r2.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1659275078292271790/posts/default/440913806081929708'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1659275078292271790/posts/default/440913806081929708'/><link rel='alternate' type='text/html' href='http://cheesecomer.blogspot.com/2010/06/windows7oracle10g-r2.html' title='Windows7にOracle10g R2 を入れてみた'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16433580304011475507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1659275078292271790.post-2120089607936142175</id><published>2009-12-03T09:43:00.000+09:00</published><updated>2012-06-06T23:44:36.492+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="DB"/><category scheme="http://www.blogger.com/atom/ns#" term="Oracle"/><category scheme="http://www.blogger.com/atom/ns#" term="環境構築"/><title type='text'>Windows7 + oracle 10g R1 試行手順</title><content type='html'>!!! これは10g R1に関するエントリです。10g R2は&lt;a href=&quot;http://cheesecomer.blogspot.com/2010/06/windows7oracle10g-r2.html&quot; target=&quot;_blank&quot;&gt;こちら&lt;/a&gt;&amp;nbsp;!!!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
アクセス解析見てると、「oracle10g」を「Windows7」にぶち込みたい方が結構いるみたいですね。&lt;br /&gt;
俺が試したインストール手順をとりあえず書いときます。&lt;br /&gt;
まぁ失敗したんだけどねｗｗｗｗｗｗｗ&lt;br /&gt;
書いてたら、詳しい人が解決策を教えてくれるかもという、淡い期待です。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
「setup.exe」をそのまま起動すると、&lt;br /&gt;
「お前のWindowsのVerは対応してないんですけどｗｗｗｗ」&lt;br /&gt;
っていってきます。&lt;br /&gt;
&lt;br /&gt;
じゃ、誤魔化しちゃいましょう。&lt;br /&gt;
&lt;br /&gt;
「setup.exe」のプロパティを開きます。&lt;br /&gt;
「互換性」ってタブが存在するかと思います。&lt;br /&gt;
「互換モード」の「互換モードでこのプログラムを実行する」にチェックつけてやってください。&lt;br /&gt;
&lt;br /&gt;
とりあえずこれでOk&lt;br /&gt;
&lt;br /&gt;
あとは、「setup.exe」を起動するとちゃんとインストーラが動くはず。&lt;br /&gt;
&lt;br /&gt;
こっから先のインストール手順に関しては他のサイトで、&lt;br /&gt;
山のように解説してくださってるんで割愛します。&lt;br /&gt;
&lt;br /&gt;
で、問題が発生するのは、一番最後。&lt;br /&gt;
「Oracle Database Configuration Assistant」とやらのインストール時です。&lt;br /&gt;
これが「アクセス権ﾅｽｗｗｗｗｗｗｗ涙目ｗｗｗｗｗｗ」（12546[アクセス権なし]）ってエラーをはきます。&lt;br /&gt;
&lt;br /&gt;
ここで積む。&lt;br /&gt;
&lt;br /&gt;
続行すると、&lt;br /&gt;
「「Oracle Database Configuration Assistant」のインストールに失敗したけど、必須じゃないからよくね？」&lt;br /&gt;
的な文章がむにゅっとポップアップで出てきます。&lt;br /&gt;
&lt;br /&gt;
あれ？そうなの？びっくりさせないでよねｗｗｗｗｗ&lt;br /&gt;
とか思って、とりあえずSQL*Plus起動すっかなーと、&lt;br /&gt;
コマンドプロンプトで[sqlplus]って打ち込むと、&lt;br /&gt;
「アクセス権ﾅｽｗｗｗｗｗｗｗ涙目ｗｗｗｗｗｗ」（12546[アクセス権なし]）ってエラーをはきます。&lt;br /&gt;
&lt;br /&gt;
だめじゃねーかｗｗｗｗｗｗｗｗｗｗｗｗｗ俺涙目ｗｗｗｗｗｗｗｗｗｗｗｗ&lt;br /&gt;
ってなるかと思います。&lt;br /&gt;
&lt;br /&gt;
エラーコードは同一なことから見ても、おそらく原因は同じと思われます。&lt;br /&gt;
アクセス権がどのアクセス権なのかもサッパリです。&lt;br /&gt;
詳しい人ﾎﾞｽｹﾃ</content><link rel='replies' type='application/atom+xml' href='http://cheesecomer.blogspot.com/feeds/2120089607936142175/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://cheesecomer.blogspot.com/2012/06/windows7-oracle-10g-r1.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1659275078292271790/posts/default/2120089607936142175'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1659275078292271790/posts/default/2120089607936142175'/><link rel='alternate' type='text/html' href='http://cheesecomer.blogspot.com/2012/06/windows7-oracle-10g-r1.html' title='Windows7 + oracle 10g R1 試行手順'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16433580304011475507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1659275078292271790.post-8307990926654224530</id><published>2009-11-07T16:41:00.000+09:00</published><updated>2012-06-06T00:57:21.116+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Axis2"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><title type='text'>任意形式のXMLリクエスト・レスポンスの送受信</title><content type='html'>&lt;br /&gt;
&lt;strong&gt;０． 準備&lt;/strong&gt;① すでにEclipse、WTP、Axis2の設定は完了していること。&lt;br /&gt;
「&lt;a href=&quot;http://cheesecomer.blogspot.com/2012/06/apache-axis2-eclipse-wtp.html&quot; style=&quot;color: #ac462f; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;Eclipse + Axis2連携手順 及び簡易サービス作成手順&lt;/a&gt;&amp;nbsp;」参照&lt;br /&gt;
&lt;strong&gt;１． サーバ側プロジェクトの作成&lt;/strong&gt;① ファイル -&amp;gt; 新規 -&amp;gt; プロジェクト -&amp;gt; Web -&amp;gt; 動的Webプロジェクト を選択する&lt;br /&gt;
② 構成の変更からプロジェクト・フィアセットを開き、以下の項目のみを有効にする&lt;br /&gt;
Axis2 Webアプリケーション&lt;br /&gt;
Java&lt;br /&gt;
動的Webモジュール&lt;br /&gt;
③ 任意のプロジェクト名を入力&lt;br /&gt;
④ 完了を押下&lt;br /&gt;
&lt;strong&gt;２． サーバ側プロジェクト初期設定&lt;/strong&gt;① Eclipseのワークスペース \ 作成したプロジェクト\ WebContent \ WEB-INF \ lib ディレクトリに&lt;br /&gt;
Axis2を展開したディレクトリ\lib ディレクトリ配下のjarファイルをコピーする&lt;br /&gt;
② プロジェクトをリフレッシュ&lt;br /&gt;
③ Web.xmlを書き換える&lt;br /&gt;
org.apache.axis2.transport.http.AxisAdminServlet&lt;br /&gt;
↓&lt;br /&gt;
org.apache.axis2.webapp.AxisAdminServlet&lt;br /&gt;
&lt;strong&gt;３． サービスの作成&lt;/strong&gt;① 以下のクラスを作成する&lt;br /&gt;
&lt;pre class=&quot;sourcecode&quot;&gt;public class test {
    public OMElement echo( OMElement request ){ return request; }
}

&lt;/pre&gt;
echoメソッドは送信されてきたメッセージを、そのまま返却するものである&lt;br /&gt;
&lt;strong&gt;４． Webサービスの登録&lt;/strong&gt;① 作成したクラスを右クリック -&amp;gt; Webサービス -&amp;gt; Webサービスの作成を実行&lt;br /&gt;
② デフォルトの設定で十分なので、なにも設定せずそのまま完了ボタンを押下&lt;br /&gt;
この作業でWSDLが作成される。&lt;br /&gt;
&lt;strong&gt;５． クライアントプロジェクトの作成&lt;/strong&gt;① ファイル -&amp;gt; 新規 -&amp;gt; プロジェクト -&amp;gt; JAVA -&amp;gt; JAVAプロジェクト を選択&lt;br /&gt;
② 任意のプロジェクト名を入力&lt;br /&gt;
③ 完了を押下&lt;br /&gt;
&lt;strong&gt;６． クライアントプロジェクト初期設定&lt;/strong&gt;① 作成したプロジェクトのプロパティを開く&lt;br /&gt;
② JAVAのビルド・パスを表示&lt;br /&gt;
③ 外部JARの追加を押下&lt;br /&gt;
④ Axis2を展開したディレクトリ \ lib 配下のJarをすべて追加&lt;br /&gt;
&lt;strong&gt;７． クライアントを作成&lt;/strong&gt;① 以下のクラスを作成する&lt;br /&gt;
＃ 適宜編集してください&lt;br /&gt;
&lt;pre class=&quot;sourcecode&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;keyword&quot; style=&quot;color: blue;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;usertype&quot; style=&quot;color: #2b91af;&quot;&gt;Client&lt;/span&gt; {
    &lt;span class=&quot;keyword&quot; style=&quot;color: blue;&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;keyword&quot; style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;keyword&quot; style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; main (&lt;span class=&quot;usertype&quot; style=&quot;color: blue;&quot;&gt;String&lt;/span&gt;[] args ) {
        {
        &lt;span class=&quot;rem&quot;&gt;// エンドポイントURL&lt;/span&gt;
        &lt;span class=&quot;rem&quot;&gt;// ～/services/以降がクラス名&lt;/span&gt;
        &lt;span class=&quot;usertype&quot;&gt;String&lt;/span&gt; endpointStr = &quot;http://localhost:8080/サーバ側プロジェクト名/services/test/&quot;;
        &lt;span class=&quot;usertype&quot;&gt;ServiceClient&lt;/span&gt; sender = &lt;span class=&quot;keyword&quot;&gt;null&lt;/span&gt;;
        &lt;span class=&quot;usertype&quot;&gt;Options&lt;/span&gt; options = &lt;span class=&quot;keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;usertype&quot;&gt;Options&lt;/span&gt;();
        &lt;span class=&quot;keyword&quot;&gt;try&lt;/span&gt; {
            sender = &lt;span class=&quot;keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;usertype&quot;&gt;ServiceClient&lt;/span&gt;
        } &lt;span class=&quot;keyword&quot;&gt;catch&lt;/span&gt;(&lt;span class=&quot;usertype&quot;&gt;AxisFault&lt;/span&gt; e ){
            e.printStackTrace();
           &lt;span class=&quot;keyword&quot;&gt;return;&lt;/span&gt;
        }

        &lt;span class=&quot;rem&quot; style=&quot;color: green;&quot;&gt;// オプションの設定&lt;/span&gt;
        &lt;span class=&quot;rem&quot; style=&quot;color: green;&quot;&gt;// エンドポイントの設定&lt;/span&gt;
        options.setTo(&lt;span class=&quot;keyword&quot; style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; EndpointReference( endpointStr ) );

        &lt;span class=&quot;rem&quot; style=&quot;color: green;&quot;&gt;// プロトコルの設定&lt;/span&gt;
        options.setTransportInProtocol( Constants.&lt;span class=&quot;keyword&quot; style=&quot;color: blue;&quot;&gt;TRANSPORT_HTTP&lt;/span&gt;);

        &lt;span class=&quot;rem&quot; style=&quot;color: green;&quot;&gt;// オプションを反映する&lt;/span&gt;
        sender.setOptions( options );&lt;span class=&quot;rem&quot; style=&quot;color: green;&quot;&gt;//送信メッセージの作成&lt;/span&gt;
        &lt;span class=&quot;usertype&quot; style=&quot;color: #2b91af;&quot;&gt;OMFactory&lt;/span&gt; fac = OMAbstractFactory.getOMFactory( );

        &lt;span class=&quot;rem&quot; style=&quot;color: green;&quot;&gt;// ネームスペースの生成&lt;/span&gt;
        &lt;span class=&quot;usertype&quot; style=&quot;color: #2b91af;&quot;&gt;OMNamespace&lt;/span&gt; omNs = fac.createOMNamespace(&quot;http://作成したサービスのパッケージ&quot; , &quot;Request&quot; );

        &lt;span class=&quot;rem&quot; style=&quot;color: green;&quot;&gt;// 要素の作成&lt;/span&gt;
        &lt;span class=&quot;usertype&quot; style=&quot;color: #2b91af;&quot;&gt;OMElement&lt;/span&gt; request =
            fac.createOMElement(
                &quot;echo&quot;, &lt;span class=&quot;rem&quot; style=&quot;color: green;&quot;&gt;// 実行するメソッド&lt;/span&gt;
                omNs);
        &lt;span class=&quot;usertype&quot; style=&quot;color: #2b91af;&quot;&gt;OMElement&lt;/span&gt; msg = fac.createOMElement(&quot;Msg&quot;, omNs);
        &lt;span class=&quot;rem&quot; style=&quot;color: green;&quot;&gt;// テキストの追加&lt;/span&gt;
        msg.setText ( &quot;Hello, World !!!&quot; );

        &lt;span class=&quot;rem&quot; style=&quot;color: green;&quot;&gt;// 要素の追加&lt;/span&gt;
        request.addChild( msg );
        try{
            &lt;span class=&quot;rem&quot; style=&quot;color: green;&quot;&gt;// リクエストの送信、レスポンスの受信&lt;/span&gt;
            &lt;span class=&quot;usertype&quot; style=&quot;color: #2b91af;&quot;&gt;OMElement&lt;/span&gt; response = sender.sendReceive( request );

            &lt;span class=&quot;rem&quot; style=&quot;color: green;&quot;&gt;// レスポンスをコンソールに表示&lt;/span&gt;
            System.out.println( &quot;レスポンス : &quot; + response.toString() );
        }&lt;span class=&quot;keyword&quot; style=&quot;color: blue;&quot;&gt;catch&lt;/span&gt;(&lt;span class=&quot;usertype&quot; style=&quot;color: #2b91af;&quot;&gt;AxisFault&lt;/span&gt; e ){
            e.printStackTrace();
           return;
        }
    }
}
&lt;/pre&gt;
&lt;strong&gt;８． 通信の確認&lt;/strong&gt;① サーバを起動する。&lt;br /&gt;
② クライアントを実行する。&lt;br /&gt;
③ コンソール上に以下の表示があれば完了です&lt;br /&gt;
＃ 以下の文は適宜改行しています。&lt;br /&gt;
本来は一行で表示されます。&lt;br /&gt;
レスポンス :&lt;br /&gt;
&amp;lt;echoresponse xmlns:ns=&quot;&lt;a href=&quot;http://xn--rckhkc4cxem14af5880g/&quot; rel=&quot;noreferrer&quot; style=&quot;color: #ac462f; cursor: help; display: inline !important; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;http://サービスパッケージ名&lt;/a&gt;&quot;&amp;gt;&lt;br /&gt;
&amp;lt;return&amp;gt;&lt;br /&gt;
&amp;lt;msg xmlns:request=&quot;&lt;a href=&quot;http://xn--rckhkc4cxem14af5880g/&quot; rel=&quot;noreferrer&quot; style=&quot;color: #ac462f; cursor: help; display: inline !important; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;http://サービスパッケージ名&lt;/a&gt;&quot;&amp;gt;&lt;br /&gt;
Hello, World !!!&lt;br /&gt;
&amp;lt;/msg&amp;gt;&lt;br /&gt;
&amp;lt;/return&amp;gt;&lt;br /&gt;
&amp;lt;/echoresponse&amp;gt;</content><link rel='replies' type='application/atom+xml' href='http://cheesecomer.blogspot.com/feeds/8307990926654224530/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://cheesecomer.blogspot.com/2009/11/xml.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1659275078292271790/posts/default/8307990926654224530'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1659275078292271790/posts/default/8307990926654224530'/><link rel='alternate' type='text/html' href='http://cheesecomer.blogspot.com/2009/11/xml.html' title='任意形式のXMLリクエスト・レスポンスの送受信'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16433580304011475507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1659275078292271790.post-3558299008156616607</id><published>2009-11-06T16:35:00.000+09:00</published><updated>2012-06-05T17:48:35.322+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Axis2"/><category scheme="http://www.blogger.com/atom/ns#" term="環境構築"/><title type='text'>Apache Axis2 + Eclipse  + WTP 導入手順</title><content type='html'>&lt;div style=&quot;background-color: white; color: #666666; font-family: &#39;ＭＳ Ｐゴシック&#39;, Osaka, &#39;ヒラギノ角ゴ Pro W3&#39;, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; padding: 0px; text-align: left;&quot;&gt;
&lt;strong&gt;０． 準備&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
・ Eclipse 3.5&lt;br /&gt;
・ WTP&lt;br /&gt;
(&amp;nbsp;&lt;a href=&quot;http://mergedoc.sourceforge.jp/pleiades-redirect/3.4/pleiades_java.zip.html&quot; style=&quot;color: #ac462f; text-decoration: none;&quot;&gt;http://mergedoc.sourceforge.jp/pleiades-redirect/3.4/pleiades_java.zip.html&lt;/a&gt;&amp;nbsp;)&lt;br /&gt;
・ Axis2 1.5 Standard Binary Distribution&lt;br /&gt;
(&amp;nbsp;&lt;a href=&quot;http://ftp.kddilabs.jp/infosystems/apache/ws/axis2/1_5/axis2-1.5-bin.zip&quot; style=&quot;color: #ac462f; text-decoration: none;&quot;&gt;http://ftp.kddilabs.jp/infosystems/apache/ws/axis2/1_5/axis2-1.5-bin.zip&lt;/a&gt;&amp;nbsp;)&lt;br /&gt;
・ Tomcat6.0&lt;br /&gt;
(&amp;nbsp;&lt;a href=&quot;http://ftp.riken.jp/net/apache/tomcat/tomcat-6/v6.0.20/bin/apache-tomcat-6.0.20.exe&quot; style=&quot;color: #ac462f; text-decoration: none;&quot;&gt;http://ftp.riken.jp/net/apache/tomcat/tomcat-6/v6.0.20/bin/apache-tomcat-6.0.20.exe&lt;/a&gt;&amp;nbsp;)&lt;br /&gt;
&lt;br /&gt;
上記ファイルをダウンロードする。&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;１． Eclipse 設定&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
① ウィンドウ -&amp;gt; 設定 -&amp;gt; Webサービス -&amp;gt; Axis2設定&lt;br /&gt;
[ Axis2 ランタイム ]タブの[ Axis2 ランタイム・ロケーション ]に&lt;br /&gt;
Axis2を展開したディレクトリを設定する。&lt;br /&gt;
② ウィンドウ -&amp;gt; 設定 -&amp;gt; Webサービス -&amp;gt; サーバとランタイム&lt;br /&gt;
[ Web サーバ・ランタイム ] を [ Apache Axis2 ]に設定する&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;２． プロジェクトの作成&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
① ファイル -&amp;gt; 新規 -&amp;gt; プロジェクト -&amp;gt; Web -&amp;gt; 動的Webプロジェクト を選択する&lt;br /&gt;
② 構成の変更からプロジェクト・フィアセットを開き、以下の項目のみを有効にする&lt;br /&gt;
Axis2 Webアプリケーション&lt;br /&gt;
Java&lt;br /&gt;
動的Webモジュール&lt;br /&gt;
③ 任意のプロジェクト名を入力&lt;br /&gt;
④ 完了を押下&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;３． プロジェクト初期設定&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
① Eclipseのワークスペース \ 作成したプロジェクト\ WebContent \ WEB-INF \ lib ディレクトリに&lt;br /&gt;
Axis2を展開したディレクトリ\lib ディレクトリ配下のjarファイルをコピーする。&lt;br /&gt;
② プロジェクトをリフレッシュ&lt;br /&gt;
&lt;br /&gt;
③ Web.xmlを書き換える&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #666666; font-family: &#39;ＭＳ Ｐゴシック&#39;, Osaka, &#39;ヒラギノ角ゴ Pro W3&#39;, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; padding: 0px; text-align: left;&quot;&gt;
org.apache.axis2.transport.http.AxisAdminServlet&lt;br /&gt;
↓&lt;br /&gt;
org.apache.axis2.webapp.AxisAdminServlet&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;４． サービスの作成&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
① 以下のクラスを作成する。&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre class=&quot;code&quot; style=&quot;background-color: #f0f0f0; border: 1px solid rgb(170, 170, 170); color: #666666; font-family: &#39;ＭＳ ゴシック&#39;, sans-serif; font-size: 12px; line-height: 1; overflow: auto; padding: 5px; text-align: left;&quot;&gt;public class test{
        public String Hello () {
            return &quot;Hello!&quot;;
        }
        public String Hello2 ( String name ) {
            return &quot;Hello, &quot; + name + &quot;!&quot;;
        }
        public String[] Hellos () {
            String[]    helloArray  =   {   &quot;Hello!&quot;    ,
                                            &quot;Hello!!&quot;   ,
                                            &quot;Hello!!!&quot;
                                            };
            return    helloArray;
        }
    }
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong style=&quot;background-color: white; color: #666666; font-family: &#39;ＭＳ Ｐゴシック&#39;, Osaka, &#39;ヒラギノ角ゴ Pro W3&#39;, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; text-align: left;&quot;&gt;５． Webサービスの登録&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &#39;ＭＳ Ｐゴシック&#39;, Osaka, &#39;ヒラギノ角ゴ Pro W3&#39;, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; text-align: left;&quot;&gt;① 作成したクラスを右クリック -&amp;gt; Webサービス -&amp;gt; Webサービスの作成を実行&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &#39;ＭＳ Ｐゴシック&#39;, Osaka, &#39;ヒラギノ角ゴ Pro W3&#39;, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; text-align: left;&quot;&gt;② デフォルトの設定で十分なので、なにも設定せずそのまま完了ボタンを押下。&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong style=&quot;background-color: white; color: #666666; font-family: &#39;ＭＳ Ｐゴシック&#39;, Osaka, &#39;ヒラギノ角ゴ Pro W3&#39;, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; text-align: left;&quot;&gt;６． 通信の確認&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &#39;ＭＳ Ｐゴシック&#39;, Osaka, &#39;ヒラギノ角ゴ Pro W3&#39;, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; text-align: left;&quot;&gt;① 以下のURLに接続する。&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &#39;ＭＳ Ｐゴシック&#39;, Osaka, &#39;ヒラギノ角ゴ Pro W3&#39;, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; text-align: left;&quot;&gt;・&lt;/span&gt;&lt;a href=&quot;http://localhost:8080/&quot; style=&quot;background-color: white; color: #ac462f; font-family: &#39;ＭＳ Ｐゴシック&#39;, Osaka, &#39;ヒラギノ角ゴ Pro W3&#39;, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; text-align: left; text-decoration: none;&quot;&gt;http://localhost:8080/&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &#39;ＭＳ Ｐゴシック&#39;, Osaka, &#39;ヒラギノ角ゴ Pro W3&#39;, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; text-align: left;&quot;&gt;&amp;nbsp;プロジェクト名/services/test/Hello&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &#39;ＭＳ Ｐゴシック&#39;, Osaka, &#39;ヒラギノ角ゴ Pro W3&#39;, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; text-align: left;&quot;&gt;[[期待応答]]&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: white; color: #666666; font-size: 12px; line-height: 18px; text-align: left;&quot;&gt;&amp;lt;ns:HelloResponse xmlns:ns=&quot;&lt;a href=&quot;http://ws.apache.org/axis2&quot; rel=&quot;noreferrer&quot; style=&quot;color: #ac462f; cursor: help; display: inline !important; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;http://ws.apache.org/axis2&lt;/a&gt;&quot;&amp;gt;
        &amp;lt;ns:return&amp;gt;Hello!&amp;lt;/ns:return&amp;gt;
    &amp;lt;/ns:HelloResponse&amp;gt;
&lt;/pre&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &#39;ＭＳ Ｐゴシック&#39;, Osaka, &#39;ヒラギノ角ゴ Pro W3&#39;, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; text-align: left;&quot;&gt;・&lt;/span&gt;&lt;a href=&quot;http://localhost:8080/&quot; style=&quot;background-color: white; color: #ac462f; font-family: &#39;ＭＳ Ｐゴシック&#39;, Osaka, &#39;ヒラギノ角ゴ Pro W3&#39;, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; text-align: left; text-decoration: none;&quot;&gt;http://localhost:8080/&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &#39;ＭＳ Ｐゴシック&#39;, Osaka, &#39;ヒラギノ角ゴ Pro W3&#39;, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; text-align: left;&quot;&gt;&amp;nbsp;プロジェクト名/services/test/Hello2?name=Bob&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &#39;ＭＳ Ｐゴシック&#39;, Osaka, &#39;ヒラギノ角ゴ Pro W3&#39;, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; text-align: left;&quot;&gt;[[期待応答&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &#39;ＭＳ Ｐゴシック&#39;, Osaka, &#39;ヒラギノ角ゴ Pro W3&#39;, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; text-align: left;&quot;&gt;]]&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: white; color: #666666; font-size: 12px; line-height: 18px; text-align: left;&quot;&gt;&amp;lt;ns:Hello2Response xmlns:ns=&quot;&lt;a href=&quot;http://ws.apache.org/axis2&quot; rel=&quot;noreferrer&quot; style=&quot;color: #ac462f; cursor: help; display: inline !important; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;http://ws.apache.org/axis2&lt;/a&gt;&quot;&amp;gt;
        &amp;lt;ns:return&amp;gt;Hello, Bob!&amp;lt;/ns:return&amp;gt;
    &amp;lt;/ns:Hello2Response&amp;gt;
&lt;/pre&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &#39;ＭＳ Ｐゴシック&#39;, Osaka, &#39;ヒラギノ角ゴ Pro W3&#39;, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; text-align: left;&quot;&gt;・&lt;/span&gt;&lt;a href=&quot;http://localhost:8080/&quot; style=&quot;background-color: white; color: #ac462f; font-family: &#39;ＭＳ Ｐゴシック&#39;, Osaka, &#39;ヒラギノ角ゴ Pro W3&#39;, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; text-align: left; text-decoration: none;&quot;&gt;http://localhost:8080/&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &#39;ＭＳ Ｐゴシック&#39;, Osaka, &#39;ヒラギノ角ゴ Pro W3&#39;, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; text-align: left;&quot;&gt;&amp;nbsp;プロジェクト名/services/test/Hellos&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &#39;ＭＳ Ｐゴシック&#39;, Osaka, &#39;ヒラギノ角ゴ Pro W3&#39;, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; text-align: left;&quot;&gt;[[期待応答&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &#39;ＭＳ Ｐゴシック&#39;, Osaka, &#39;ヒラギノ角ゴ Pro W3&#39;, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; text-align: left;&quot;&gt;]]&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: white; color: #666666; font-size: 12px; line-height: 18px; text-align: left;&quot;&gt;&amp;lt;ns:HellosResponse xmlns:ns=&quot;&lt;a href=&quot;http://ws.apache.org/axis2&quot; rel=&quot;noreferrer&quot; style=&quot;color: #ac462f; cursor: help; display: inline !important; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;http://ws.apache.org/axis2&lt;/a&gt;&quot;&amp;gt;
        &amp;lt;ns:return&amp;gt;Hello!&amp;lt;/ns:return&amp;gt;
        &amp;lt;ns:return&amp;gt;Hello!!&amp;lt;/ns:return&amp;gt;
        &amp;lt;ns:return&amp;gt;Hello!!!&amp;lt;/ns:return&amp;gt;
    &amp;lt;/ns:HellosResponse&amp;gt;
&lt;/pre&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &#39;ＭＳ Ｐゴシック&#39;, Osaka, &#39;ヒラギノ角ゴ Pro W3&#39;, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; text-align: left;&quot;&gt;＊期待応答はすべてRESTの応答である&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://cheesecomer.blogspot.com/feeds/3558299008156616607/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://cheesecomer.blogspot.com/2012/06/apache-axis2-eclipse-wtp.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1659275078292271790/posts/default/3558299008156616607'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1659275078292271790/posts/default/3558299008156616607'/><link rel='alternate' type='text/html' href='http://cheesecomer.blogspot.com/2012/06/apache-axis2-eclipse-wtp.html' title='Apache Axis2 + Eclipse  + WTP 導入手順'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16433580304011475507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>