Tag: java

what is stringentity in android and its use

I am new to android , i am following this tutorial, i have found the code below , there he is converting json string to StringEntity. correct me if i am wrong StringEntity is used to pass the data,Headers like Accept,Content-type to Server. // 1. create HttpClient HttpClient httpclient = new DefaultHttpClient(); // 2. make […]

Set Repeat days of week alarm in android

Can somebody give good logic for set repeat days of week alarm? I have done weekly Alarm by using alarmCalendar.set(Calendar.HOUR, AlarmHrsInInt); alarmCalendar.set(Calendar.MINUTE, AlarmMinsInInt); alarmCalendar.set(Calendar.SECOND, 0); alarmCalendar.set(Calendar.AM_PM, amorpm); Long alarmTime = alarmCalendar.getTimeInMillis(); Intent intent = new Intent(Alarm.this, AlarmReciever.class); intent.putExtra(“keyValue”, key); PendingIntent pi = PendingIntent.getBroadcast(Alarm.this, key, intent, PendingIntent.FLAG_UPDATE_CURRENT); am.setRepeating(AlarmManager.RTC_WAKEUP, alarmTime, 7*1440*60000 , pi); The alarm trigger on […]

Why don't some xhdpi mobiles display image located in /res/drawable only?

This is a scenario. There are folders: drawable drawable-ldpi drawable-mdpi drawable-hdpi draawble-xhdpi An image (usually background, but not bound to such images only) is located in /res/drawable only. I test the app on Galaxy S3 and the background is displayed properly. I test on HTC One X and background image is not being displayed. If […]

Android : how to know if MediaPlayer is paused?

MediaPlayer.isPlaying() does not allow to know if the MediaPlayer is stopped or paused. How to know if it is paused and not stopped? Thanks !

Android Canvas didn't draw Path when Path's point out of view

I ran into some problem with Android Canvas when drawing path. My case is that i have a relative layout work like a map view ( not using google api or something like that ). I have to draw a path onto that view. canvas.drawPath(polyPath, borderPaint); I also have to draw other type like circle, […]

Viewport fit screen width and big images

I’m trying to use a WebView for displaying a big image with the built-in multitouch and trying to avoid memory crashes. I set the webView this way: setInitialScale(20); WebSettings settings = getSettings(); settings.setJavaScriptEnabled(true); settings.setUseWideViewPort(true); settings.setLoadWithOverviewMode(true); settings.setSupportZoom(true); settings.setBuiltInZoomControls(true); And then load the following code: <head> <meta name=”viewport” content=”width=device-width, user-scalable=yes” /> </head> <body style=”margin: 0; padding: 0″> […]

Robust file transfer from mobile devices to server

What I need is a solution(a library) for file transfer from mobile devices(iOS, Android) to sever(PHP). The basic requirement is that files should be split into chunks so that if data connection is lost in the middle of sending file, I don’t need to re-send the whole file. Low memory usage is also obligatory. I […]

Correspondence between ImageView coordinates and Bitmap Pixels – Android

In my application I want the user to be able to select some content of an Image contained inside an ImageView. To select the content I subclassed the ImageView class making it implement the OnTouchListener so to draw over it a rectangle with borders decided by the user. Here is an example of the result […]

How to skip or avoid 'retake and review' option after captureing photo from camera using ACTION_IMAGE_CAPTURE

I want to display the image when I am click the photo and set to on my Imageview without user select yes or not…. I Am research more for that and I know also very well that the camera app itself gives you the ability to review/retake the image, and once an image is accepted, […]

Android Bluetooth status 133 in onCharacteristicwrite

I’m new to Android and now doing a simple app that requires writing some data into a peripheral device. Actually nothing goes wrong in a Samsung GT-S7272C device. But when I switch to Sony LT29i, there will always be a status 133 when I’m trying to write into a certain characteristic. I will give out […]

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.