jQuery defaultchecked VS checked Situation: I have checkbox elements on div(‘#dialog-a’) for a dialog. When an user clicks a button, then jQuery will bring the dialog with html code of div(‘#dialog-a’). Once, the user set checkbox and click “Close” button in the dialog, “Close” function supposes to set checkbox as “checked” in div(‘#dialog-a’). I use…
Author: Chris Lee
Dynamic tab in android with dynamic tab content
Column not found: 1054 Unknown column ’link.area’ in ’where clause’
Original Article: http://www.magentocommerce.com/boards/viewthread/216269/#t293801 Solution Source http://www.soluvas.com/installing-sample-data-on-magento-1-4-0-1/ You shouldn’t just copy the media/catalog folder before, but do the steps in this tutorial in order: 1.Create database 2.Load sample DB into database 3.Extract Magento 4.Run installation 5.Ensure you get to the configure database page. Magento will complain about un-writeable directories. chmod or chown these folders (app/etc, var, and…
Magento Commerce: Fixing “Exception printing is disabled by default for security reasons”
Original Article: http://screencastworld.com/2010/04/articles/magento-commerce-exception-printing-is-disabled-by-default-for-security-reasons Whenever Magento 1.4.0.1 encounters an error condition you’re likely to see the message There has been an error processing your request Exception printing is disabled by default for security reasons Error log record number: XXXXXXXXXXXXXXX Unlike previous versions of Magento where it used to dump out the error report for the world to…
Pattern for XSS Vulnerability
Pattern : “><script>alert(document.cookie)</script> Example: http://localhost/test.php?q=%22%3E%3Cscript%3Ealert(document.cookie)%3C/script%3E
CSS floats: container does not stretch to fit floated contents
Original Article: http://www.mikepadgett.com/technology/technical/alternative-to-the-pie-clearfix-hack/ Here’s a quick resolution to an almost ungooglable problem.” This article was formerly titled “Alternative to the PIE clearfix hack” but has since been rewritten. Getting this problem? Example: Left Left Left Left Right Right Right Right <div style=”background: red; padding: 2%; border: 1px solid #000;”> <div style=”border: 1px solid #000000; background: #e2e2e2;…
Google Analytics에서 jQuery AJAX 호출들을 추적가능하도록 만들기
원본 글: http://www.alfajango.com/blog/track-jquery-ajax-requests-in-google-analytics/ The code This code will automatically log all jQuery AJAX requests in our application, including those using $.ajax(), $.get(), or $.post(). This will also work for any jQuery plugins using AJAX requests (e.g. lightbox plugins, etc.), as well as for all Rails 3 remote links and forms(provided we’re using the jQuery UJS driver). In the page layout…
Android How to check network status(Both Wifi and Mobile 3G)
Original Article: http://www.androidpeople.com/android-how-to-check-network-statusboth-wifi-and-mobile-3g/ import android.net.ConnectivityManager; import android.os.Bundle; import android.widget.Toast; public class pingtest extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); chkStatus(); } void chkStatus() { final ConnectivityManager connMgr = (ConnectivityManager) this.getSystemService(Context.CONNECTIVITY_SERVICE); final android.net.NetworkInfo wifi = connMgr.getNetworkInfo(ConnectivityManager.TYPE_WIFI); final android.net.NetworkInfo mobile = connMgr.getNetworkInfo(ConnectivityManager.TYPE_MOBILE); if( wifi.isAvailable() ){…
Different list items’ layouts
Original Article: http://android.amberfog.com/?p=296 public class MultipleItemsList extends ListActivity { private MyCustomAdapter mAdapter; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mAdapter = new MyCustomAdapter(); for (int i = 1; i < 50; i++) { mAdapter.addItem(“item ” + i); if (i % 4 == 0) { mAdapter.addSeparatorItem(“separator ” + i); } } setListAdapter(mAdapter); } private class…
Separating Lists with Headers in Android 0.9
Original Article: http://jsharkey.org/blog/2008/08/18/separating-lists-with-headers-in-android-09/ <!– list_header.xml –> <TextView xmlns:android=”http://schemas.android.com/apk/res/android” android:id=”@+id/list_header_title” android:layout_width=”fill_parent” android:layout_height=”wrap_content” android:paddingTop=”2dip” android:paddingBottom=”2dip” android:paddingLeft=”5dip” style=”?android:attr/listSeparatorTextViewStyle” /> <!– list_item.xml –> <TextView xmlns:android=”http://schemas.android.com/apk/res/android” android:id=”@+id/list_item_title” android:layout_width=”fill_parent” android:layout_height=”fill_parent” android:paddingTop=”10dip” android:paddingBottom=”10dip” android:paddingLeft=”15dip” android:textAppearance=”?android:attr/textAppearanceLarge” /> <!– list_complex.xml –> <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:layout_width=”fill_parent” android:layout_height=”wrap_content” android:orientation=”vertical” android:paddingTop=”10dip” android:paddingBottom=”10dip” android:paddingLeft=”15dip” > <TextView android:id=”@+id/list_complex_title” android:layout_width=”fill_parent” android:layout_height=”wrap_content” android:textAppearance=”?android:attr/textAppearanceLarge” /> <TextView android:id=”@+id/list_complex_caption” android:layout_width=”fill_parent” android:layout_height=”wrap_content” android:textAppearance=”?android:attr/textAppearanceSmall” /> </LinearLayout>…
Android Series: GET, POST and Multipart POST requests
Original Article: http://www.softwarepassion.com/android-series-get-post-and-multipart-post-requests/ try { HttpClient client = new DefaultHttpClient(); String getURL = “http://www.google.com”; HttpGet get = new HttpGet(getURL); HttpResponse responseGet = client.execute(get); HttpEntity resEntityGet = responseGet.getEntity(); if (resEntityGet != null) { //do something with the response Log.i(“GET RESPONSE”,EntityUtils.toString(resEntityGet)); } } catch (Exception e) { e.printStackTrace(); } ============ try { HttpClient client =…
Android: How to make current layout with scrollable text view?
Original Article: http://stackoverflow.com/questions/2621776/android-how-to-make-current-layout-with-scrollable-text-view ——————– |btn1| txt1 |btn2| ——————– | | | | | | | txtview1 | | | |…
‘Localhost’ in the android emulator
Original Article: http://www.droidnova.com/ever-tried-localhost-with-the-android-emulator,102.html Local Apache/Tomcat/whatever: 10.0.2.2
Android Application and AsyncTask basics
Original Article: http://www.screaming-penguin.com/node/7746 public class Main extends Activity { private static final String NAME = “NAME”; private EditText input; private Button saveButton; private Button deleteButton; private TextView output; private MyApplication application; @Override public void onCreate(final Bundle savedInstanceState) { Log.d(MyApplication.APP_NAME, “onCreate”); super.onCreate(savedInstanceSt<wbr>ate); this.setContentView(R.layout.m<wbr>ain); // get “Application” object for shared state or creating of expensive resources -…
Talking To Web Servers Via HTTP In Android 1.0
Original Article: http://brainflush.wordpress.com/2008/10/17/talking-to-web-servers-via-http-in-android-10/ HttpClient httpClient = new DefaultHttpClient(); StringBuilder uriBuilder = new StringBuilder(SERVICE_ENDPOINT); uriBuilder.append(“?param0=” + param0); uriBuilder.append(“¶m1=” + param1); uriBuilder.append(“¶mN=” + paramN); HttpGet request = new HttpGet(uriBuilder.toString()); HttpResponse response = httpClient.execute(request); int status = response.getStatusLine().getStatusCode(); // we assume that the response body contains the error message if (status != HttpStatus.SC_OK) { ByteArrayOutputStream ostream = new…
Https returns 404 with DefaultHttpClient on Android?
Reference: http://stackoverflow.com/questions/3730760/https-returns-404-with-defaulthttpclient-on-android I have an http request that worked as http://blah.com and now I have been asked to usehttps://blah.com The former works and the later fails with a Network I/O error. Are there any missing parameter settings that I need for the client? Answer Https almost always implies a different port being used (standard http=>80; standard https=>443)….
DroidDraw Beta
User Interface (UI) designer/editor for programming the Android Cell Phone Platform http://www.droiddraw.org/
How to fix java.net.UnknownHostException on Android
Original Article: http://jesper.storm-frandsen.dk/pages/How_to_fix_java.net.UnknownHostException_on_Android.php Start the emunator manually with the following command. The trick worked for me, when everything else did not work. C:\android\tools>emulator -avd Legend78 -dns-server 8.8.8.8 The IP address 8.8.8.8 is google-public-dns-a.google.com Or configure Eclipse in the Run or Debug configuration.
Support various screen-size in the Android UI – AndroidPub
Reference : [안드앱콘1] 다양한 스크린 사이즈에서의 UI 처리 http://www.androidpub.com/?mid=android_dev_info&category=127161& amp;page=4&document_srl=320322 Points – Handle resource by folder names res/layout/my_layout.xml: Normal screen-size layout res/layout-small/my_layout.xml: Small screen-size layout res/layout-large/my_layout.xml: Large screen-size layout res/drawable-ldpi/my_icon.png: Icons for low density res/drawable-mdpi/dpi/my_icon.png: Icons for medium density res/drawable-hdpi/my_icon.png: Icons for high density res/drawable-nodpi/composite.xml: Resources that unrelated with density – Do we need to generate…
Designing for Performance
Reference: http://developer.android.com/guide/practices/design/performance.html 성능을 위한 디자인 * 기본적으로 할수있다면 임시 객체를 생성하는것을 최대한 피하라. 생성된 객체가 적을 수록 UX(User Experience)에 직접적인 영향을 미치는 가비지 콜렉션(Garbage Collection)이 적게 실행된다. 1. 객체 생성을 피하라 – 입력 데이터에서 문자열을 추출할때, 복사본을 만드는 대신에, 원본 데이터 문자열의 부분만 리턴하여라. String 객체를 만들어야 하겠지만, 그 객체는 원본데이터와 char[]를 공유할 것이다. – 만약 문자열을 리턴하는…
Android Activity Life Cycle
Making the Android UI Fast and Efficient by Romain Guy
Th_0230_TurboChargeYourUI-HowtomakeyourAndroidUIfastandefficient.pdf Point! Adapters Better Code for efficient view redraw ——————————————————————– 1. Create simple class ——————————————————————– static class ViewHolder { TextView text; ImageView icon; } ——————————————————————– 2. getView() ——————————————————————– public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder; if(convertView == null) { convertView = mInflater.inflate(R.layout.list_item_icon_text, null); holder = new ViewHolder(); holder.text = (TextView) convertView.findViewById(R.id.text);…
Share Google Android API Key in Eclipse with other team members
Share Google Android API Key in Eclipse with other team members Basically, default debug keystore is stored in /Users/{NAME}/.android/debug_keystore 1. Set SVN Repository and Checkout to the computer, which contains the file “debug.keystore” 2. In Eclipse, File->Preference->Android->Build. 3. Set “Custom debug keystore” to “debug.keystore” file in SVN Checkout Directory Then, do not need to change…
Using the Android SDK on a Mac, Eclipse is really slow. How can I speed it up?
Original Article: http://stackoverflow.com/questions/2787055/using-the-android-sdk-on-a-mac-eclipse-is-really-slow-how-can-i-speed-it-up I’m using Eclipse + the Android SDK on a Mac running Snow Leopard to develop Android apps. Thing is, Eclipse is really slow – like, it “beach balls” for a few seconds when changing tabs. Is there anything I can do to improve it’s performance? The solution: change the Java version used…
error: “The connection to adb is down, and a severe error has occured”
Original Article: http://stackoverflow.com/questions/4072706/the-connection-to-adb-is-down-and-a-severe-error-has-occured error: “The connection to adb is down, and a severe error has occured” Try below steps: 1> Close the Eclipse if running 2> Go to the Android SDK tools directory in Command Prompt 3> type adb kill-server 4> then type adb start-server 5> No error message is thrown while starting ADB server, then…