spot7.org logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
  Home » ANDROID » Page 1
No navigation/status bar touch listener exists, why?
First of all, the navigation bar and status bar aren't a part of your application window... they are system windows owned by the OS and run by an entirely separate process. There's no way to attach a touch listener to a View that live in another window without explicit permission from the OS, as that would make it possible for third party apps to intercept touch events dispatched to other applicat

Categories : Android

z-index in Relative layout
Place the TextView first than apply layout_below for button: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/rlBottom" android:layout_width="fill_parent" android:layout_height="match_parent"> <TextView android:id="@+id/bVio_count" android:layout_width="wrap_content" android:layout_height=

Categories : Android

java.lang.SecurityException: Permission Denial: getIntentSender() when using UiAutomation in a test
This isn't an answer for why UIAutomator isn't catching the error, but rather a possible workaround that I found. When accessibility services are on I am unable to get an UIAutomator dump because I receive the error you described. When I turn off TalkBack and/or Switch Access in the Accessibility settings I no longer get the Permission Denial error and UIAutomator dump works successfully. Not sure

Categories : Android

mvvmcross videoview URL binding
MvvmCross is very flexible. What you're asking for is not something that is built-in, but you can easily extend MvvmCross to add support for it. MvvmCross has what are called Binding Builders. This is where you register custom Target Bindings. A binding takes a type, like VideoView, and a property name like "VideoUri". When MvvmCross sees a binding attribute like: local:MvxBind="VideoUri MyVide

Categories : Android

Android Emulator Unfortunately dev tools has stopped
There is an official bug: https://code.google.com/p/android/issues/detail?id=62134 It is filed for KitKat but is reproducible on 5.0.1 emulator as well.

Categories : Android

Square Dagger error: class is exclusively members injected / cannot be scoped required
There error seems to be caused by not having an @Inject constructor. In my case, I was using lombok constructor generation on the class. IE. @RequiredArgsConstructor(onConstructor = @__({@Inject})) public class MyClass { private final AnotherClass anotherClass; } And changing to an explicit constructor resolved the problem. I expect the failure is related to dagger running before the gene

Categories : Android

Installing a widget from an APP
Is that possible? No. The user installs the app widget through the home screen. The idea is that you first download the app, which will help you to configure the widget, and then you have to manually place the widget in place. That is also not possible. The flow is that the user chooses the app widget in the home screen, places the widget in place, then if you have a configuration acti

Categories : Android

How to stop onDraw() methods causing jerky scrolling of a ListView
A few things: 1) Post more source 2) read http://developer.android.com/training/improving-layouts/smooth-scrolling.html 3) consider using an ArrayAdapter http://developer.android.com/reference/android/widget/ArrayAdapter.html You may want to track the number of times you call create bitmap, and how garbage collection is being handled there. If you're not properly recycling your views, and yo

Categories : Android

How to find my Google Play Services Android BASE64_PUBLIC_KEY
In the developer console, select your app > Services & APIs > "YOUR LICENSE KEY FOR THIS APPLICATION Base64-encoded RSA public key to include in your binary".

Categories : Android

Set style programatically does not work
The third argument to the View constructor needs to be a theme attribute, e.g. R.attr.myCardViewStyle. You will need to specify the value of the attribute in your app theme and define the attribute in attrs.xml. res/values/attrs.xml: <?xml version="1.0" encoding="utf-8"?> <resources> ... <attr name="myCardViewStyle" format="reference" /> </resources> res/values/

Categories : Android

How to get contacts from phonebook and sim but skype, facebook etc. in android
This tutorial should help you out to fetch contacts from an android device : http://www.c-sharpcorner.com/UploadFile/1e5156/fetch-contacts-from-android-phone-in-android-studio/ Lemme know if it helped out

Categories : Android

Where to put JUnit test in Android project
This link from android developers provides full explanations: http://developer.android.com/tools/testing/testing_android.html Tests should be included in the same project nearby src folder

Categories : Android

My Android Studio project keeps running my old project/application
I would make a copy of the project in a new folder and in this copy delete the following; .iml file .gradle folder .idea folder build folder then open Android Studio and select 'File > Import Project...' and select the new projects settings.gradle file and click 'open' You might have to check the dependencies and re-build but hopefully this should set things up in AS from scratch.

Categories : Android

how to avoid OUtOfMemory problems with create Bitmap
I think you are getting a lot of Bitmaps which overloads your system memory, or if it a single one a think it's an extremely huge one, So, to solve the problem, you have to do two things, first make sure you don't run this method a lot of times for the same Bitmap(as that leads to a lot of Bitmaps stored in your memory and all of them belonging to the same one), second use a custom method to scale

Categories : Android

