function objectToString (obj) {

        var str = '';

        var i=0;

        for (var key in obj) {

            if (obj.hasOwnProperty(key)) {

                if(typeof obj[key] == 'object')

                {

                    if(obj[key] instanceof Array)

                    {

                        str+= key + ' : [ ';

                        for(var j=0;j<obj[key].length;j++)

                        {

                            if(typeof obj[key][j]=='object') {

                                str += '{' + objectToString(obj[key][j]) + (j > 0 ? ',' : '') + '}';

                            }

                            else

                            {

                                str += '\'' + obj[key][j] + '\'' + (j > 0 ? ',' : ''); //non objects would be represented as strings

                            }

                        }

                        str+= ']' + (i > 0 ? ',' : '')

                    }

                    else

                    {

                        str += key + ' : { ' + objectToString(obj[key]) + '} ' + (i > 0 ? ',' : '');

                    }

                }

                else {

                    str +=key + ':\'' + obj[key] + '\'' + (i > 0 ? ',' : '');

                }

                i++;

            }

        }

        return str;

    }

Posted by MR 손
,
Posted by MR 손
,


안드로이드에서 파일 공유시 권한 문제로 인해 오류가 발생 된다.

해결 방법



/res/xml/file_provider.xml
<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<external-path path="Android/data/${applicationId}/" name="files_root" />
<root-path name="root" path="/" />

</paths> 

또는

<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<!--Context.getCacheDir() 내부 저장소-->
<cache-path
name="cache"
path="." />
<!--Context.getFilesDir() 내부 저장소-->
<files-path
name="files"
path="." />
<!-- Environment.getExternalStorageDirectory() 외부 저장소-->
<external-path
name="external"
path="." />
<!-- Context.getExternalCacheDir() 외부 저장소-->
<external-cache-path
name="external-cache"
path="." />
<!-- Context.getExternalFilesDir() 외부 저장소-->
<external-files-path
name="external-files"
path="." />
</paths>

 



 <?xml version="1.0" encoding="utf-8"?>

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="mrsohn.sample"
android:installLocation="auto">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />


<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:hardwareAccelerated="true">
<activity
android:name=".SplashActivity"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity
android:name=".MainActivity"
android:screenOrientation="portrait" />


<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.
fileprovider"

android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_provider_path" />
</provider>


</application>

</manifest>



URI얻어오는 방법 

Uri contentUri = FileProvider.getUriForFile(getContext(),

                    getApplicationContext().getPackageName() + ".fileprovider", 파일경로);



content://패키지명.fileprovider/root/data/data/파일경로 형태로 uri가 생성 된다.


 /**

     * 멀티 파일 공유 

     * @param shareFiles

     */

    public void shareMultiFIles(File[] shareFiles) {

        final Intent intent = new Intent();

        intent.setAction(Intent.ACTION_SEND_MULTIPLE);  // 멀티파일 보내기 

//        intent.setPackage("com.google.android.gm");   // 지메일로 보내기 

        // 파일형태에 맞는 type설정

//        intent.setType("plain/text"); // text 형태로 전달

        intent.setType("*/*");        // 모든 공유 형태 전달

        intent.putExtra(Intent.EXTRA_SUBJECT, "공유 제목");  // 제목

        intent.putExtra(Intent.EXTRA_TEXT, "공유 내용");     // 내용

        if (shareFiles != null && shareFiles.length > 0) {

            ArrayList<Uri> uris = new ArrayList<Uri>();

            for (File file : shareFiles) {

                Uri contentUri = FileProvider.getUriForFile(this,

                        getApplicationContext().getPackageName() + ".fileprovider", file); // manifest의  ${applicationId}.fileprovider

                uris.add(contentUri);

                Log.i(TAG, "contentUri="+contentUri.toString());

            }

            intent.putExtra(Intent.EXTRA_STREAM, uris); // 멀티 파일 전송

        }

        intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);     // 공유 앱에 권한 주기 

        intent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);    // 공유 앱에 권한 주기 

        startActivity(Intent.createChooser(intent, "공유 타이틀"));

    } 



    /**

     * 단일 파일 공유 

     * @param shareFile

     */

    public void shareFIle(File shareFile) {

        final Intent intent = new Intent();

        intent.setAction(Intent.ACTION_SEND);           // 단일파일 보내기 

//        intent.setPackage("com.google.android.gm");   // 지메일로 보내기 

        // 파일형태에 맞는 type설정

        MimeTypeMap type = MimeTypeMap.getSingleton();

        intent.setType(type.getMimeTypeFromExtension(MimeTypeMap.getFileExtensionFromUrl(shareFile.getPath())));

//        intent.setType("plain/text"); // text 형태로 전달

//        intent.setType("*/*");        // 모든 공유 형태 전달 

        intent.putExtra(Intent.EXTRA_SUBJECT, "공유 제목");  // 제목

        intent.putExtra(Intent.EXTRA_TEXT, "공유 내용");     // 내용

        Log.i(TAG, "test.file.getpath="+shareFile.getPath());

        if (shareFile != null) {

            Uri contentUri = FileProvider.getUriForFile(this,

                    getApplicationContext().getPackageName() + ".fileprovider", shareFile); // manifest의  ${applicationId}.fileprovider

     

            intent.putExtra(Intent.EXTRA_STREAM, contentUri); // 단일 파일 전송

        }

        intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);     // 공유 앱에 권한 주기 

        intent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);    // 공유 앱에 권한 주기 

        startActivity(Intent.createChooser(intent, "공유 타이틀"));

    } 



