Title bar를 없애는 방법은 activity 메소드에 android:theme="@android:style/Theme.NoTitleBar" 항목을 추가 하면 된다.


 <activity android:name=".EcoAgentUITest1"

                  android:label="@string/app_name"

                  

android:theme=

"@android:style/Theme.NoTitleBar">
                            
<intent-filter>

                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />

            </intent-filter>

</activity> 
 

* Notification Menu까지 모두 없애고 FullScreen으로 사용 하려면 아래 항목을 추가 하면 된다. 
 android:theme="@android:style/Theme.NoTitleBar.Fullscreen 

Posted by 다크쌍피
package exercice1.identificateur.ex;
 
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.net.SocketException;
import java.util.Enumeration;
 
import android.app.ListActivity;
import android.os.Bundle;
import android.util.Log;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import exercice1.identificateur.R;
 
public class wifi1 extends ListActivity {
private static final String LOG_TAG = null;
public String getLocalIpAddress() {
   try {
       for (Enumeration en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements();) {
           NetworkInterface intf = en.nextElement();
           for (Enumeration enumIpAddr = intf.getInetAddresses(); enumIpAddr.hasMoreElements();) {
               InetAddress inetAddress = enumIpAddr.nextElement();
               if (!inetAddress.isLoopbackAddress()) {
                   return inetAddress.getHostAddress().toString();
               }
           }
       }
   } catch (SocketException ex) {
       Log.e(LOG_TAG, ex.toString());
   }
   return null;
}
 
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TextView tv = new TextView(this);
     tv.setText(getLocalIpAddress());
     setContentView(tv);  
}
}
Posted by 다크쌍피
MAC OSX용 "Eclipse IDE for JAVA Developers" 환경 구성 파일.

설정 방법 :
File -> Import -> General -> Preferences -> "Next > " -> Browser -> PreferencesForEclipse_JAVA_xxxxxx.epf 선택 -> "Finish"

변경 사항 :
1. Syntax Color


Posted by 다크쌍피
Eclipse 에서 File Search를 할 때 잘되던것이 가끔
아래와 같은 에러가 발생한다.

'File Search' has encountered a problem.

Problems encountered during text search.


이는 Eclipse 가 아닌 다른 에디터로 Eclipse에 있는 파일을

에디팅 했을 경우 발생하는데 이를 해결하기 위한 방법은


Eclipse의 Package Explorer에서 마우스 오른쪽 키를 누른 후 

Refresh 해주면 해결이 된다.

[출처] File Search Error|작성자 사이비리


Posted by 다크쌍피
Mac OSX에서 Wireshark 설치 후 실행하면 인터페이스를 찾을 수 없다고 나온다.
이것은 디바이스에 권한 때문인데 권한을 변경하면 해결 할 수 있다.

sudo chmod 644 /dev/bpf* 


Posted by 다크쌍피
Programming & Tools/Android2011. 2. 24. 12:07
JNI를 사용하여 라이브러리 생성 시 디버깅 하기가 어렵다.
이를 해결하기 위해서 일반 printf 처럼 사용하는 방법이다.

1) android_log.h 파일을 생성한다.

#ifndef __ANDROID_LOG_H__

#define __ANDROID_LOG_H__


#include <android/log.h>


#define LOGV(...) __android_log_print(ANDROID_LOG_VERBOSE, "libnav", __VA_ARGS__)

#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, "libnav", __VA_ARGS__)

#define LOGI(...) __android_log_print(ANDROID_LOG_INFO, "libnav", __VA_ARGS__)

#define LOGW(...) __android_log_print(ANDROID_LOG_WARN, "libnav", __VA_ARGS__)

#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, "libnav", __VA_ARGS__)


#endif /* __ANDROID_LOG_H__ */



2) Android.mk 파일에 라이브러 추가.

LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -llog

LOCAL_CFLAGS := -DCONFIG_EMBEDDED\ -DUSE_IND_THREAD\



3) 디버깅 할 c 파일에 #include "android_log.h" 추가.

4) Eclipse 에서 디버그로 실행 하면 Log cat 창으로 출력.

* Log cat 은 Window > Show View > Other > Log cat 에 있음.
Posted by 다크쌍피
Programming & Tools/Android2011. 2. 24. 11:55
JNI를 사용해서 socket 생성 시 인터넷 사용 권한을 주지 않으면
소켓 생성 error 가 발생한다.