What tools use and how do continuous integration and test in Android with eclipse?
For my part, I use Android Studio, and gradle. I use TeamCity as the continuous integration server, which supports Gradle. I have my unit tests launched automatically by TeamCity, using Gradle, on a desktop Android device (kind of mini-computer), it's pretty usefull. I've started tests with a phone plugged in USB on a TeamCity agent, that works very well too.

Categories : Android

Converting drawable resource to Bitmap Android
Why don't you just directly get the media as a bitmap? Bitmap bm = BitmapFactory.decodeResource(getResources(), R.drawable.img1); Should be simpler than getting a drawable and casting it.

Categories : Android

Fragment Transaction show() does not show fragment on second time
You need to override the default execution of configuration changes. You can do this by using the configChanges attribute of the activity tag in AndroidManifest. Read more about it here.

Categories : Android

Espresso - How to match ActionBar visibility?
The action bar view has an ID but it's not exposed. We can get it with getIdentifier: Resources resources = getInstrumentation().getTargetContext().getResources(); int actionBarId = resources.getIdentifier("action_bar_container", "id", "android"); onView(withId(actionBarId)).check(matches(isDisplayed())); Code adapted from this related answer. I think this will work but I haven't tested it.

Categories : Android

Viewport setting ignored in Phonegap Android app, but only on certain phones?
Did you confirm if the user is using the phone's built-in browser, or Chrome or Firefox Mobile? It's very possible that the webkit can be tweaked from phone to phone. For example, my Droid Turbo comes with Chrome as its default browser, but my Samsung Galaxy S3 had a system-browser that was webkit-based, which I replaced with Chrome. More likely, the issue you are experiencing is that the meta ta

Categories : Android

how to open an activity with url scheme android
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Intent intent = getIntent(); if(Intent.ACTION_VIEW.equals(intent.getAction())){ Uri uri = intent.getData(); int status = Integer.parseInt(uri.getQueryParameter("status")); // reading status Log.d("TAG","status code " +status);

Categories : Android

Android AsyncTask and Thread different behavior
Starting in Honeycomb 3.0 AsyncTasks tasks are executed on a single thread to avoid common application errors caused by parallel execution. so if you are running multiple tasks at the same time only one will be running at a time. if you want to run parallel tasks you need to use executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);

Categories : Android

How can one ellicit a Toast from a Service to a Fragment
why you can't perform Toast from Service? if you really need to send data from Service to Fragment you should use service binding (example) then from Activity to Fragment

Categories : Android

GCMIntentService onRegistered not called
GCMRegistrar is deprecated. Replaced by GoogleCloudMessaging API. More effecient. :)

Categories : Android

LinearLayout cropping but not expanding in Scrollview
nothing missed, it's proper way to behave, unfortunately... your LinearLayout should have wrap_content without weight, check this: ScrollView's Handy Trick also you might measure both SCrollView and Linear and if svHeight>llHeight then ll.getLayoutParams().height=sv.height edit: ok, some handy code for you: <ScrollView android:id="@+id/sv" android:layout_width="match_parent" andr

Categories : Android

Get a file from the application directory
I have a folder of images, and the path (in the pc application folder) is: blablablablabla//images/ Nothing in the Android development tools will pay any attention to that directory, and its contents will not be in the APK. where should i put my folder "images" to find it in You are welcome to download files from the Internet and put them in new File(getFilesDir(), "images") if you wan

Categories : Android

How to set layout params using view's on touch listener?
check smth like this: setOnTouchListener(new OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { ((LayoutParams)slidingLayout.getLayoutParams()).marginTop=event.getY(); return true; } } listener for whole parent view edit: oh, my reading skills are really poor, I'm assuming you want to get out this view by touching blue small view...

Categories : Android

How to disable Google Fit and revoke permissions from the app itself
As per the Android developer forum https://developer.android.com/reference/com/google/android/gms/fitness/ConfigApi.html public static final int APP_NOT_FIT_ENABLED Status code denotes that an app was not found in the list of connected apps in Google Fit. Signifies that either access to the app was already revoked, or the app is not registered on the developer's console. Const

Categories : Android

