w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
  Home » ANDROID » Page 5
Picasso OOM issue with large images
The answer to all my questions is: https://code.google.com/p/android-query/wiki/API specifically: https://code.google.com/p/android-query/wiki/ImageLoading I have found some tickets at Picasso GitHub with same issues, but unfortunatelly they were never resolved...No custom transformation could help me with Picasso since i needed to resize the image upon download. AndroidQuery handled all that,

Categories : Android

Android: animation doesn't end well
I have found that Android gets a little fussy about XML vs. programatically setting things. I tested with your method and I got alpha of 0.0 at the end when I programatically set the fill after. So whereever you intialize your animation do: animationName.setFillAfter(true); instead of having it in the XML.

Categories : Android

android NullPointerException for ResultReceiver in service
Not sure if this is going to be the issue but: intent.putExtra("receiver", resultReceiver); -------- resultReceiver = intent.getParcelableExtra("mLastID"); Your identification strings do not match, that way will never work. Hope it helps

Categories : Android

how can i create PayPalAdvancedPayment object in order to make a chained payment?
Sorry, the PayPal Android SDK does not yet support chained or parallel payments. The code snippet you pasted in the second section refers to the old MPL, which is your only option at this point. Please follow the iOS issue on when the REST APIs and PayPal mSDK will be supporting this feature.

Categories : Android