AndroidManifest.xml 파일에  다음 항목 추가.


<manifest ...> 

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

</manifest> 




Posted by 다크쌍피
MAC OSX용 "Eclipse IDE for C/C++ Developers" 환경 구성 파일.

설정 방법 :
File -> Import -> General -> Preferences -> "Next > " -> Browser -> Eclipse_C_Preferences.epf 선택 -> "Finish"

변경 사항 :
1. Syntax Color
2. 이전 파일 에디터 보기 변경 : control + tab , shift + control + tab
3. block comment : control + /
4. unblock comment : shift + control + \

Posted by 다크쌍피

pjlib를 컴파일 하기 위해서 Direct SDK를 설치하다 Error : S1010 을 만났다.

구글링 해봤더니 Service에서 Windows Audio를 Disable 한 후 설치 한다. 바이러스 프로그램을

Disable한다 등 여러가지가 있었는데.. 결론은 익스플로러 8에서 받으면 안된다는 것이다.

이런 어처구니 없는 경우가...

FireFox로 받으면 정상적으로 설치가 된다.. ㅡㅡ;;
Posted by 다크쌍피
Programming & Tools/Delphi2010. 4. 29. 16:25

Strings and characters
Text types
Like many other languages, Delphi allows you to store letters, words, and sentences in single variables. These can be used to store and display such things as user details, screen titles and so on. A letter is stored in a single character variable type, such as Char, and words and sentences stored in string types, such as String. Here are the different text types in Delphi:
 
 var
   Str1 : Char;        // Holds a single character, small alphabet
   Str2 : WideChar;    // Holds a single character, International alphabet
   Str3 : AnsiChar;    // Holds a single character, small alphabet
   Str4 : ShortString; // Holds a string of up to 255 Char's
   Str5 : String;      // Holds strings of Char's of any size desired
   Str6 : AnsiString;  // Holds strings of AnsiChar's any size desired
   Str7 : WideString;  // Holds strings of WideChar's of any size desired

We'll cover the character and string types in turn, and then look at some of the large range of string processing routines provided by the Delphi run time library.
 

Characters
Single character variables hold a single character of text. Normally, this can be held in one byte. AnsiChar types are exactly one byte in size, and can hold any of the characters in the Ansi character set.
 
