블로그 이미지
SuperMjs

calendar

1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30

Notice

Error Message 

xcrun: Error: could not stat active Xcode path '/Volumes/Xcode/Xcode.app/Contents/Developer'. (No such file or directory)



Solution ) 

$ sudo xcode-select -switch (your Xcode Path)

ex > $ sudo xcode-select -switch /Applications/Xcode.app/



'Program Languages > iOS / Objective-C' 카테고리의 다른 글

Objective C의 함수포인터  (0) 2012.08.01
posted by SuperMjs

An Android slider (or a SeekBar as it’s called in the Android world) is a pretty slick UI tool which we recently used in our Call Your Folks! app as a means of choosing a reminder frequency between one day and three months.

I’ll walk you through creating a custom-styled seekbar for your Android application using nothing but a few XML and image drawables.

In this tutorial, I assume that you know how to implement a SeekBar in your app; if you don’t, check out the Android API demos, specifically SeekBar1.java and seekbar_1.xml.

Step 1: Create Your Image Drawables (9-Patch)

Before creating any XML drawables, make sure you create the image drawables (including one9-patch drawable) needed for the seekbar background, handle, and progress sections. The 9-patch drawables will be put to use by the XML drawables in the steps below.

Create the following drawables and place them in your /res/drawable/ folder:



Step 2: SeekBar Progress Drawable

Now create an XML drawable for the Android seekbar progress (the blue-striped section in the example), call it seekbar_progress_bg.xml, and place it in your /res/drawable/folder:

01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?xml version="1.0" encoding="utf-8"?>
 <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item>
        <clip>
            <shape>
                <gradient
                    android:startColor="#FF5e8ea3"
                    android:centerColor="#FF32a0d2"
                    android:centerY="0.1"
                    android:endColor="#FF13729e"
                    android:angle="270"
                />
            </shape>
        </clip>
    </item>
    <item>
        <clip>
        <bitmap xmlns:android="http://schemas.android.com/apk/res/android"
            android:src="@drawable/stripe_bg"
            android:tileMode="repeat"
            android:antialias="true"
            android:dither="false"
            android:filter="false"
            android:gravity="left"
        />
        </clip>
    </item>
</layer-list>

The above XML first draws a semi-transparent, blue gradient, then layers the semi-transparent stripe image on top of the gradient. The highlighted line of code (line 20) refers to the stripe (semi-transparent) image inside your drawable folder, created in Step 1.

For more information on creating custom shapes via XML, check out the Android drawable resources docs, specifically the bitmap and shape sections.

Step 3: SeekBar Background Drawable

Next create the main seekbar progress drawable; it’ll assign a drawable to the seekbar progressand secondaryProgress actions inside your seekbar. Name your drawable something likeseekbar_progress.xml, place it inside your /res/drawable/ folder:

01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:id="@android:id/background">
        <nine-patch
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:src="@drawable/seekbar_background"
            android:dither="true"
         />
    </item>
    <item android:id="@android:id/secondaryProgress">
        <clip>
            <shape>
                <gradient
                    android:startColor="#80028ac8"
                    android:centerColor="#80127fb1"
                    android:centerY="0.75"
                    android:endColor="#a004638f"
                    android:angle="270"
                />
            </shape>
        </clip>
    </item>
    <item
        android:id="@android:id/progress"
        android:drawable="@drawable/seekbar_progress_bg"
    />
</layer-list>

The first bit of highlighted code above (line 8) is referring to the seekbar background image (9-patch drawable) created in Step 1 and (line 29) is referring to the drawable you created above in Step 2.

Step 4: Bringing it all together…

At this point, all you need to do is call your seekbar_progress drawable when declaring your seekbar:

01
02
03
04
05
06
07
08
09
10
<SeekBar
        android:id="@+id/frequency_slider"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:max="20"
        android:progress="0"
        android:secondaryProgress="0"
        android:progressDrawable="@drawable/seekbar_progress"
        android:thumb="@drawable/seek_thumb"
/>

The two lines of highlighted code are setting the progress and thumb drawables for the SeekBar item. The @drawable/seekbar_progress refers to the XML drawable created in the previous step.

See it in action!

For a “live demo” of the seekbar bar being used, download our Call Your Folks! app.

For more information on the Android SeekBar, check out the Android docs.



Source : http://www.mokasocial.com/2011/02/create-a-custom-styled-ui-slider-seekbar-in-android/

posted by SuperMjs

Objective-C에서는 C에서의 함수 포인터와 비슷한 개념으로 SEL 데이터 타입이 존재 존재함.


@selector지시어와 메소드 이름으로 사용한다.



@interface


@implimentation


'Program Languages > iOS / Objective-C' 카테고리의 다른 글

[XCode] How to change 'xcrun' path?  (0) 2012.09.21
posted by SuperMjs
Eclipse에서..
Connot run program "make" : unknown reason 또는 Connot run program "bash" : unknown reason 등의 문제가 발생하는 경우

 1. Terminal에서 bash, make, gcc등 설치가 되어있는지 확인



2. Eclipse > Properties > C/C++ Build > Tool Chain Editor에서 자신이 원하는 환경에 맞는 GCC인가를 확인


 
3. Eclipse > Properties > C/C++ Build > Environment에서 PATH가 올바르게 설정되었는지 확인
- 현재 시스템의 PATH확인


- PATH가 다르게 적용된 경우 Eclipse의 PATH에 설정