How to connect android application to MSSQL server and retrive data from it?
At last found a quiet good guideline to solve my problem. It tells me details about implementing web services and how to connect MSSQL server with Android. This is more than helpful and details are found on the correct answer . What do I need to do is, first of all, have to create an web service using .NET(C#) and then connect my android application to that web service to retrieve data from the

Categories : Android

Custom ListView not collapsing after expansion
Turns out the android:focusableInTouchMode="false" in my xml layouts wasn't working. So i did it programmatically via the ListView OnclickListener for every button with this code button.setFocusable(false); Works OK now

Categories : Android

onTextChanged vs afterTextChanged in Android - Live examples needed
here is the explanation: onTextChanged : This means when you start typing, like you want to write "sports" then this will call on each and every character, like it will call when you pressed "s" then again "p" then "o" and so on... afterTextChanged : This will call when you stop typing, it will calls after you completely wrote "sport", that is the main diffrence. YOUR_EDIT_TEXT.addTextChangedLi

Categories : Android

Get installed application details programatically for opening a pdf
http://pilcrowpipe.blogspot.it/2012/01/creating-custom-android-intent-chooser.html suggests that using PackageManager.queryIntentActivities() could work.

Categories : Android

Layout Android off-screen
Add your layout inside a scrollview http://developer.android.com/reference/android/widget/ScrollView.html Check this sample application for details: http://examples.javacodegeeks.com/android/core/ui/scrollview/android-scrollview-example/

Categories : Android

Android 5.0 Back icon parent activity
In yours onCreate try calling getSupportActionBar().setDisplayHomeAsUpEnabled(true); You then handle the click by checking android.R.id.home in onOptionsItemSelected

Categories : Android

Remove and Add page from PageViewer
Use this concepts. List<String> list = new ArrayList<String>(); CustomAdapoter adaptor = new CustomAdapoter(List<String> lis, ...); pager.setAdapter(adapter); public void addaPage(String str){ list.add("1"); adaptor.notifyDataSetChanged(); } public void removePage(String str) { list.remove("1"); adaptor.notifyDataSetChanged(); }

Categories : Android

ScrollView blocking its parents click listener
Can you please try adding the following touch listener for the TextView and after that, set the onclick Listener for the Textview rather than giving it to the Relative Layout. private OnTouchListener textViewTouchListener= new OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { int action = event.getAction(); switch (action) { case Mo

Categories : Android

how to find the height and width of the image view when it is aligned center in android app?
You can find Image height using below code. final ImageView layout = (ImageView) findViewById(R.id.imageviews); ViewTreeObserver vto = layout.getViewTreeObserver(); vto.addOnGlobalLayoutListener(new OnGlobalLayoutListener() { @Override public void onGlobalLayout() { layout.getViewTreeObserver().removeGlobalOnLayoutListener(this); int height = layout

Categories : Android

how to display progress of number of bytes download and % of data download in android
You can do this : publishProgress("" + (int) ((total * 100) / lenghtOfFile)+ "lengthOfFile="+lengthOfFile); //You can use as a thing to split variable.Here, i used the name "lengthOfFile=" and i will get this through publish progress and split it there @Override protected void onProgressUpdate(String... values) { // TODO Auto-generated method stub super.onProgressUpdate(values); String

Categories : Android

How to show turn by turn navigation in android
https://developers.google.com/maps/documentation/directions/intro Use the directions API to return a list of directions in JSON, you can then plot these directions using Polylines. Additionally it returns the HTML instructions which gives you the wording for directions.

Categories : Android

Using sensor value inBroadcastReceiver
Broadcast receiver doesnt allow processing for more than 5 seconds and also the context is destroyed once the execution for onReceive method is over. You can actually have a receiver for proximity sensor and check telephony manager for the call state inside the onReceive method. Or you can start a service in the above receiver and register for proximity sensor there.

Categories : Android

Android: trying to show info based on what user profile has
I think what you're trying to do could be achieved using an ArrayAdapter and a custom row layout. It is well explained in this article. I'd recommend reading the whole thing but section 6 explains what you want to do.

Categories : Android

Android support library - SearchView in Toolbar does not call onSearchRequested
I had the same problem. Found one simple workaround here. Generally speaking you override method startActivity in search activity and put params to intent when action is equal to Intent.ACTION_SEARCH: @Override public void startActivity(Intent intent) { // check if search intent if (Intent.ACTION_SEARCH.equals(intent.getAction())) { intent.putExtra("KEY", "VALUE"); }

Categories : Android

Android : Parent fragment of a nested fragment
I was calling getParentFragment() in the constructor of the child fragment and thus before the child fragment was fully created. Shifting getParentFragment() to onCreateView() solved the problem. Shifting wasn't an issue as I was calling getParentFragment() to check if the parent fragment had implemented a child fragment interaction listener.

Categories : Android

AsyncTask how to use progressbar
Declare ProgressDialog at class level : class Async extends AsyncTask<Void, Void, String> { ProgressDialog progress; Initialize in onPreExecute() : protected void onPreExecute() { progress=new ProgressDialog(App_list_Activity.this); Dismiss in onPostExecute() : protected void onPostExecute(String result){ progress.dismiss(); In your code you again Initialize ProgressDialog in onPost

Categories : Android

my android registeration class
Write getting success code on postExecute(), i.e. class CreateUser extends AsyncTask<String, String, String> { /** * Before starting background thread Show Progress Dialog * */ boolean failure = false; @Override protected void onPreExecute() { super.onPr

Categories : Android

Mp3 file to Base64 encode string conversion in android phonegap
It's bit late but for others this might help. directoryReader.readEntries(function(entries){ for (var i=0; i<entries.length; i++) { var reader = new FileReader(); var entry = entries[i]; entry.file(function(file){

Categories : Android

Android selector. How to go to normal state after press?
Try with the following Selector for CardView <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true" android:drawable="@drawable/card_on_press"/> <item android:state_focused="true" android:state_enabled="true" android:drawable="@drawable/card_on_focus"/> <item android:state_enabled="true"

Categories : Android

How to extract inbox mail from Office 365 in Android?
The video you referenced dates back to the SharePoint conference in March 2014. That was the Android SDK Preview. In October 2014, we took it out of preview and into general availability, and in the process made a few changes. For example, we developed the SDK to take advantage of Gradle to manage dependencies. Please follow the readme below: https://github.com/OfficeDev/Office-365-SDK-for-Androi

Categories : Android

Sending image through intent
Bitmap bm = BitmapFactory.decodeResource(getResources(), image); File f = new File(getExternalCacheDir() + "/image.png"); try { FileOutputStream outStream = new FileOutputStream(f); bm.compress(Bitmap.CompressFormat.PNG, 100, outStream); outStream.flush(); outStream.close(); } catch (Exception e) { throw new RuntimeException(e); } Intent

Categories : Android

More info on menu selection Glass
You should insert the description textView in the new activity in onCreate non before it's opened. You can send the textDesc String through activity with infoIntent.putExtra("textDesc", textDesc); and retrieve it in the new activity with Bundle extras = getIntent().getExtras(); String desc=(String) extras.getString("textDesc");

Categories : Android

findViewById returns null for action_bar_title
It seems that's broken in Lollipop. Don't know if there's a best alternative but you can do something like this, if you're using Toolbar: import android.content.Context; import android.support.v7.widget.Toolbar; import android.util.AttributeSet; import android.view.Gravity; import android.view.View; import android.widget.TextView; import org.apache.commons.lang3.reflect.FieldUtils; public class

Categories : Android

Android Progress Dialog Gravity Issue
Solution: You need to make one custom style in style.xml file which has a android:Theme.Holo.Dialog theme. Like, CustomProgress <style name="CustomProgress" parent="android:Theme.Holo.Dialog"> <item name="android:alertDialogStyle">@style/CustomAlertDialogStyle</item> <item name="android:textColorPrimary">#FFFFFF</item> <item name="android:backgroun

Categories : Android

convert emoticons to unicode
I got my answer. To get the unicode of the emoticon: StringEscapeUtils.escapeJava(<text>); and decode it back to emoticon: StringEscapeUtils.unescapeJava(<unicode_emoticon>);

Categories : Android

Opening Google map with in a application
Pleas follow this tutorila to integrate Google map in your application : http://www.tutorialspoint.com/android/android_google_maps.htm http://www.androidhive.info/2013/08/android-working-with-google-maps-v2/

Categories : Android

How many times do I need to cache an ad?
if you are not using Chartboost Autocache feature then YES you will have to call cacheInterstitial() and cacheMoreApps() again every time you display a previously cached Ad or chartboost will keep on showing same ad again and again. To use Autocaching feature read the section 'Autocaching' in Chartboost docs.

Categories : Android

Customise Textview of included layout
<include android:id="@+id/news_title" layout="@layout/viewpager_item_layout"/> Try if it helps. You can access like this : View includedLayout = findViewById(R.id.news_title); TextView insideTheIncludedLayout = (TextView )includedLayout.findViewById(R.id.logoDetails);

Categories : Android

SQLCipher and passphrase for encryption
Please refer to this link: http://www.informit.com/articles/article.aspx?p=2268753&seqNum=4 Keep in mind that you should not store the key on your device with protected data

Categories : Android

MediaRecorder issue on Android Lollipop
I filed a bug report on AOSP. https://code.google.com/p/android/issues/detail?id=80715 "The current SELinux policies don't allow for mediaserver to handle app generated abstract unix domain sockets. Instead, I'd recommend you create a pipe-pair ( http://developer.android.com/reference/android/os/ParcelFileDescriptor.html#createPipe() ) which is allowed by the Android 5.0 policy. " I don't know

Categories : Android

Get orientation of the android phone screen
if you are in activity then use getResources().getConfiguration().orientation else if not in activity then use your activity instance by passing it, your_activity_instance.getResources().getConfiguration().orientation Another way: Display display = ((WindowManager) getSystemService(WINDOW_SERVICE)).getDefaultDisplay(); int orientation = display.getOrientation();

Categories : Android

Fragment within FragmentTabHost view lost onBackPressed Android?
Tabs aren't meant to participate in temporal navigation (which is what back nav is for) because they represent content at same level of hierarchy. In case of fragments, the back nav usually pops the back stack. There is a caveat that back nav doesn't pops sub (child) fragments first. So, the fragments added to Activity are removed on back, this includes the entire tabs fragment (along with its ch

Categories : Android

Can't pass image to second activity
You should save the image to some location in phone and then pass the URI of that saved image through intent. And access that URI in second activity. use this code to save file String path = Environment.getExternalStorageDirectory().toString(); OutputStream fOut = null; File file = new File(path, "filename.jpg"); // the File to save to fOut = new FileOutputStream(file); Bitmap pictureBitmap = g

Categories : Android

Android - Webview in fullscreen mode how to hide notificationbar if softkeybaord is present
This works for me. Call this in onCreate: private void setupFullscreenMode() { View decorView = setFullscreen(); decorView .setOnSystemUiVisibilityChangeListener(new OnSystemUiVisibilityChangeListener() { @Override public void onSystemUiVisibilityChange(int visibility) { setFullscreen(); } }); } p

Categories : Android

Git for my Remote Server for an Android Application
You might want to read this for using git on the server. http://git-scm.com/book/en/v1/Git-on-the-Server Tip. If you guys can use a shared folder (e.g., samba shared folder), just keep the common git repository there. Then you guys can clone it and push commits into the git not shared folder. $ git clone samba_shared_folder_path You can understand why it works after reading the above link. T

Categories : Android




© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.