tag:blogger.com,1999:blog-27322066152291697752024-03-05T19:51:04.205-08:00Iriska's6istikhttp://www.blogger.com/profile/07556054839326569725noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-2732206615229169775.post-72168606359327923512014-05-14T01:03:00.000-07:002014-05-14T01:06:46.256-07:00Set TextSize programatically to Android TextView<div dir="ltr" style="text-align: left;" trbidi="on">
As you probably know you should set TextSizes in sp units (other dimensions in dp). It is <span style="background-color: white; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 17.804800033569336px;">scale-independent pixels. </span><br />
<div>
<span style="font-family: Arial, Liberation Sans, DejaVu Sans, sans-serif;"><span style="background-color: white; font-size: 14px; line-height: 17.804800033569336px;">So, you should set in your dimens file </span></span></div>
<div>
<span style="background-color: white; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 17.804800033569336px;">
</span><br />
<pre class="brush: java"><span style="font-family: Arial, Liberation Sans, DejaVu Sans, sans-serif;"><span style="font-size: 14px; line-height: 17.804800033569336px;">dimen name="month"></span></span><span style="background-color: white; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 17.804800033569336px;"><dimen name="month">32sp</dimen>
</span></pre>
</div>
<div>
<span style="font-family: Arial, Liberation Sans, DejaVu Sans, sans-serif;"><span style="background-color: white; font-size: 14px; line-height: 17.804800033569336px;"><br /></span></span></div>
<div>
<span style="font-family: Arial, Liberation Sans, DejaVu Sans, sans-serif;"><span style="background-color: white; font-size: 14px; line-height: 17.804800033569336px;">Programatically you can set this textsize by </span></span></div>
<div>
<span style="font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 17.804800033569336px;"> textview_name.setTextSize(TypedValue.COMPLEX_UNIT_PX, getResources().getDimension(R.dimen.month));</span></div>
<div>
<br /></div>
<div>
Other combination incorrect.</div>
</div>
6istikhttp://www.blogger.com/profile/07556054839326569725noreply@blogger.com0tag:blogger.com,1999:blog-2732206615229169775.post-56877857291156991822014-05-03T02:39:00.001-07:002014-05-03T02:40:41.540-07:00logcat doesn't show any error/debug info huawei<div dir="ltr" style="text-align: left;" trbidi="on">
I've bought huawei for testing purposes. Its perfect for its price but I can't see any error details on logcat, usb debugging seems impossible. I trying restart eclipse/adb server/looking at the ddms but nothing helps.No errors, no Log info, no debug. I have huawei y300, android 4.1, but it seems all huwei has the same 'feature'.<br />
<br />
Solution is:<br />
<div class="post-text" style="background-color: white; border: 0px; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 17.804800033569336px; margin: 0px 5px 5px 0px; padding: 0px; vertical-align: baseline; width: 660px; word-wrap: break-word;">
<div style="background-color: transparent; border: 0px; clear: both; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
Dial</div>
<pre class="default prettyprint prettyprinted" style="background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; margin-bottom: 10px; max-height: 600px; overflow: auto; padding: 5px; vertical-align: baseline; width: auto; word-wrap: normal;"><code style="border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;"><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">*#*#</span><span class="lit" style="background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;">2846579</span><span class="com" style="background-color: transparent; border: 0px; color: grey; margin: 0px; padding: 0px; vertical-align: baseline;">#*#*</span></code></pre>
<div style="background-color: transparent; border: 0px; clear: both; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
and you will see a hidden menu. Go ProjectMenu / Background Setting / Log setting and define the log availability (log swith) and level (log level setting).</div>
<div style="background-color: transparent; border: 0px; clear: both; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
And then make sure you restart your phone.</div>
<div style="background-color: transparent; border: 0px; clear: both; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
Please note this probably only applies to Huawei phones.</div>
<div>
From <a href="http://stackoverflow.com/questions/18124334/huawei-logcat-not-showing-the-log-for-my-app">here</a></div>
</div>
Works as a charm...<br />
<br />
<br /></div>
6istikhttp://www.blogger.com/profile/07556054839326569725noreply@blogger.com0tag:blogger.com,1999:blog-2732206615229169775.post-82718040951065397162011-09-13T11:10:00.000-07:002011-09-13T11:19:00.808-07:00Christmas Wallpapers<div dir="ltr" style="text-align: left;" trbidi="on">I've published Live WallPapers with Christmas Theme. It shows snow flakes falls down. Actually I made walpapers in last year but couldn't check how it works into real device.It was interesting to make the snow looks like real. If I find some time I will write how to create falling effect.<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYCPo_uUlA7qL5NHrWzUm4DgcVzwJKr_Nwj9TkpvrQTcrZk26fgobSIdkv4w_Jeu0TzpnOpWA_nPWI4Anp4J5dCYupg040kB99WV3Nu_ZVwhhSB7dtUi9sz5K49rM0-YuGp9KWf4Gaqurl/s1600/device-2011-09-11-200621.png" imageanchor="1"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYCPo_uUlA7qL5NHrWzUm4DgcVzwJKr_Nwj9TkpvrQTcrZk26fgobSIdkv4w_Jeu0TzpnOpWA_nPWI4Anp4J5dCYupg040kB99WV3Nu_ZVwhhSB7dtUi9sz5K49rM0-YuGp9KWf4Gaqurl/s400/device-2011-09-11-200621.png" width="225" /></a></div><br />
</div>6istikhttp://www.blogger.com/profile/07556054839326569725noreply@blogger.com0tag:blogger.com,1999:blog-2732206615229169775.post-50341378913321279752011-09-13T10:52:00.000-07:002011-09-13T10:53:37.269-07:00Add AdMob AdView to PreferenceActivitySimple solution to add AdMob advert to Live Wallpaper settings screen is create new type which will show AdMob AdView and then include it into PreferenceScreen. <br />
<br />
1) Add new type AdmobPreference:<br />
<pre class="brush: java">public class AdmobPreference extends Preference
{
public AdmobPreference(Context context) {
super(context, null);
}
public AdmobPreference(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
protected View onCreateView(ViewGroup parent) {
LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
return inflater.inflate(R.layout.admob_preference, null);
}
}
</pre>2) Add admob_preference.xml to res/layout:<br />
<pre class="brush: xml"><linearlayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:myapp="http://schemas.android.com/apk/res/YourPackageName"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:layout_width="fill_parent" android:layout_height="fill_parent">
<com.google.ads.AdView android:id="@+id/adView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
ads:adUnitId="YourUnitId"
ads:adSize="BANNER"
ads:loadAdOnCreate="true"
/>
</LinearLayout>
</pre>3) Now you can use your type within PreferenceScreen. <br />
<pre class="brush: xml"><preferencescreen xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/snow_settings_title"
android:key="snowsettings">
<PathToYourPackage.AdmobPreference android:key="ad" />
...
</pre>6istikhttp://www.blogger.com/profile/07556054839326569725noreply@blogger.com0tag:blogger.com,1999:blog-2732206615229169775.post-35365051309220160802010-08-10T14:23:00.000-07:002010-08-10T14:30:18.543-07:001.2 UpdateNew requested features added.<br />First is - "Love quotes" screen selection added with wide range of love quotes.<br />Now it looks like this:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnFhSDM3e6WwfgP7JwiEhMqDvIjZi701FEFuVd0D0WmaM9VuM1RBcChHECedk_apZowaF5V9qmzKASQwGCkNQPKUADi9nXexQl-h4lJFQTfz-GcTsJYHp9E8Wp7kS3tc33am2Ial6h9i2I/s1600/device.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 214px; height: 320px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnFhSDM3e6WwfgP7JwiEhMqDvIjZi701FEFuVd0D0WmaM9VuM1RBcChHECedk_apZowaF5V9qmzKASQwGCkNQPKUADi9nXexQl-h4lJFQTfz-GcTsJYHp9E8Wp7kS3tc33am2Ial6h9i2I/s320/device.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5503895615930075762" /></a>6istikhttp://www.blogger.com/profile/07556054839326569725noreply@blogger.com1tag:blogger.com,1999:blog-2732206615229169775.post-72650643363515413482010-02-10T12:52:00.000-08:002010-02-10T13:13:18.609-08:00Love letter applicationI've just uploaded my application 'Love letters' to market.<br />My intention was creating an application for Valentine's Day which allows you send Valentine cards to your friends. No internet connection is needed if you just send MMS. <br />Also application allows to share picure and congratulation to your friends via our favourite app like FaceBook, twitter, flickr. You can also set images as wallpaper. <br />I'll appreciate all suggestions and comments. If you have any issues or found a bug - please let me know. <br />Have fun!6istikhttp://www.blogger.com/profile/07556054839326569725noreply@blogger.com0