∴ 위 세 가지를 확인하면 대부분의 문제는 해결 됨.


ps) 아래의 경우, GCC 선택이 잘못되어서 나타나는 경우일 수도 있음.(2번 방법으로 해결)
**** WARNING: The "Debug" Configuration may not build ****
**** because it uses the "Cygwin GCC" ****
**** tool-chain that is unsupported on this system. ****
 
posted by SuperMjs
2011. 12. 23. 11:16 Program Languages/Android / JAVA

If you're changing workspaces on OS X and you import an SVN-based project into your new workspace, some of your files may have the uchg flag set. SubClipse/SVN will not be able to update this project. You will get an error:

svn: Cannot rename file

every time you try invoke svn. If you issue:

chflags -R nouchg .

at the top-level of the project directory this will clear these flags and restore SVN function.


http://yalamber.com/2011/11/svn-issues-unable-to-rename/ 

posted by SuperMjs

JSON (JavaScript Object Notation)은 경량의 DATA-교환 형식이다. 이 형식은 사람이 읽고 쓰기에 용이하며, 기계가 분석하고 생성함에도 용이하다. JavaScript Programming LanguageStandard ECMA-262 3rd Edition - December 1999의 일부에 토대를 두고 있다. JSON은 완벽하게 언어로 부터 독립적이지만 C-family 언어 - C, C++, C#, Java, JavaScript, Perl, Python 그외 다수 - 의 프로그래머들에게 친숙한 관습을 사용하는 텍스트 형식이다. 이러한 속성들이 JSON을 이상적인 DATA-교환 언어로 만들고 있다.

JSON은 두개의 구조를 기본으로 두고 있다:

  • name/value 형태의 쌍으로 collection 타입. 다양한 언어들에서, 이는 object, record, struct(구조체), dictionary, hash table, 키가 있는 list, 또는 연상배열로서 실현 되었다.
  • 값들의 순서화된 리스트. 대부분의 언어들에서, 이는 array, vector, list, 또는 sequence로서 실현 되었다.

이러한 것들은 보편적인 DATA 구조이다. 사실상 모든 현대의 프로그래밍 언어들은 어떠한 형태로든 이것들을 지원한다. 프로그래밍 언어들을 이용하여 호환성 있는 DATA 형식이 이러한 구조들을 근간에 두고 있는 것은 당연하다.

JSON 에서, 이러한 형식들을 가져간다:

object는 name/value 쌍들의 비순서화된 SET이다. object는 { (좌 중괄호)로 시작하고 } (우 중괄호)로 끝내어 표현한다. 각 name 뒤에 : (colon)을 붙이고 , (comma)로 name/value 쌍들 간을 구분한다.

array은 값들의 순서화된 collection 이다. array는 [ (left bracket)로 시작해서 ] (right bracket)로 끝내어 표현한다. , (comma)로 array의 값들을 구분한다.

value는 큰따옴표안에 stringnumber ,true ,false , nullobject ,array이 올수 있다. 이러한 구조들을 포함한다.

string은 큰따옴표안에 둘러 싸인 zero 이상 Unicode 문자들의 조합이며, 쌍다옴표안에 감싸지며,backslash escape가 적용된다. 하나의 문자(character)도 하나의 문자열(character string)로서 표현된다. string은 C 또는 Java 문자열 처럼 매우 많이 비슷하다.

number는 8진수와 16진수 형식을 사용하지 않는것을 제외하면 C와 Java number 처럼 매우 많이 비슷하다.

토근들의 어떤 쌍 사이에 공백을 삽입할수 있다. 드물게 encode된 세부 항목을 제외하면, 이렇게 설명된 JSON의 형식은 완벽하게 그 언어를 설명한다.




http://www.json.org/json-ko.html
posted by SuperMjs

다음과 같은 순서로 진행한다.
  • Close Eclipse
  • Disconnect USB cable
  • Kill all adb instances on the task manager of your computer
  • Start Eclipse
  • Connect USB cable
  • Launch the application

해결이 안된다면 /etc/hosts 파일을 열어서 127.0.0.1  localhost가 추가 되었는지 확인.


만약  Aptana를 설치한 경우라면 


위와 같이 Preference - Android - DDMS - Base local debugger port에 값을 8601로 변경 후 재시작!



posted by SuperMjs
1. Install New Software





2.  Add Repository


Link : http://download.aptana.com/tools/studio/plugin/install/studio


3. Select all and Press Next Button




4.  Press next button




5. Accept to install




6. Install



posted by SuperMjs
연락처 목록 화면을 호출하는 부분

Intent intent = new Intent(Intent.ACTION_PICK); 
intent.setData(ContactsContract.CommonDataKinds.Phone.CONTENT_URI);
또는 intent
.setData(Uri.parse("content://com.android.contacts/data/phones")); 
startActivityForResult(intent, 0);




연락처 목록 화면에서 선택된 결과를 반영하는 부분

Cursor cursor = getContentResolver().query(data.getData(), 

    new String[]{ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME

ContactsContract.CommonDataKinds.Phone.NUMBER}, null, null, null);

cursor.moveToFirst();

mTelephone.setText(cursor.getString(1));
//cursor.getString(0)의 경우 선택된 아이템의 이름을 가지고 온다. 

cursor.close();

 
posted by SuperMjs

Set attribute at called activity in AndroidManifest.xml



posted by SuperMjs
prev 1 2 next