- How to inject mock objects in Android? [1 Update]
- License client issue: can NOT_LICENSED be returned due to being off-line? [1 Update]
- Is it all devices larger side the landscape? [2 Updates]
- Why apps not developed in C ? [6 Updates]
- Install the Google Play Services SDK issue [2 Updates]
- When/where should bindService/unbindService be called [1 Update]
- Yuvi <firstname.lastname@example.org> Mar 31 10:45PM -0700
Is it good idea to create constructor of Android Component classes ?
I have read somewhere that we should never create constructors for Android
On Wednesday, March 26, 2014 11:48:31 PM UTC+5:30, Andrew Mackenzie wrote:
- Ted Hopp <email@example.com> Mar 31 06:32PM -0700
We have an app that uses the following license policy:
- if a definitive response of LICENSED is stored in the app's
preferences and has not expired, allow access.
- if a definitive response is not stored in the app's preferences, or if
it has expired, or if the cached response is NOT_LICENSED, request a
license check from the server.
- if a definitive response (LICENSED or NOT_LICENSED) is received, it is
stored in the prefs, along with the license validity period returned by the
server. Access is permitted if the definitive response is LICENSED.
- if anything other than a definitive response is received (airplane
mode, server error, etc.), the last stored definitive response is used to
determine access, even if expired. If no response is stored, allow access.
(This is basically the same as the LenientPolicy described in this thread<https://groups.google.com/forum/#!searchin/android-developers/%22NOT_LICENSED%22$20response/android-developers/Pg1R5COMLD8/mBiKJyUxp0MJ>.
We're aware of its weaknesses, but generally it works for us.)
The problem is that we occasionally receive reports of customers being
denied use of the app due to a license problem. These are installations
that definitely should be receiving a server response of LICENSED. When the
problem happens, and when we've been able to obtain details, it always
turns out that the user's device was not fully connected. When full network
connectivity was restored, the app ran fine. Here's (part of) a report from
a customer who has been unusually helpful:
I'm using an Acer Iconia A500 tablet, running Android 4.0.3, kernel
188.8.131.52+. . . . So, I don't seem to be able to simulate it with airplane
mode on. I also tried turning airplane mode back off, and it works fine
right now. The situation where this happened to me it happened three
different times, it was during a reading group at another person's house,
and I don't have any access to their wifi network. So, there was wifi in
the area, but I wasn't connected to any at all, but I wasn't on airplane
mode either. . . If it happens again, I will try to watch more closely and
take note of any network circumstances.
We have not been able to reproduce the problem on either an emulator or on
our test devices. As far as I can tell from our code, our app will always
run unless it receives a response of NOT_LICENSED from the license client.
Our assumption had been that this was only possible if the licensing client
successfully contacted the license server and received a response of
NOT_LICENSED (or had an unexpired NOT_LICENSED server response previously
cached). But perhaps our assumption is wrong. Is there any situation where
the licensing client on the device will return a response of NOT_LICENSED due
to a communication problem (or any other reason besides having received
that response from the license server)? Is there anything we could ask the
customer to do that might help sort out what's going wrong?
- lselwd <firstname.lastname@example.org> Mar 31 07:04AM -0700
When using Eclipse tested app in Nexus7 emulator AVD - Phonegap Build App -
when I have
<preference name="orientation" value="portrait" />
<preference name="orientation" value="all" />
after rotation is OK...
Is it all devices larger side the landscape?
- Marina Cuello <email@example.com> Mar 31 06:01PM -0300
No, there are a few devices with a BlackBerry-like / QWERTY format that
have 4:3 screens. Samsung Galaxy Y Pro is one I can recall. But they're
exceptions, I believe.
- NewToAndroid <firstname.lastname@example.org> Mar 31 04:19AM -0700
I have this question out of curiocity.
Android is based on Linux, which is basically written in C. Why Android apps are not written in C ? Why Java?
I accept that , I might have big gaps in my understanding of Android, which is what I want to clear.
Thanks in advance
- Sai Yamanoor <email@example.com> Mar 31 09:40AM -0500
Someone might correct me if I am wrong here. I learned that they chose Java
to meet performance requirements. There is a detailed explanation behind
how the use of Java affects the device performance.
- Nikolay Elenkov <firstname.lastname@example.org> Apr 01 12:04AM +0900
> Someone might correct me if I am wrong here. I learned that they chose Java
> to meet performance requirements. There is a detailed explanation behind how
> the use of Java affects the device performance.
Because Java is a language that is both high-level enough, so that
hard to shoot yourself in the foot, and still low-level enough to be usable for
Also writing UI code is much easier using some OOP features, otherwise you
end up with function pointers-to-function-pointers with dozens of parameters
- Salsero69 <email@example.com> Mar 31 10:37AM -0700
You can write Apps in C and C++ using the NDK.
On Monday, March 31, 2014 7:19:14 AM UTC-4, NewToAndroid wrote:
- NewToAndroid <firstname.lastname@example.org> Mar 31 12:27PM -0700
Thats good to know. My intension behind asking this question was, will the apps be faster if written in C/C++ ?
But looking at the intro of NDK, they say it won't give significant performance improvement if apps developed in c/c++.
Is it because of the layers of basic Android architechture? Or what?
Any ideas please.
- Kristopher Micinski <email@example.com> Mar 31 04:18PM -0400
One big reason is that a lot of time is spent in system libraries,
which are written in C/C++. I believe in the original talk on Dalvik,
it was indicated that 70% of the time was spent in non-interpreted
code. You also have to remember that Dalvik has a JIT compiler and now
an LLVM based runtime (still in development, it seems), so the impact
from Java is less than you might think.
- limtc <firstname.lastname@example.org> Mar 31 12:40AM -0700
I would like to install Google Play Services and following this
Scroll to the bottom of the package list, expand Extras, select Google Play
services, and install it. If you're using Android Studio, also install
Google Repository (it provides the Maven repository used for Gradle builds).
But I didn't see Google Play services in the Extras folder... I have
updated everything and there are nothing more to update. What should I do?
- limtc <email@example.com> Mar 31 02:21AM -0700
I found the solution... set SDK Manager options to force HTTPS and the
options will show up!
- Johan Appelgren <firstname.lastname@example.org> Mar 31 12:50AM -0700
Why do you need to start the service at boot? That combined with what you
write later about starting and stopping the service while your activity is
running AND binding to it makes no sense to me. You're more likely to get a
good answer if you explain more what you need the service for.
On Saturday, March 29, 2014 8:48:53 PM UTC+1, dashman wrote:
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to email@example.com
To unsubscribe from this group, send email to
For more options, visit this group at
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firstname.lastname@example.org.
For more options, visit https://groups.google.com/d/optout.