2015年5月23日 星期六

如何修改App Store中App Preview所顯示的語言

 




最近發現很多遊戲在App Store上架時,
不論本身的內容或介面是否本地化與否,
在App Preview頁面中所顯示的"語言"都會標示為英文居多;

剛巧有朋友在問這個問題,
所以打在Blog中記錄一下。

其實這個參數的顯示,
是取決於ipa的內容,
開發者是不能在iTunesConnect網站上修改的,
即是說要修改這部份就一定要提交新的ipa才可以;

而做法很簡單,
只要加入一個文件夾即可,
文件夾內容如下:




繁體中文:zh-Hant.lproj
簡體中文:zh-Hans.lproj

只要把想要的"語言"文件夾加到.app之中,
再生成ipa並提交到Apple,
上架時App Preview頁面中所顯示的"語言"就會顯示為你想要的語言了
(P.S. Mac App做法也是一樣)


2012年3月11日 星期日

在Layout XML中的ListView Preview它的List Item效果

<ListView>
<!-- Preview: listitem=@layout/listitem_layout -->
</ListView>

Add activity's view to Layout

// add activity to Layout
FrameLayout container = (FrameLayout) findViewById(R.id.layout);
container.addView(
getLocalActivityManager().startActivity("ViewActivity", new Intent(RootActivity.this , NextActivity.class))
.getDecorView());

2012年3月9日 星期五

Change device orientation, video view not reload

// change device orientation, video view not reload
// "AndroidManifest.xml" file
<activity android:name=".MoviePlayerActivity"
              android:configChanges="orientation" >

2012年2月22日 星期三

Java trim non-number character

// java trim non-number character
System.out.println("@*1#^2$@!34#5ajs67>?<{8_(9SKJDH".replaceAll("\\D", ""));

// output : 123456789

2012年2月17日 星期五

change current resources locale

// change current resources locale
Configuration config = new Configuration();
config.locale = new Locale("zh", "TW");
getBaseContext().getResources().updateConfiguration(config, getBaseContext().getResources().getDisplayMetrics());

2012年2月16日 星期四

Get specified service is running

// get specified service is running
ActivityManager myManager=(ActivityManager)this.getSystemService(Context.ACTIVITY_SERVICE);
ArrayList runningService = (ArrayList) myManager.getRunningServices(30);
    for(int i = 0 ; i < runningservice.size();i++) {
    
    if(runningService.get(i). service .getClassName().toString().equals("com.xxx.RuningService")) {
            return true;
        }
    }
return false;

2012年2月14日 星期二

Data transport between 2 activity

// data transport between 2 activity
public class RootClassActivity extends Activity {
    public void goToNextPagePress(View view){
        Intent intent = new Intent();
        intent.setClass(RootClassActivity.this, NodeClassActivity.class);
        startActivityForResult(intent, 0);
    }

    @Override
    protected void onActivityResult (int requestCode, int resultCode, Intent data) {
        // requestCode = 0
        // resultCode = 1
    }
}

public class NodeClassActivity extends Activity {

    public void backBtnPress(View view) {
        // return data to persent activity
        this.setResult(1, this.getIntent());
        this.finish();
    }
}

handle button event in list view

// handle button event in list view
<button android:focusable="false" />

2012年2月10日 星期五

Dynamic create view from layout xml

// dynamic create view from layout xml
LayoutInflater inflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View view = inflater.inflate(R.layout.main_layout, null);

2012年2月8日 星期三

Open Android browser

// open web browser
Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
this.startActivity(i);

2012年2月5日 星期日

Androids SDK handle large size Bitmap

BitmapFactory.Options op = new BitmapFactory.Options();
// set sample size will scale the image.size/2 op.inSampleSize = 2;

Bitmap bm = BitmapFactory.decodeResource(PaintBushActivity.this.getResources(), R.drawable.img_0218, op);
ImageView displayImg = (ImageView)PaintBushActivity.this.findViewById(R.id.imageView1);
displayImg.setBackgroundDrawable(bd);

2012年2月3日 星期五

Fast get Location in start GPS first time