Android Wear - receiving message from Wear without WearableListenerService?
Per the Sending an Syncing data training: WearableListenerService (for services) Extending WearableListenerService lets you listen for important data layer events in a service. The system manages the lifecycle of the WearableListenerService, binding to the service when it needs to send data items or messages and **unbinding the service when no work is needed.* DataListener (for foreg

Categories : Android

How can I start new activity from another package?
Just do this Intent myIntent = new Intent(this,my_class.class); startActivity(myIntent); Do this in your AndroidManifest.xml <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name="Activity1" android:label="@string/app_name" >

Categories : Android

Xamarin Facebook Log in and use Graph api
Try keytool -exportcert -alias androiddebugkey -keystore ~/.local/share/Xamarin/Mono for Android/debug.keystore | openssl sha1 -binary | openssl base64 use password android.

Categories : Android

Header for ListView with passing string
Add one text view above the list view in your xml layout. Now when you call the activity containing list view send the string using intent object as below Intent i=new Intent(PresentActivity.this,NextActivity.class); i.putExtra("keyname","String which is to be used as heading for listview"); then start your activity using startActivity(i); In your second activity you wri

Categories : Android

Android Volley request queue does not run all requests
if you use an IntentService, it is destroyed as soon as the handleIntent method returns. if no activity is running at this time you app terminates, and your singleton disappears. With volley you don't need an IntentService, since Volley handles the asynchronism for you. Use a standard service with START_STICKY as a return, and don't forget to stopSelf when you have completed your requests.

Categories : Android

How to start a service on android every time when a SMS message has been send
You'll need to use a "Broadcast Reciever" for that As the name suggests: broadcast receiver waits for an event to occur and when the event occurs , it receives that info, which was broadcast-ed by the event. Here is a great tutorial which describes how to implement it step by step (A little long to type it here) http://androidexample.com/Incomming_SMS_Broadcast_Receiver_-_Android_Example/index

Categories : Android

Passing Countdown Timer beetwen Activities in Android
You are creating the CountDownTimer before getting the value. Simply move the code that creates the timer to below where you get the value. public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.juego); cuentaRegresiva=(TextView)findViewById(R.id.cuentaRegresiva); bundle = getIntent().getExtras(); startTime= bundle.getLon

Categories : Android

Cannot access to app engine local dev server
You seem to try with port number 8888 (look at your error message), where as your server is running at 8080 port number If you want to change the port number, there is an .iml file inside the project, edit HTTP_PORT under configurations{}

Categories : Android

Which is the preferred method when using/calling colors in android?
Is there any difference/affect in performance on color redraws? Pros/Cons ? not really. @color/white retrieve an entry in your colors.xml file, that contains the colours in the hex format. @android:color/ retrieve an entry in the colors.xml file provided by the framework

Categories : Android

RadBeacon Tag distance calculating
You can get the best results for a specific device by measuring RSSI at various distances and doing a regression against the above formula to find coefficients for the best fit. You can read an explanation of the recommended distances here: http://altbeacon.github.io/android-beacon-library/distance-calculations.html You can then import the data into R (the free statistical computing software) a

Categories : Android

Which has better performance? Add or Copy and Remove in ArrayList?
I do not think there is clear answer to this one. But if you have some knowledge about the values you can do some optimizations. If you are expecting the majority of elements to be removed(or added in the first case) than the better solution is to use method one because you will not do many removes. If if you are expecting to remove just a few elements it's better to use the second method because

Categories : Android

Custom attributes in style
Styles don't match what you do in layouts. In your styles.xml, remove your custom xmlns declaration, and just use the attributes directly with no prefix, like so: <style name="FlatTextRipple"> <item name="rv_centered">true</item> <item name="rv_color">#CCCCCC</item> <item name="rv_type">simpleRipple</item> <item name="rv_zoom">true&l

Categories : Android


Recently Add
I'm trying to create an onListItemClick even for a customized adapter. The array of items is found in res/values folder
No navigation/status bar touch listener exists, why?
z-index in Relative layout
java.lang.SecurityException: Permission Denial: getIntentSender() when using UiAutomation in a test
mvvmcross videoview URL binding
Android Emulator Unfortunately dev tools has stopped
Square Dagger error: class is exclusively members injected / cannot be scoped required
Installing a widget from an APP
How to stop onDraw() methods causing jerky scrolling of a ListView
How to find my Google Play Services Android BASE64_PUBLIC_KEY
Set style programatically does not work
How to get contacts from phonebook and sim but skype, facebook etc. in android
Where to put JUnit test in Android project
My Android Studio project keeps running my old project/application
how to avoid OUtOfMemory problems with create Bitmap
What tools use and how do continuous integration and test in Android with eclipse?
Converting drawable resource to Bitmap Android
Fragment Transaction show() does not show fragment on second time
Espresso - How to match ActionBar visibility?
Viewport setting ignored in Phonegap Android app, but only on certain phones?
how to open an activity with url scheme android
Android AsyncTask and Thread different behavior
How can one ellicit a Toast from a Service to a Fragment
GCMIntentService onRegistered not called
LinearLayout cropping but not expanding in Scrollview
Get a file from the application directory
How to set layout params using view's on touch listener?
How to disable Google Fit and revoke permissions from the app itself
Android Wear - receiving message from Wear without WearableListenerService?
How can I start new activity from another package?
© Copyright 2017 spot7.org Publishing Limited. All rights reserved.