The Ansi character set
 Char Code Description
 
       9  Tab
      10  Line feed
      13  Carriage return
 ' '  32  Space
  !   33  Exclamation mark
  "   34  Quotation mark
  #   35  Number sign
  $   36  Dollar sign
  %   37  Percent sign
  &   38  Ampersand
  '   39  Apostrophe
  (   40  Left parenthesis
  )   41  Right parenthesis
  *   42  Asterisk
  +   43  Plus sign
  ,   44  Comma
  -   45  Hyphen-minus
  .   46  Full stop
  /   47  Solidus
  0   48  Digit zero
  1   49  Digit one
  2   50  Digit two
  3   51  Digit three
  4   52  Digit four
  5   53  Digit five
  6   54  Digit six
  7   55  Digit seven
  8   56  Digit eight
  9   57  Digit nine
  :   58  Colon
  ;   59  Semicolon
  <   60  Less-than sign
  =   61  Equals sign
  >   62  Greater-than sign
  ?   63  Question mark
  @   64  Commercial at
  A   65  Latin capital letter A
  B   66  Latin capital letter B
  C   67  Latin capital letter C
  D   68  Latin capital letter D
  E   69  Latin capital letter E
  F   70  Latin capital letter F
  G   71  Latin capital letter G
  H   72  Latin capital letter H
  I   73  Latin capital letter I
  J   74  Latin capital letter J
  K   75  Latin capital letter K
  L   76  Latin capital letter L
  M   77  Latin capital letter M
  N   78  Latin capital letter N
  O   79  Latin capital letter O
  P   80  Latin capital letter P
  Q   81  Latin capital letter Q
  R   82  Latin capital letter R
  S   83  Latin capital letter S
  T   84  Latin capital letter T
  U   85  Latin capital letter U
  V   86  Latin capital letter V
  W   87  Latin capital letter W
  X   88  Latin capital letter X
  Y   89  Latin capital letter Y
  Z   90  Latin capital letter Z
  [   91  Left square bracket
  \   92  Reverse solidus
  ]   93  Right square bracket
  ^   94  Circumflex accent
  _   95  Low line
  `   96  Grave accent
  a   97  Latin small letter a
  b   98  Latin small letter b
  c   99  Latin small letter c
  d  100  Latin small letter d
  e  101  Latin small letter e
  f  102  Latin small letter f
  g  103  Latin small letter g
  h  104  Latin small letter h
  i  105  Latin small letter i
  j  106  Latin small letter j
  k  107  Latin small letter k
  l  108  Latin small letter l
  m  109  Latin small letter m
  n  110  Latin small letter n
  o  111  Latin small letter o
  p  112  Latin small letter p
  q  113  Latin small letter q
  r  114  Latin small letter r
  s  115  Latin small letter s
  t  116  Latin small letter t
  u  117  Latin small letter u
  v  118  Latin small letter v
  w  119  Latin small letter w
  x  120  Latin small letter x
  y  121  Latin small letter y
  z  122  Latin small letter z
  {  123  left curly bracket
  |  124  Vertical line
  }  125  Right curly bracket
  ~  126  Tilde
    127  (not used)
  ?  128  Euro sign Currency Symbols
  ?  129  (not used)
  ?  130  Single low-9 quotation mark General Punctuation
  ?  131  Latin small letter f with hook Latin Extended-B
  ?  132  Double low-9 quotation mark General Punctuation
  ?  133  Horizontal ellipsis General Punctuation
  ?  134  Dagger General Punctuation
  ?  135  Double dagger General Punctuation
  ?  136  Modifier letter circumflex accent Spacing Modifier Letters
  ?  137  Per mille sign General Punctuation
  ?  138  Latin capital letter S with caron Latin Extended-A
  ?  139  Single left-pointing angle quotation mark General Punctuation
  ?  140  Latin capital ligature OE Latin Extended-A
  ?  141  (not used)
  ?  142  Latin capital letter Z with caron Latin Extended-A
  ?  143  (not used)
  ?  144  (not used)
  ?  145  Left single quotation mark General Punctuation
  ?  146  Right single quotation mark General Punctuation
  ?  147  Left double quotation mark General Punctuation
  ?  148  Right double quotation mark General Punctuation
  ?  149  Bullet General Punctuation
  ?  150  En dash General Punctuation
  ?  151  Em dash General Punctuation
  ?  152  Small tilde Spacing Modifier Letters
  ?  153  Trade mark sign Letterlike Symbols
  ?  154  Latin small letter s with caron Latin Extended-A
  ?  155  Single right-pointing angle quotation mark General Punctuation
  ?  156  Latin small ligature oe Latin Extended-A
  ?  157  (not used)
  ?  158  Latin small letter z with caron Latin Extended-A
  ?  159  Latin capital letter Y with diaeresis Latin Extended-A
     160  No-break space
  ?  161  Inverted exclamation mark
  ?  162  Cent sign
  ?  163  Pound sign
  ?  164  Currency sign
  ?  165  Yen sign
  ?  166  Broken bar
  ?  167  Section sign
  ?  168  Diaeresis
  ?  169  Copyright sign
  ?  170  Feminine ordinal indicator
  ?  171  Left-pointing double angle quotation mark
  ?  172  Not sign
  ?  173  Soft hyphen
  ?  174  Registered sign
  ?  175  Macron
  ?  176  Degree sign
  ?  177  Plus-minus sign
  ?  178  Superscript two
  ?  179  Superscript three
  ?  180  Acute accent
  ?  181  Micro sign
  ?  182  Pilcrow sign
  ?  183  Middle dot
  ?  184  Cedilla
  ?  185  Superscript one
  ?  186  Masculine ordinal indicator
  ?  187  Right-pointing double angle quotation mark
  ?  188  Vulgar fraction one quarter
  ?  189  Vulgar fraction one half
  ?  190  Vulgar fraction three quarters
  ?  191  Inverted question mark
  ?  192  Latin capital letter A with grave
  ?  193  Latin capital letter A with acute
  ?  194  Latin capital letter A with circumflex
  ?  195  Latin capital letter A with tilde
  ?  196  Latin capital letter A with diaeresis
  ?  197  Latin capital letter A with ring above
  ?  198  Latin capital letter AE
  ?  199  Latin capital letter C with cedilla
  ?  200  Latin capital letter E with grave
  ?  201  Latin capital letter E with acute
  ?  202  Latin capital letter E with circumflex
  ?  203  Latin capital letter E with diaeresis
  ?  204  Latin capital letter I with grave
  ?  205  Latin capital letter I with acute
  ?  206  Latin capital letter I with circumflex
  ?  207  Latin capital letter I with diaeresis
  ?  208  Latin capital letter Eth
  ?  209  Latin capital letter N with tilde
  ?  210  Latin capital letter O with grave
  ?  211  Latin capital letter O with acute
  ?  212  Latin capital letter O with circumflex
  ?  213  Latin capital letter O with tilde
  ?  214  Latin capital letter O with diaeresis
  ?  215  Multiplication sign
  ?  216  Latin capital letter O with stroke
  ?  217  Latin capital letter U with grave
  ?  218  Latin capital letter U with acute
  ?  219  Latin capital letter U with circumflex
  ?  220  Latin capital letter U with diaeresis
  ?  221  Latin capital letter Y with acute
  ?  222  Latin capital letter Thorn
  ?  223  Latin small letter sharp s
  ?  224  Latin small letter a with grave
  ?  225  Latin small letter a with acute
  ?  226  Latin small letter a with circumflex
  ?  227  Latin small letter a with tilde
  ?  228  Latin small letter a with diaeresis
  ?  229  Latin small letter a with ring above
  ?  230  Latin small letter ae
  ?  231  Latin small letter c with cedilla
  ?  232  Latin small letter e with grave
  ?  233  Latin small letter e with acute
  ?  234  Latin small letter e with circumflex
  ?  235  Latin small letter e with diaeresis
  ?  236  Latin small letter i with grave
  ?  237  Latin small letter i with acute
  ?  238  Latin small letter i with circumflex
  ?  239  Latin small letter i with diaeresis
  ?  240  Latin small letter eth
  ?  241  Latin small letter n with tilde
  ?  242  Latin small letter o with grave
  ?  243  Latin small letter o with acute
  ?  244  Latin small letter o with circumflex
  ?  245  Latin small letter o with tilde
  ?  246  Latin small letter o with diaeresis
  ?  247  Division sign
  ?  248  Latin small letter o with stroke
  ?  249  Latin small letter u with grave
  ?  250  Latin small letter u with acute
  ?  251  Latin small letter  with circumflex
  ?  252  Latin small letter u with diaeresis
  ?  253  Latin small letter y with acute
  ?  254  Latin small letter thorn
  ?  255  Latin small letter y with diaeresis

Notice that the digits come before the upper case letters which come before the lower case letters.
 
Assigning to and from character variables
Here are some examples of characters, along with assignments to and from them:
 
 var
   lower, upper, copied, fromNum : AnsiChar;
 begin
   lower   := 'a';      // Assign a lower case letter
   upper   := 'Q';      // Assign an upper case letter
   copied  := lower;    // Assign from another character variable
   fromNum := Chr(65);  // Assign using a function
 end;

 These character variables are now set to these values:
 
 lower   : 'a'
 upper   : 'Q'
 copied  : 'a'
 fromNum : 'A'

Notice the use of a run time library function Chr to convert a number to a character. We can use the Ord function to convert a character into a number:
 
 var
   myNum  : Byte;
 begin
   myNum := Ord('A');   // myNum is set to 65
 end;

What are WideChar types?
The ansi character set derived from the earlier ascii character set. Both were designed around European characters, which comfortably fitted into 256 values, the capacity of a single byte. For a long time, this was the easy way to handle text. But this left many countries, especially in Asia, out of the picture.
 
The WideChar type can support double-byte characters, which can hold numeric representations of the vast alphabets of China, Japan and so on. These are called International characters. International applications must use WideChar and WideString types.
 

Strings
A single character is useful when parsing text, one character at a time. However, to handle words and sentences and screen labels and so on, strings are used. A string is literally a string of characters. It can be a string of Char, AnsiChar or WideChar characters.
 
Assigning to and from a string
A ShortString is a fixed 255 characters long. A String (by default) is the same as an AnsiString, and is of any length you want. WideStrings can also be of any length. Their storage is dynamically handled. In fact, if you copy one string to another, the second will just point to the contents of the first.
 
Here are some assignments:
 
 var
   source, target, last : String;
 begin
   source := 'Hello World';       // Assign from a string literal
   target := source;              // Assign from another variable
   last   := 'Don''t do that';    // Quotes in a string must be doubled
 end;

 source is now set to : Hello World
 target is now set to : Hello World
 last   is now set to : Don't do that

String operators
There are a number of primitive string operators that are commonly used:
 
 +  Concatenates two strings together
 =  Compares for string equality
 <  Is one string lower in sequence than another
 <= Is one string lower or equal in sequence with another
 >  Is one string greater in sequence than another
 >= Is one string greater or equal in sequence with another
 <> Compares for string inequality

Here are some examples using these operators:
 
 var
   myString : string;
 begin
   myString := 'Hello ' + 'World';   // String concatenation
 
   if 'ABC' = 'abc'                  // Equality
   then ShowMessage('ABC = abc');
   if 'ABC' = 'ABC'                  // Equality
   then ShowMessage('ABC = ABC');
   if 'ABC' < 'abc'                  // Less than
   then ShowMessage('ABC < abc');
   if 'ABC' <= 'abc'                 // Less than or equal
   then ShowMessage('ABC <= abc');
   if 'ABC' > 'abc'                  // Greater than
   then ShowMessage('ABC > abc');
   if 'ABC' >= 'abc'                 // Greater than or equal
   then ShowMessage('ABC >= abc');
   if 'ABC' <> 'abc'                 // Inequality
   then ShowMessage('ABC <> abc');
 end;

 ABC = ABC
 ABC < abc
 ABC <= abc
 ABC <> abc

String processing routines
There are a number of string manipulation routines that are given by example below. Click on any of them to learn more (and also click on WrapText for another, more involved routine).
 
 var
   Source, Target : string;
 
 begin
   Source := '12345678';
   Target := Copy(Source, 3, 4);    // Target now = '3456'
 
   Target := '12345678';
   Insert('-+-', Target, 3);        // Target now = '12-+-345678'
 
   Target := '12345678';
   Delete(Target, 3, 4);            // Target now = '1278'
 
   Target := StringOfChar('S', 5);  // Target now = 'SSSSS'
 
   Source := 'This is a way to live A big life';
 
   // Target set to 'This is THE way to live THE big life'
   Target := StringReplace(before, ' a ', ' THE ',
                           [rfReplaceAll, rfIgnoreCase]);
 end;

Click on the following to learn more:
 
 AnsiLeftStr        Returns leftmost characters of a string
 AnsiMidStr         Returns middle characters of a string
 AnsiRightStr       Returns rightmost characters of a string
 AnsiStartsStr      Does a string start with a substring?
 AnsiContainsStr    Does a string contain another?
 AnsiEndsStr        Does a string end with a substring?
 AnsiIndexStr       Check substring list against a string
 AnsiMatchStr       Check substring list against a string
 AnsiReverseString  Reverses characters in a string
 AnsiReplacStr      Replaces all substring occurences
 DupeString         Repeats a substring n times
 StrScan            Scans a string for a specific character
 StuffString        Replaces part of a string text
 Trim               Removes leading and trailing white space
 TrimLeft           Removes leading white space
 TrimRight          Removes trailing white space

Converting from numbers to strings
 CurrToStrF        Convert a currency value to a string with formatting
 DateTimeToStr     Converts TDateTime date and time values to a string
 DateTimeToString  Rich formatting of a TDateTime variable into a string
 DateToStr         Converts a TDateTime date value to a string
 FloatToStr        Convert a floating point value to a string
 FloatToStrF       Convert a floating point value to a string with formatting
 Format            Rich formatting of numbers and text into a string
 FormatCurr        Rich formatting of a currency value into a string
 FormatDateTime    Rich formatting of a TDateTime variable into a string
 FormatFloat       Rich formatting of a floating point number into a string
 IntToHex          Convert an Integer into a hexadecimal string
 IntToStr          Convert an integer into a string
 Str               Converts an integer or floating point number to a string

Converting from strings to numbers
 StringToWideChar  Converts a string into a WideChar 0 terminated buffer
 StrToCurr         Convert a number string into a currency value
 StrToDate         Converts a date string into a TDateTime value
 StrToDateTime     Converts a date+time string into a TDateTime value
 StrToFloat        Convert a number string into a floating point value
 StrToInt          Convert an integer string into an Integer value
 StrToInt64        Convert an integer string into an Int64 value
 StrToInt64Def     Convert a string into an Int64 value with default
 StrToIntDef       Convert a string into an Integer value with default
 StrToTime         Converts a time string into a TDateTime value
 Val               Converts number strings to integer and floating point values

 

출처 : http://www.delphibasics.co.uk/Article.asp?Name=Text

Posted by 다크쌍피