public class NearByListActivity extends Activity implements LocationListener {
     @Override
     public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.mainLayout);

          // fast get gps location
          locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, this);
          onLocationChanged(locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER));
}

     @Override
     public void onLocationChanged(Location location) {
          // .....
     }
}

2012年1月31日 星期二

Change Activity Orientation

// Activity support screen orientation
"unspecified"  The default value. The system chooses the orientation. The policy it uses, and therefore the choices made in specific contexts, may differ from device to device.
"user"  The user's current preferred orientation.
"behind"  The same orientation as the activity that's immediately beneath it in the activity stack.
"landscape"  Landscape orientation (the display is wider than it is tall).
"portrait"  Portrait orientation (the display is taller than it is wide).
"reverseLandscape"  Landscape orientation in the opposite direction from normal landscape. Added in API level 9.
"reversePortrait"  Portrait orientation in the opposite direction from normal portrait. Added in API level 9.
"sensorLandscape"  Landscape orientation, but can be either normal or reverse landscape based on the device sensor. Added in API level 9.
"sensorPortrait"  Portrait orientation, but can be either normal or reverse portrait based on the device sensor. Added in API level 9.
"sensor"  The orientation is determined by the device orientation sensor. The orientation of the display depends on how the user is holding the device; it changes when the user rotates the device. Some devices, though, will not rotate to all four possible orientations, by default. To allow all four orientations, use "fullSensor".
"fullSensor"  The orientation is determined by the device orientation sensor for any of the 4 orientations. This is similar to "sensor" except this allows any of the 4 possible screen orientations, regardless of what the device will normally do (for example, some devices won't normally use reverse portrait or reverse landscape, but this enables those). Added in API level 9.
"nosensor"  The orientation is determined without reference to a physical orientation sensor. The sensor is ignored, so the display will not rotate based on how the user moves the device. Except for this distinction, the system chooses the orientation using the same policy as for the "unspecified" setting.

// AndroidManifest.xml
<activity android:name="OrientationActivity"
                   android:screenOrientation="portrait" >
</activity>

Android simple play video

// layout.xml
<VideoView android:id="@+id/videoView"
                          android:layout_width="match_parent"
                          android:layout_height="match_parent"
                          android:layout_centerVertical="true" />

// Simple movie player
VideoView videoView = (VideoView) findViewById(R.id.videoView);
MediaController mediaController = new MediaController(this);
mediaController.setAnchorView(videoView);
videoView.setMediaController(mediaController);
videoView.setVideoURI(Uri.parse("url"));
videoView.start();

Set App full screen

// Set App full screen
import android.view.WindowManager;

getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

Android change app title bar

// Edit app title bar
/*
// 1.DEFAULT_FEATURES:系統預設狀態,一般不需要指定
// 2.FEATURE_CONTEXT_MENU:啟用的ContextMenu,預設該項已啟用,一般無需指定
// 3.FEATURE_CUSTOM_TITLE:自定義標題。當需要自定義標題時必須指定。如:標題是一個按鈕時
// 4.FEATURE_INDETERMINATE_PROGRESS:不確定的進度
// 5.FEATURE_LEFT_ICON:標題欄左側的圖標
// 6.FEATURE_NO_TITLE:吳標題
// 7.FEATURE_OPTIONS_PANEL:啟用“選項面板”功能,預設已啟用。
// 8.FEATURE_PROGRESS:進度指示器功能
// 9.FEATURE_RIGHT_ICON:標題欄右側的圖標
*/
this.requestWindowFeature(Window.FEATURE_NO_TITLE);

Make phone call

// AndroidManifest.xml
<uses-permission android:name="android.permission.CALL_PHONE" />

// Call phone
startActivityForResult(new Intent(Intent.ACTION_CALL, Uri.parse("tel:+0000000000000")), 1);

Simple Message Dialog

// Show Dialog
AlertDialog.Builder builder = new AlertDialog.Builder(RootActivity.this);
builder.setMessage(url)
.setCancelable(false)
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
      public void onClick(DialogInterface dialog, int id) {
            RootActivity.this.finish();
      }
})
.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
      public void onClick(DialogInterface dialog, int id) {
            dialog.cancel();
      }
});
AlertDialog alert = builder.create();
alert.show();

2012年1月30日 星期一