Android/App개발2011. 9. 3. 18:33


Locale을 생성 후 updateConfigurations로 변경한다.
 

Locale locale = new Locale("ko"); 

Locale.setDefault(locale);

Configuration config = new Configuration();

config.locale = locale;

getBaseContext().getResources().updateConfiguration(config, getBaseContext().getResources().getDisplayMetrics());


변경 후 액티비티를 다시 시작하여야 변경된 로켈이 적용된다.
 
finish();

Intent myIntent = new Intent(MainActivity.this, MainActivity.class);

startActivity(myIntent);


이렇게 하면 해당 액티비티에만 적용된다.
액티비티를 시작할 때 이전에 선택한 로켈로 시작되게 하려면 onCreate에서 지정해야 한다.

onCreate(..) {
         Locale locale2 = new Locale("en"); 

    Locale.setDefault(locale2);

        Configuration config2 = new Configuration();

        config2.locale = locale2;

        getBaseContext().getResources().updateConfiguration(config2, getBaseContext().getResources().getDisplayMetrics());


        setContentView(R.layout.main);

}

setContentView(.)보다 이전에 설정해주어야 한다.

만일 이렇게만 하면 런타임에 로켈을 바꾸면 화면이 점점 더 작아지는 황당한 상황을 겪을 것이다.
Manifest에 다음을 추가해라.

<supports-screens

android:smallScreens="true"

android:normalScreens="true"

android:largeScreens="true"

android:anyDensity="true"

/>




 
Posted by 삼스
Linux2011. 8. 3. 19:28

http://wiki.kldp.org/HOWTO/html/Adv-Bash-Scr-HOWTO/moreadv.html

Posted by 삼스
iOS2011. 7. 21. 10:20

http://www.luuvish.org/208

VLC는 한번에 제대로 컴파일된 적이 없네요. iOS 버전은 최근에 작업중인지 그나마 덜 고생하고 컴파일 성공했습니다. 프로젝트들이 얽혀있어 분석이 쉽진 않겠네요.

$ tar jxvf VLC-1.1.0-iOS.tar.bz2
$ ln -s VLC-1.1.0-iOS vlc
$ cd vlc/extras/package/ios
  • build_for_iOS.sh 을 열어서 SDK 버전을 수정합니다. 현재 최신버전은 4.2.sdk입니다. IOS_SDK_ROOT="${DEVROOT}/SDKs/iPhone${PLATFORM}3.2.sdk"
  • build_for_iOS.sh 를 실행해서 컴파일해 보면 중간에 에러가 나면서 멈춥니다. patch file의 버전문제인데 ../../contrib/src-arm-apple-darwin10-ios/src/Patches/live-inet_ntop.patch의 161-185 라인을 참고해서 ../../contrib/src-arm-apple-darwin10-ios/src/live/liveMedia/RTSPServer.cpp을 직접 수정하면 됩니다. our_inet_ntoa()의 두번째 인자로 buf를 추가하기만 하면됩니다.
  • 이제 build_for_iOS.sh를 실행해서 컴파일합니다. 완료되면 vlc/install-ios-OS에 해더와 라이브러리가 생성됩니다.
  • MobileVLCKit의 static plugins를 build합니다.
$ cd vlc/projects/macosx/framework
$ xcodebuild -project MobileVLCKit.xcodeproj -target "Aggregate static plugins" -configuration "Release"
  • MobileVLCKit의 MobileVLCKit의 SDK 버전을 최신버전으로 수정하고 build합니다.
$ open MobileVLCKit.xcodeproj
fix Targets/MobileVLCKit - Get Info / Build
Configuration : All Configurations
Architectures / Base SDK : Latest iOS
$ xcodebuild -project MobileVLCKit.xcodeproj -target "MobileVLCKit" -configuration "Release"



MediaLibraryKit compile하기
  • 작업디렉토리(VLC-1.1.0-iOS와 같은 위치)에 MediaLibraryKit 디렉토리를 만들고 압축을 풉니다.
$ mkdir MediaLibraryKit && cd MediaLibraryKit
$ unzip MediaLibraryKit-1.1.0.zip
  • External 디렉토리로 들어가 MobileVLCKit의 링크를 만듭니다.
$ ln -s ../../vlc/projects/macosx/framework/build/Release-iphoneos MobileVLCKit
  • MediaLibraryKit의 SDK 버전을 최신버전으로 수정하고 build합니다.
$ open MobileMediaLibraryKit.xcodeproj
fix Targets/MobileMediaLibraryKit - Get Info / Build
Configuration : All Configurations
Architectures / Base SDK : Latest iOS
$ xcodebuild -project MobileMediaLibraryKit.xcodeproj -configuration "Release"



MobileVLC compile하기
  • 작업디렉토리(VLC-1.1.0-iOS와 같은 위치)에서 MobileVLC의 압축을 풉니다.
$ tar zxvf MobileVLC-1.1.0.tar.gz
$ cd MobileVLC
  • External 밑에 있는 MediaLibraryKit와 MobileVLCKit의 링크가 제대로 되어있는지 확인합니다.
  • MobileVLC의 SDK 버전을 최신버전으로 수정하고 build합니다.
$ open MobileVLC.xcodeproj
fix Targets/MobileVLC - Get Info / Build
Configuration : All Configurations
Architectures / Architectures : Standard (armv6 armv7)
Architectures / Base SDK : Latest iOS
build with Device-Release configurations

Posted by 삼스