Nisan, 2012 tarihine ait yayınlar gösteriliyor

Change Heap Size of JVM

The aim is to change heap size of JVM. Under the  /usr/share/tomcat6/bin , there is a file name as catalina.sh. In the file you can write CATALINA_OPTS="-Xms256m -Xmx256m" at the 2nd line and then restart the tomcat. To do that, (I supposed that you have a root right. If not , type sudo -s ) First of all, go to the tomcat6 bin directory and stop it.  ex. /etc/init.d/tomcat6 stop Then, change the right of the catalina.sh file as root. Here is;  chown  gunay /usr/share/tomcat6/bin/catalina.sh Important: I have used in ubuntu machine and tomcat6 is ubuntu's tomcat not a standalone version. At the end, you can change file rights as tomcat6 and then start the server. /etc/init.d/tomcat6 start

Keyboard Popup when activity is started.

 Error: Pop-up keyboard and textedit selected when the activity is started. The first solution is ;   This is hide keyboard and also nothing is not selected or focused.   Use this attributes in your layout tag in XML file: android : focusable = "true" android : focusableInTouchMode = "true"   The second solution is ; Put a ndroid:windowSoftInputMode="stateHidden" in activity in the AndroidManifest.xml   This is only hide keyboard but the textedit is selected or focused.   <activity android:name="com.test.login" android:windowSoftInputMode="stateHidden" android:screenOrientation="portrait" />    

How do I make a dotted/dashed line in Android?

Without java code: android:dashGap means here is the distance between line dashes. drawable/dotted.xml: <shape xmlns:android = "http://schemas.android.com/apk/res/android" android:shape = "line" > <stroke     android:color = "#C7B299"     android:dashWidth = "10px"     android:dashGap = "10px" />   </shape> view.xml:   <ImageView     android:layout_width = "match_parent"     android:layout_height = "wrap_content"     android:src = "@drawable/dotted" />

List Item Layout Design/Style in Spinner

List Item Layout Design/Style in Spinner <CheckedTextView     xmlns:android="http://schemas.android.com/apk/res/android"     android:text="CheckedTextView"     android:id="@+id/checkedTextView1"     style="?android:attr/spinnerDropDownItemStyle"     android:background="@drawable/gradient_background_clickable"     android:textColor="@drawable/text_color_changeable"     android:layout_width="fill_parent"     android:layout_height="?android:attr/listPreferredItemHeight"> </CheckedTextView> gradient background <selector xmlns:android="http://schemas.android.com/apk/res/android">     <item android:drawable="@drawable/gradient_background" android:state_pressed="true" />     <item android:drawable="@drawable/gradient_background_reverse_color" /> </selector> gradient background xml <?xml version="1.0" enco

Sample ListView example

 //Sample  ListView  example         ListView fontListView = (ListView) findViewById(R.id.fontlistView);         ArrayList<String> fontListData = Font.getFontStyles();         ArrayAdapter<String> fontListAdapter = new ArrayAdapter<String>(this, R.layout.listview_style_layout, fontListData);         fontListView.setAdapter(fontListAdapter); In the xml  <TableLayout android:id="@+id/listViewTableLayout" android:layout_width="wrap_content" android:layout_height="wrap_content">                            <TableRow  android:paddingBottom="5dip">                <ListView android:id="@+id/fontlistView"                      android:scrollbars="vertical"                     android:choiceMode="singleChoice"                     android:layout_height="wrap_content"                     android:layout_width="200dip"                     android:layout_gravity=&qu

Using Themes on Android Mobile Application

you can apply styles as themes on an activity level or application level. if you apply a theme on an activity level then all widgets within that activity will inherit from that theme. to do so, open the AndroidManifest.xml and go the <activity> tag and add the android:theme attribute:   <activity android:name=".StylesDemo" android:label="@string/app_name" android:theme="@style/BlueLabel">   to apply a theme on the application level so that the style will be applied to all activities within your application, open the AndroidManifest.xml and go the <application> tag and add the android:theme attribute:   <application android:icon="@drawable/icon" android:label="@string/app_name" android:theme="@style/BlueLabel"> to set the theme of an activity programmatically call this line in the onCreate method   this.setTheme(R.style.BlueLabel);

Using Custom Fonts in Android Mobile Application

Place the TTF file in the ./assets directory (create it if it doesn’t exist yet). We’re going to use a basic layout file with a TextView, marked with an id of “custom_font” so we can access it in our code.   <? xml   version = "1.0"   encoding = "utf-8" ?>    < LinearLayout   xmlns:android = "http://schemas.android.com/apk/res/android"                   android:orientation = "vertical"                   android:layout_width = "fill_parent"                   android:layout_height = "fill_parent"             >            < TextView                 android:id = "@+id/custom_font"                 android:layout_width = "fill_parent"                 android:layout_height = "wrap_content"                 android:text = "This is the Chantelli Antiqua font."                 />       </ LinearLayout >      Open your main activity file and insert this into t

How To Design For Multiple Screen Sizes

Creating Three Sets of Graphics Because of the aforementioned screen resolution/size issue, Android recommends creating three sets of graphics for: Hi Density Screens Medium Density Screens Low Density Screens This will keep your design from getting crunked up when it’s displayed on various screen sizes. The grid below shows the various screen sizes and resolutions you use for your Photoshop files: I know it’s a lot. But if you’re creating your design using vector shape layers, the re-sizing process shouldn’t be too painful. The key is to design for the smallest screen first, and then size up for larger screens.