Merge branch 'master' of github:jsmaniac/2011-m1s2-ter

This commit is contained in:
Georges Dupéron 2011-01-20 16:12:04 +01:00
commit ff8d01fa71
6 changed files with 39 additions and 11 deletions

View File

@ -14,14 +14,27 @@
<Button android:layout_height="wrap_content" android:id="@+id/games"
android:text="@string/games_name" android:layout_width="wrap_content"
android:paddingLeft="60px" android:paddingRight="60px"
android:enabled="false"></Button>
android:enabled="false" />
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content" android:id="@+id/prefs"
android:text="@string/prefs_name" android:layout_below="@+id/games"
android:layout_alignLeft="@+id/games" android:layout_alignRight="@+id/games"></Button>
android:layout_alignLeft="@+id/games" android:layout_alignRight="@+id/games" />
</RelativeLayout>
<LinearLayout android:id="@+id/LinearLayout01"
android:layout_height="wrap_content" android:layout_weight="1"
android:layout_width="fill_parent" android:orientation="vertical">
<TextView android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:textStyle="bold"
android:gravity="center_horizontal" android:text="@+id/login" android:id="@+id/login"></TextView>
<ImageView android:layout_height="wrap_content" android:id="@+id/info"
android:layout_width="wrap_content" android:src="@android:drawable/ic_dialog_info" android:layout_gravity="right" android:layout_weight="5"></ImageView>
</LinearLayout>
</RelativeLayout>
<ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/info" android:layout_weight="1" android:src="@android:drawable/ic_dialog_info" android:layout_gravity="right"></ImageView>
</LinearLayout>

View File

@ -3,5 +3,5 @@
<string name="app_name">PtiClic</string>
<string name="prefs_name">Préférences</string>
<string name="games_name">Jeux</string>
<string name="games_name">Jouer</string>
</resources>

View File

@ -3,8 +3,14 @@
<PreferenceCategory android:title="Connexion">
<EditTextPreference android:title="Login" android:key="login"></EditTextPreference>
<EditTextPreference android:title="Mot de Passe" android:key="passwd"></EditTextPreference>
<EditTextPreference android:title="Login" android:key="login" android:summary=""/>
<EditTextPreference android:title="Mot de Passe" android:key="passwd"/>
</PreferenceCategory>
<PreferenceCategory android:title="Debug">
<EditTextPreference android:title="Serveur" android:key="server"/>
</PreferenceCategory>
</PreferenceScreen>

View File

@ -2,19 +2,27 @@ package org.pticlic;
import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
public class Main extends Activity implements OnClickListener {
/** Called when the activity is first created. */
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
((Button)findViewById(R.id.prefs)).setOnClickListener(this);
// On récupère le nom du joueur des préférences.
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);
String loginPref = sp.getString("login", "joueur");
((TextView)findViewById(R.id.login)).setText("Login : " + loginPref);
}
@Override

View File

@ -13,5 +13,5 @@ public class Preference extends PreferenceActivity {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.prefs);
}
}

View File

@ -1,4 +1,5 @@
%% Bertrand : Source code optimization and profiling of energy consumption in embedded systems
%% Bertrand : Source code optimization and profiling of energy consumption in embedded systems
%% URL : http://si2.epfl.ch/~demichel/publications/archive/2000/ISSSconf00pg193.pdf
@inproceedings{citeulike:5700744,
abstract = {{This paper presents a source code optimization methodology and a profiling tool that have been developed to help designers in optimizing software performance and energy in embedded systems. Code optimizations are applied at three levels of abstraction: algorithmic, data and instruction-level. The profiler exploits a cycle-accurate energy consumption simulator [3] to relate the embedded system energy consumption and performance to the source code. Thus, it can be used for analysis (i.e., to find energy-critical sections of the code), and for validation (i.e., to assess the impact of each code optimization).Code optimizations and profiling tool are used to optimize and tune the implementation of an MPEG Layer III (MP3) audio decoder for the SmartBadge [2] portable embedded system. We show that using our methodology and tool we can quickly and easily redesign the MP3 audio decoder software to run in real time with low energy consumption. Performance increase of 92\% and energy consumption decrease of 77\% (over the original executable specification) has been achieved for MP3 audio decoding on the SmartBadge.}},
address = {Washington, DC, USA},