기본 콘텐츠로 건너뛰기

3월, 2014의 게시물 표시

[android] html에서 전화걸기

assets폴더아래 call.html파일 [call.html] <a href='tel:012-345-6789'>Tel : 012-345-6789</a> [call.java] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 @Override      protected   void  onCreate(Bundle savedInstanceState) {          super .onCreate(savedInstanceState);         mWebView = (WebView) findViewById(R.id.callWebView);         mWebView.setWebViewClient( new  InternalWebViewClient());         mWebView.loadUrl( "file:///android_asset/call.html" );     }      private   class  InternalWebViewClient  extends  WebViewClient {         @Override      ...

[android] url scheme 사용하기 (웹에서 앱 호출 및 앱에서 앱 호출)

[호출될 앱] 다른 앱이나 웹에서 호출될 앱의 AndroidManifest.xml 파일을 열어 원하는 activity에 아래와 같이 빨간 부분을 추가 한다. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 <activity             android:name= ".testUrlScheme"             android:label= "@string/app_name" >             <intent-filter>                 <action android:name= "android.intent.action.MAIN"  />                 <category android:name= "android.intent.category.LAUNCHER"  />             </intent-filter>             ...

[android] 전역변수 Applicationclass 사용하기

ApplicationClass는 어디서든 접근할 수 있고 공동으로 사용할 수 있습니다. 따라서 컴포넌트 사이에서 context를 이용하여 사용합니다. [ApplicationClass.java] 1 2 3 4 5 6 7 8 9 public   class  ApplicationClass  extends  Application{      private   boolean  m_test;      public   boolean  getState(){          return  m_test;     }      public   void  setState( boolean  test){          m_test  = test;     } } [사용하고 싶은 곳] private ApplicationClass applicationclass; applicationclass = (ApplicationClass)context.getApplicationContext(); applicationclass. getState();