Posted by MR 손
,

Android Studio and android.support.v4.app.Fragment: cannot resolve symbol


해결 방법



I have tried all of the following,

  • Invalidate Caches/Restart
  • Sync project with gradle files
  • Clean project
  • Rebuild project
  • gradlew clean

But, none of them worked for me.

Finally, I solved it by deleting "{ProjectFolder}/.idea/libraries", and then synced with gradle and built again.








출처

https://stackoverflow.com/questions/20386331/android-studio-and-android-support-v4-app-fragment-cannot-resolve-symbol

Posted by MR 손
,

fileuploadsample.html




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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
<!DOCTYPE>
<html>
    <head>
    <style>
        .upload-btn-wrapper {
            position: relative;
            overflow: hidden;
            display: inline-block;
        }
        
        .upload-btn {
            border: 2px solid gray;
            color: gray;
            background-color: white;
            padding: 8px 20px;
            border-radius: 8px;
            font-size: 20px;
            font-weight: bold;
        }
        
        .upload-btn-wrapper input[type=file] {
            font-size: 100px;
            position: absolute;
            left: 0;
            top: 0;
            opacity: 0;
        }
        
        #fileDragDesc {
            width: 100%; 
            height: 100%; 
            margin-left: auto; 
            margin-right: auto; 
            padding: 5px; 
            text-align: center; 
            line-height: 300px; 
            vertical-align:middle;
        }
    </style>
    
    <script src="http://code.jquery.com/jquery-latest.js"></script>
    
        <script type="text/javascript">
            $(document).ready(function() {
                $("#input_file").bind('change'function() {
                    selectFile(this.files);
                    //this.files[0].size gets the size of your file.
                    //alert(this.files[0].size);
                });
            });
        
            // 파일 리스트 번호
            var fileIndex = 0;
            // 등록할 전체 파일 사이즈
            var totalFileSize = 0;
            // 파일 리스트
            var fileList = new Array();
            // 파일 사이즈 리스트
            var fileSizeList = new Array();
            // 등록 가능한 파일 사이즈 MB
            var uploadSize = 50;
            // 등록 가능한 총 파일 사이즈 MB
            var maxUploadSize = 500;
    
            $(function() {
                // 파일 드롭 다운
                fileDropDown();
            });
    
            // 파일 드롭 다운
            function fileDropDown() {
                var dropZone = $("#dropZone");
                //Drag기능 
                dropZone.on('dragenter'function(e) {
                    e.stopPropagation();
                    e.preventDefault();
                    // 드롭다운 영역 css
                    dropZone.css('background-color''#E3F2FC');
                });
                dropZone.on('dragleave'function(e) {
                    e.stopPropagation();
                    e.preventDefault();
                    // 드롭다운 영역 css
                    dropZone.css('background-color''#FFFFFF');
                });
                dropZone.on('dragover'function(e) {
                    e.stopPropagation();
                    e.preventDefault();
                    // 드롭다운 영역 css
                    dropZone.css('background-color''#E3F2FC');
                });
                dropZone.on('drop'function(e) {
                    e.preventDefault();
                    // 드롭다운 영역 css
                    dropZone.css('background-color''#FFFFFF');
    
                    var files = e.originalEvent.dataTransfer.files;
                    if (files != null) {
                        if (files.length < 1) {
                            /* alert("폴더 업로드 불가"); */
                            console.log("폴더 업로드 불가");
                            return;
                        } else {
                            selectFile(files)
                        }
                    } else {
                        alert("ERROR");
                    }
                });
            }
    
            // 파일 선택시
            function selectFile(fileObject) {
                var files = null;
    
                if (fileObject != null) {
                    // 파일 Drag 이용하여 등록시
                    files = fileObject;
                } else {
                    // 직접 파일 등록시
                    files = $('#multipaartFileList_' + fileIndex)[0].files;
                }
    
                // 다중파일 등록
                if (files != null) {
                    
                    if (files != null && files.length > 0) {
                        $("#fileDragDesc").hide(); 
                        $("fileListTable").show();
                    } else {
                        $("#fileDragDesc").show(); 
                        $("fileListTable").hide();
                    }
                    
                    for (var i = 0; i < files.length; i++) {
                        // 파일 이름
                        var fileName = files[i].name;
                        var fileNameArr = fileName.split("\.");
                        // 확장자
                        var ext = fileNameArr[fileNameArr.length - 1];
                        
                        var fileSize = files[i].size; // 파일 사이즈(단위 :byte)
                        console.log("fileSize="+fileSize);
                        if (fileSize <= 0) {
                            console.log("0kb file return");
                            return;
                        }
                        
                        var fileSizeKb = fileSize / 1024// 파일 사이즈(단위 :kb)
                        var fileSizeMb = fileSizeKb / 1024;    // 파일 사이즈(단위 :Mb)
                        
                        var fileSizeStr = "";
                        if ((1024*1024<= fileSize) {    // 파일 용량이 1메가 이상인 경우 
                            console.log("fileSizeMb="+fileSizeMb.toFixed(2));
                            fileSizeStr = fileSizeMb.toFixed(2+ " Mb";
                        } else if ((1024<= fileSize) {
                            console.log("fileSizeKb="+parseInt(fileSizeKb));
                            fileSizeStr = parseInt(fileSizeKb) + " kb";
                        } else {
                            console.log("fileSize="+parseInt(fileSize));
                            fileSizeStr = parseInt(fileSize) + " byte";
                        }
    
                        /* if ($.inArray(ext, [ 'exe', 'bat', 'sh', 'java', 'jsp', 'html', 'js', 'css', 'xml' ]) >= 0) {
                            // 확장자 체크
                            alert("등록 불가 확장자");
                            break; */
                        if ($.inArray(ext, [ 'hwp''doc''docx''xls''xlsx''ppt''pptx''txt''png''pdf''jpg''jpeg''gif''zip' ]) <= 0) {
                            // 확장자 체크
                            /* alert("등록이 불가능한 파일 입니다.");
                            break; */
                            alert("등록이 불가능한 파일 입니다.("+fileName+")");
                        } else if (fileSizeMb > uploadSize) {
                            // 파일 사이즈 체크
                            alert("용량 초과\n업로드 가능 용량 : " + uploadSize + " MB");
                            break;
                        } else {
                            // 전체 파일 사이즈
                            totalFileSize += fileSizeMb;
    
                            // 파일 배열에 넣기
                            fileList[fileIndex] = files[i];
    
                            // 파일 사이즈 배열에 넣기
                            fileSizeList[fileIndex] = fileSizeMb;
    
                            // 업로드 파일 목록 생성
                            addFileList(fileIndex, fileName, fileSizeStr);
    
                            // 파일 번호 증가
                            fileIndex++;
                        }
                    }
                } else {
                    alert("ERROR");
                }
            }
    
            // 업로드 파일 목록 생성
            function addFileList(fIndex, fileName, fileSizeStr) {
                /* if (fileSize.match("^0")) {
                    alert("start 0");
                } */
    
                var html = "";
                html += "<tr id='fileTr_" + fIndex + "'>";
                html += "    <td id='dropZone' class='left' >";
                html += fileName + " (" + fileSizeStr +") " 
                        //+ "<a href='#' onclick='deleteFile(" + fIndex + "); return false;' class='btn small bg_02'> 삭제</a>"
                        
                        + "<input value='삭제' type='button' href='#' onclick='deleteFile(" + fIndex + "); return false;'>"
                html += "    </td>"
                html += "</tr>"
    
                $('#fileTableTbody').append(html);
            }
    
            // 업로드 파일 삭제
            function deleteFile(fIndex) {
                console.log("deleteFile.fIndex=" + fIndex);
                // 전체 파일 사이즈 수정
                totalFileSize -= fileSizeList[fIndex];
    
                // 파일 배열에서 삭제
                delete fileList[fIndex];
    
                // 파일 사이즈 배열 삭제
                delete fileSizeList[fIndex];
    
                // 업로드 파일 테이블 목록에서 삭제
                $("#fileTr_" + fIndex).remove();
                
                console.log("totalFileSize="+totalFileSize);
                
                if (totalFileSize > 0) {
                    $("#fileDragDesc").hide(); 
                    $("fileListTable").show();
                } else {
                    $("#fileDragDesc").show(); 
                    $("fileListTable").hide();
                }
            }
    
            // 파일 등록
            function uploadFile() {
                // 등록할 파일 리스트
                var uploadFileList = Object.keys(fileList);
    
                // 파일이 있는지 체크
                if (uploadFileList.length == 0) {
                    // 파일등록 경고창
                    alert("파일이 없습니다.");
                    return;
                }
    
                // 용량을 500MB를 넘을 경우 업로드 불가
                if (totalFileSize > maxUploadSize) {
                    // 파일 사이즈 초과 경고창
                    alert("총 용량 초과\n총 업로드 가능 용량 : " + maxUploadSize + " MB");
                    return;
                }
    
                if (confirm("등록 하시겠습니까?")) {
                    // 등록할 파일 리스트를 formData로 데이터 입력
                    var form = $('#uploadForm');
                    var formData = new FormData(form);
                    for (var i = 0; i < uploadFileList.length; i++) {
                        formData.append('files', fileList[uploadFileList[i]]);
                    }
    
                    $.ajax({
                        url : "업로드 경로",
                        data : formData,
                        type : 'POST',
                        enctype : 'multipart/form-data',
                        processData : false,
                        contentType : false,
                        dataType : 'json',
                        cache : false,
                        success : function(result) {
                            if (result.data.length > 0) {
                                alert("성공");
                                location.reload();
                            } else {
                                alert("실패");
                                location.reload();
                            }
                        }
                    });
                }
            }
        </script>
    </head>
    <body>
        
        <div class="upload-btn-wrapper">
            <input type="file" id="input_file" multiple="multiple" style="height: 100%;" />
            <button class="upload-btn">파일선택</button>
        </div>
        <br />
    
        <form name="uploadForm" id="uploadForm" enctype="multipart/form-data" method="post">
    
            <div id="dropZone" style="width: 500px; height: 300px; border-style: solid; border-color: black; ">
                <div id="fileDragDesc"> 파일을 드래그 해주세요. </div>
            
                
                <table id="fileListTable" width="100%" border="0px">
                    <tbody id="fileTableTbody">
    
                    </tbody>
                </table>
            </div>
    
        </form>
        
        
        <input type="button" onclick="uploadFile(); return false;" class="btn bg_01" value="파일 업로드">
    
    
    
    </body>
</html>
 
 
 
cs


Posted by MR 손
,

Where 절 초성 검색 쿼리 입니다.


사용법

1
2
3
4
5
6
7
8
9
public String searchSql(String searchStr) {
    String sql = "Select * FROM " + {TABLE_NAME};
        if (TextUtils.isEmpty(searchStr) == false) {
            sql += " WHERE ";
            sql += ChoSearchQuery.makeQuery(searchStr);
        }
    
    return sql;
}
cs


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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
public class ChoSearchQuery {
    public static final int EVENT_CODE_LENGTH = 6;
 
    public static final int DIGIT_BEGIN_UNICODE = 0x30//0
    public static final int DIGIT_END_UNICODE = 0x3A//9
    
    public static final int QUERY_DELIM = 39;//'
    public static final int LARGE_ALPHA_BEGIN_UNICODE = 0;
 
    public static final int HANGUL_BEGIN_UNICODE = 0xAC00// 가
    public static final int HANGUL_END_UNICODE = 0xD7A3// ?
    public static final int HANGUL_CHO_UNIT = 588//한글 초성글자간 간격
    public static final int HANGUL_JUNG_UNIT = 28//한글 중성글자간 간격
 
    public static final char[] CHO_LIST = { 'ㄱ''ㄲ''ㄴ''ㄷ''ㄸ''ㄹ',
            'ㅁ''ㅂ''ㅃ''ㅅ''ㅆ''ㅇ''ㅈ''ㅉ''ㅊ''ㅋ''ㅌ''ㅍ''ㅎ' };
    public static final boolean[] CHO_SEARCH_LIST = { truefalsetruetruefalsetrue,
        truetruefalsetruefalsetruetruefalsetruetruetruetruetrue };
 
    /**
     * 문자를 유니코드(10진수)로 변환 후 반환한다.
     * @param ch 문자
     * @return 10진수 유니코드
     */
    public static int convertCharToUnicode(char ch) {
        return (int) ch;
    }
    
    /**
     * 10진수를 16진수 문자열로 변환한다.
     * @param decimal 10진수 숫자
     * @return 16진수 문자열
     */
    private static String toHexString(int decimal) {
        Long intDec = Long.valueOf(decimal);
        return Long.toHexString(intDec);
    }
 
    /**
     * 유니코드(16진수)를 문자로 변환 후 반환한다.
     * @param hexUnicode Unicode Hex String
     * @return 문자값
     */
    public static char convertUnicodeToChar(String hexUnicode) {
        return (char) Integer.parseInt(hexUnicode, 16);
    }
 
    /**
     * 유니코드(10진수)를 문자로 변환 후 반환한다.
     * @param unicode
     * @return 문자값
     */
    public static char convertUnicodeToChar(int unicode) {
        return convertUnicodeToChar(toHexString(unicode));
    }
    
    /**
     * 검색 문자열을 파싱해서 SQL Query 조건 문자열을 만든다.
     * @param strSearch 검색 문자열
     * @return SQL Query 조건 문자열
     */    
    public static String makeQuery(String strSearch){
        strSearch = strSearch == null ? "null" : strSearch.trim();
        
        StringBuilder retQuery = new StringBuilder();
        
            int nChoPosition;
            int nNextChoPosition;
            int StartUnicode;
            int EndUnicode;
            
            int nQueryIndex = 0;
//            boolean bChosung = false;
            StringBuilder query = new StringBuilder();
            forint nIndex = 0 ; nIndex < strSearch.length() ; nIndex++ ){
                nChoPosition = -1;
                nNextChoPosition = -1;
                StartUnicode = -1;
                EndUnicode = -1;
                
                if( strSearch.charAt(nIndex) == QUERY_DELIM )
                    continue;
                
                if( nQueryIndex != 0 ){
                    query.append(" AND ");
                }
                
                forint nChoIndex = 0 ; nChoIndex < CHO_LIST.length ; nChoIndex++ ){                    
                    if( strSearch.charAt(nIndex) == CHO_LIST[nChoIndex] ){
                        nChoPosition = nChoIndex;
                        nNextChoPosition = nChoPosition+1;
                        for( ; nNextChoPosition < CHO_SEARCH_LIST.length ; nNextChoPosition++ ){
                            if( CHO_SEARCH_LIST[nNextChoPosition] )
                                break;
                        }
                        break;
                    }
                }
                
                if( nChoPosition >= 0 ){ //초성이 있을 경우
//                    bChosung = true;
                    StartUnicode = HANGUL_BEGIN_UNICODE + nChoPosition*HANGUL_CHO_UNIT;
                    EndUnicode = HANGUL_BEGIN_UNICODE + nNextChoPosition*HANGUL_CHO_UNIT;                    
                }
                else
                    int Unicode = convertCharToUnicode(strSearch.charAt(nIndex));
                    if( Unicode >= HANGUL_BEGIN_UNICODE && Unicode <= HANGUL_END_UNICODE){
                        int Jong = ((Unicode-HANGUL_BEGIN_UNICODE)%HANGUL_CHO_UNIT)%HANGUL_JUNG_UNIT;                    
                        
                        if( Jong == 0 ){// 초성+중성으로 되어 있는 경우 
                            StartUnicode = Unicode;                        
                            EndUnicode = Unicode+HANGUL_JUNG_UNIT;                        
                        }
                        else{
                            StartUnicode = Unicode;                        
                            EndUnicode = Unicode;
                        }
                    }
                }
                
                //Log.d("SearchQuery","query "+strSearch.codePointAt(nIndex));
                if( StartUnicode > 0 && EndUnicode > 0 ){
                    if( StartUnicode == EndUnicode )
                        query.append("substr(name,"+(nIndex+1)+",1)='"+strSearch.charAt(nIndex)+"'");
                    else
                        query.append("(substr(name,"+(nIndex+1)+",1)>='"+convertUnicodeToChar(StartUnicode)
                            +"' AND substr(name,"+(nIndex+1)+",1)<'"+convertUnicodeToChar(EndUnicode)+"')");
                }
                else{
                    if( Character.isLowerCase(strSearch.charAt(nIndex))){ //영문 소문자
                        query.append("(substr(name,"+(nIndex+1)+",1)='"+strSearch.charAt(nIndex)+"'"
                                + " OR substr(name,"+(nIndex+1)+",1)='"+Character.toUpperCase(strSearch.charAt(nIndex))+"')");
                    }
                    else if( Character.isUpperCase(strSearch.charAt(nIndex))){ //영문 대문자
                        query.append("(substr(name,"+(nIndex+1)+",1)='"+strSearch.charAt(nIndex)+"'"
                                + " OR substr(name,"+(nIndex+1)+",1)='"+Character.toLowerCase(strSearch.charAt(nIndex))+"')");
                    }
                    else //기타 문자
                        query.append("substr(name,"+(nIndex+1)+",1)='"+strSearch.charAt(nIndex)+"'");
                }
                
                nQueryIndex++;
            }
            
            if(query.length() > 0 && strSearch != null && strSearch.trim().length() > 0) {
                retQuery.append("("+query.toString()+")");
                
                if(strSearch.indexOf(" "!= -1) {
                    // 공백 구분 단어에 대해 단어 모두 포함 검색
                    String[] tokens = strSearch.split(" ");
                    retQuery.append(" OR (");
                    for(int i=0, isize=tokens.length; i<isize; i++) {
                        String token = tokens[i];
                        if(i != 0) {
                            retQuery.append(" AND ");
                        }
                        retQuery.append("name like '%"+token+"%'");
                    }
                    retQuery.append(")");
                } else {
                    // LIKE 검색 추가
                    retQuery.append(" OR name like '%"+strSearch+"%'");
                }
            } else {
                retQuery.append(query.toString());
            }
//        }
        //Log.d("SearchQuery","query "+query.toString());
        return retQuery.toString();
    }    
 
}
 
cs


Posted by MR 손
,

xxhdpi 75dp

xhdpi 50dp


Rect CheckRect = new Rect();

Window window = getWindow();

window.getDecorView().getWindowVisibleDisplayFrame(CheckRect);

int nStatusBarHeight = CheckRect.top;


Posted by MR 손
,


부트캠프 설치시 부트캠프 지원 소프트웨어를 찾을수 없다 는 메시지가 뜨면 아래의 사이트에서 다운 받아 사용하세요.



https://support.apple.com/ko_KR/downloads/macoscomponents

Posted by MR 손
,