[android-developers] Digest for android-developers@googlegroups.com - 6 updates in 4 topics

Comments: (0)
Justin Anderson <magouyaware@gmail.com>: Aug 29 12:25AM -0600


> If i launch Inner main fragment 2 and i tap on anther next tab. when i
> came back to the Home Tab, the Inner main fragment 2 is not visible and
> it goes to the Home Tab automatically.
 
It sounds like you have a bug. To fix it, you should probably put some
breakpoints in your fragment's lifecycle callbacks and figure out why you
are getting unexpected bhavior.
 
Finally i fixed that issue using this code,
> android:label="@string/title_activity_operation" >
> </activity>
 
> This is a very common approach to "fixing" errors, but it is generally a
very very very bad idea. Unless you know what you are doing, you do not
want to be using the configChanges attribute.
 
But the problem is, i want to set deference layout with orientation change
> (portrait/landscape) for a inner fragment in the main fragment. But It's
> not working and orientation listener is not working in an inner fragment.
 
I'm not sure I fully understand what you are trying to say here... But
what I think you are saying is that you have two layout files (one in
res/layout and one in res/layout-land) but when you rotate the device the
layout doesn't get reloaded. Is that correct? If so, I refer to my comment
above... specifying configChanges for an activity is generally a very very
very bad thing to do, unless you really know what you are doing.
 
Your configChanges line above tells Android to ignore orientation events...
So naturally, when you rotate the device, it ignores the fact that the
orienation changed and the layout doesn't get reloaded. Remove that line,
and then your layouts should magically work on device rotation. But...
that will then bring back the other but you mentioned... so you will need
to start doing some debugging to figure out why you are getting unexpected
behavior.
 
Already I've created two deference XML layouts (layout-large-land and
> layout-land)for a single inner fragment. But the device when rotate UI not
> change. How can i solve this issue.
 
See above... Also, as an FYI, if you provide some code of how you are
loading the fragments, you might get some better info on how to solve your
problem.
 
 
Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware
 
 
On Thu, Aug 28, 2014 at 10:45 PM, askl <amalskr@gmail.com> wrote:
 
askl <amalskr@gmail.com>: Aug 29 12:23AM -0700

Thanks Justin for your reply.
 
Yes you got my issue. But not totally. As you said that, in fragment layout
is not change when device rotation. I had to add
 
android:configChanges
 
 
line in manifest file. Mainly in my application has 3 tabs and first tab
has two inner fragment. So please help me to get orientation event in inner
fragment in First tab. If i remove that manifest code line, when device
rotation inner fragment will be goes back, That mean automatically reload
main fragment when rotation.
 
Thnx
 
 
 
 
On Friday, 29 August 2014 11:59:52 UTC+5:30, MagouyaWare wrote:
Justin Anderson <magouyaware@gmail.com>: Aug 29 11:42PM -0600

As I said before...
 
Also, as an FYI, if you provide some code of how you are loading the
> fragments, you might get some better info on how to solve your problem.
 
You are not going to get any help without showing us some code for how you
are managing your fragments...
 
Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware
 
 
On Fri, Aug 29, 2014 at 1:23 AM, askl <amalskr@gmail.com> wrote:
 
Eddie <branchweb74@gmail.com>: Aug 29 06:47AM -0700

Hi,
 
I have recently included android wear support in my app but when I went to
publish it today I was made aware my earlier version would be archived. My
earlier version was targeting api 16 to include as many devices as
possible.
 
I was hoping if a user doesn't have the latest devices capable of running
my updated android wear version then they would get the earlier version I
have published.
 
What is the correct procedure to enable this to happen please?
 
Regards
Hiko <hikosaisoku@gmail.com>: Aug 29 04:21AM -0700

Hello,
 
I have been searched for this solution on the web for a half day.
but, i could not find the way to solve it.
 
I could find the way to convert FROM DSA.
but, to know for me is opposite than this.
 
could you please let me know if you find out this.
 
i appreciate that you can paste the sample code, or the website URL that
code is described.
 
 
Thank you,
 
Regards,
Hiko
Patrick <patrick.godeau@gmail.com>: Aug 29 02:31AM -0700

Hello Madison,
Thanks for the suggestion. I've already tried this project, but most of the
time, the video doesn't play and I have an error...
Still looking for a working solution.
 
Le jeudi 28 août 2014 19:16:57 UTC+2, Madison Koenig a écrit :
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to android-developers+unsubscribe@googlegroups.com.

[android-developers] Digest for android-developers@googlegroups.com - 5 updates in 5 topics

Comments: (0)
Omkar <omkard@gmail.com>: Aug 28 10:55PM -0700

Hi All,
I am working on a App where functionality is when ever User goes out of the
app and comes back it should ask him login details, so when ever user kicks
himself out of app, by pressing home button or multi-task button or start
other app on my app, then my app should automatically logoff/logout user
and when he comes back ask for credentials.
 
To check backgrounded state of app I tried using
ActivityManager.getRecentTasks(1); and check if topactivity package is
other than my app package and if yes then I assumed app is backgrounded,
This works good till Kitkat/OS L where google has deprecated
ActivityManager.getRecentTasks method for privacy purpose.
 
Second solution we implemented was to use ComponentCallbacks2 and check
onTrimMemory(int level) for level = TRIM_MEMORY_UI_HIDDEN. This worked in
almost all cases, but one. onTrimMemory Component call back is registered
for Application class.
 
When call to Activity finish() happens onTrimMemory call back will not be
triggered. Say I have activity A and B, Activity A starts Activity B, Now I
complete some work in Activity B and call finish() on B, From time when
finish() on B is called till Activity A's onStart/onResume will be called,
in this timeframe if user press home buttom/ multitask button and goes out
of the app, onTrimMemory is not called and it is not possible to know if
app was backgrounded, because of this we can not logoff session. So if user
gets out of app in that timeframe and goes back he will get same session
back.
 
Second case we detect same behavior is, if we call finish() in activity B's
onPause() and user press home/multitask button or start other app from
notification area then because of this finish() call in onPause, we are not
getting onTrimMemory call back.
 
There should be some standard api/call back to check if app is
backgrounded, if not, apis like onTrimMemory should be consistent with
their call backs. Kindly help.
askl <amalskr@gmail.com>: Aug 28 09:45PM -0700

I've a Project Android Tab Pager with Fragments. And there're two inner
fragments in Main fragment.
 
- Home Tab (Fragment)
- Inner main fragment 1
- Inner main fragment 2
- Next Tab 1 (Fragment)
- Next Tab 2 (Fragment)
 
If i launch Inner main fragment 2 and i tap on anther next tab. when i came
back to the Home Tab, the Inner main fragment 2 is not visible and it goes
to the Home Tab automatically. Finally i fixed that issue using this code,
 
<activity
android:name=".HomeActivity"
android:configChanges="orientation|screenSize"
android:label="@string/title_activity_operation" >
</activity>
 
But the problem is, i want to set deference layout with orientation change
(portrait/landscape) for a inner fragment in the main fragment. But It's
not working and orientation listener is not working in an inner fragment.
 
Already I've created two deference XML layouts (layout-large-land and
layout-land)for a single inner fragment. But the device when rotate UI not
change. How can i solve this issue.
underthesun <ywid062@gmail.com>: Aug 28 08:59PM -0700

Is there a reason why InputMethodService's onCreateInputView() is called
twice when the user switches to landscape from portrait? Is there a way to
disable this?
 
It's causing an issue in my GLSurfaceView-based SoftKeyboard. Somehow,
GLSurfaceView does not want to render after being removed from the view
previously. Somehow onLayout and onMeasure is called, but not the rendering
code. It seems that somehow InputMethodService managed to stop the
GLSurfaceView thread, and I'll have to hack around this somehow.
 
However, this shouldn't have happened because onCreateInputView is supposed
to only be called once, as per the API description:
 
"This will be called once, when the input area is first displayed. You can
return null to have no input area; the default implementation returns
null." (from
http://developer.android.com/reference/android/inputmethodservice/InputMethodService.html#onCreateInputView()
)
 
Can anybody help me, or point me to the right direction?
 
I've been told the chances are that I'll have to delve into the source code
myself (having nightmares on that) or pray that someone from Google
replies. Is that the reality of Android development?
Andrew <andrew.dahm@gmail.com>: Aug 28 12:14PM -0700

I am a developer trying to use the alpha testing functionality on the
Developer Console.
 
 
I have added my work email to a Google Group which I then added to the
alpha testing list for the app. I invited myself, approved everything,
etc. I visited the Google Play store on my device and downloaded the alpha
version. This confirms everything is working since the alpha version is
higher than the most recently published version.
 
 
I have since then pushed several new versions to alpha testing. When I
visit the Google Play store on my Android device, the Google Play store
correctly tells me the current version of the app is the newest alpha
testing version.
 
 
However, my Android device currently has a version of the app several
versions prior to the most current version (it is still at the original
alpha testing version I downloaded), and will not download the most current
version. The Google Play store only provides me with options to uninstall
and open. Again, the Google Play store correctly shows the current version
of the app to be the newest alpha version, which is several versions higher
than the version on my device.
 
 
The same issue is happening to a couple of other users I've added to alpha
testing.
 
 
I have done the following:
 
 
- Made sure Download Manager was turned on
 
- Made sure I had enough storage
 
- Tried restarting the device
 
- Cleared the Google Play Store app's cache & data
 
- Checked for system updates
 
- Confirmed that the versionCode has been incremented
 
- Confirmed the app supports my device and version of Android
 
 
I could probably uninstall the app and reinstall the app to get the newer
version, but this is not useful for myself or my other testers. My app has
been used several years by some people. It synchronizes data with our
website, and, for these users, they would have quite a bit of data to
download again.
 
 
Nexus S
 
Android 4.1.2
 
 
Thanks for your help.
Madison Koenig <pedlar88@gmail.com>: Aug 28 10:16AM -0700

Hello Patrick,
 
You can try and use Android YouTube Player, a Open Source project for
playing YouTube videos in the native Android Media Player (VideoView). This
will give you a high quality video URL to the direct source of the video.
 
https://code.google.com/p/android-youtube-player/
 
It is however no longer maintained, but the code is functional and easily
understandable if changes need to be made.
 
-Madison
 
On Friday, August 22, 2014 7:43:45 AM UTC-5, Patrick wrote:
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to android-developers+unsubscribe@googlegroups.com.

[android-developers] Digest for android-developers@googlegroups.com - 2 updates in 2 topics

Comments: (0)
Shaha <shamim@hasnath.net>: Aug 27 10:36PM -0700

Hi all,
 
I was trying to make a standalone c++ version of the Android Keyboard's
(LatinIME) dictionary suggestions.
I was trying this for several days but unfortunately without success.
 
I used "gingerbread" version of the native code
(https://android.googlesource.com/platform/packages/inputmethods/LatinIME/+/gingerbread-mr4-release/native/).
Here the "count" variable always returns 0. I tried printing first 100
characters of "buffer" (in my code) and "mDict" (from dictionary.h)
after initalization, they shows different values. I'm not sure where I'm
doing wrong.
 
I have attached the ".dict" file (it works in android keyboard).
 
It would be great If someone could point me in the right direction.
 
Thanks in advance.
 
 
Here's my code:
 
#include <iostream>
#include <fstream>
#include <iterator>
#include <vector>
#include "dictionary.h"
 
using namespace latinime;
using namespace std;
 
 
static int FULL_WORD_FREQ_MULTIPLIER = 2;
static int TYPED_LETTER_MULTIPLIER = 2;
static int MAX_WORD_LENGTH = 48;
static int MAX_ALTERNATIVES = 16;
static int MAX_WORDS = 18;
 
 
static int getSuggestions(void *dict, int *inputCodes, int arraySize, char
*outputChars, int *frequencies, int maxWLen, int maxWords,
int maxAlt, int skipPos, int *nextLetterArray,
int nextLettersSize){
Dictionary *dictionary = (Dictionary*) dict;

if (dictionary == NULL) return 0;

printf("after not null\n");

int count = dictionary->getSuggestions(inputCodes, arraySize, (unsigned
short*) outputChars,
frequencies, maxWLen, maxWords,
maxAlt, skipPos, nextLetterArray,
nextLettersSize);

return count;
}
 
 
int main(int argc, const char * argv[]) {

std::ifstream file("/path/to/main.dict", ios::binary);

file.seekg(0, std::ios::end);
std::streamsize size = file.tellg();
file.seekg(0, std::ios::beg);

char *buffer = new char[size];

if (file.read(buffer, size)){
printf("\nworked\n");
}


char *output = new char[MAX_WORD_LENGTH * MAX_WORDS];

for (int i=0; i<MAX_WORD_LENGTH * MAX_WORDS; i++){
output[i] = (char)0;
}
 
// input = "hi"

int *mInputCodes = new int[MAX_WORD_LENGTH * MAX_ALTERNATIVES];
for (int i=0; i<MAX_WORD_LENGTH * MAX_ALTERNATIVES; i++){
mInputCodes[i] = -1;
}
 

int *mFrequencies = new int[MAX_WORDS];
for (int i=0; i<MAX_WORDS; i++){
mFrequencies[i] = 0;
}

for(int i=0; i<2; i++){
mInputCodes[i*MAX_ALTERNATIVES] = 72 + i;
}

Dictionary *dict = new Dictionary(buffer, TYPED_LETTER_MULTIPLIER,
FULL_WORD_FREQ_MULTIPLIER);

int count = getSuggestions(&dict, mInputCodes, 2, output,
mFrequencies, MAX_WORD_LENGTH,
MAX_WORDS, MAX_ALTERNATIVES, -1, NULL, 0);


return 0;
}
Seshu <s.seshu143@gmail.com>: Aug 27 11:40AM -0700

Hi All,
I am cropping my image which is selected from my gallery or captured from
my device is getting exception and i am using moto g as well as moto e i.e.,
 
!!! FAILED BINDER TRANSACTION !!!
Exception in new application when starting activity
net.londatiga.android/.MainActivity
android.os.TransactionTooLargeException
at android.os.BinderProxy.transact(Native Method)
at
android.app.ApplicationThreadProxy.scheduleLaunchActivity(ApplicationThreadNative.java:758)
at
com.android.server.am.ActivityStackSupervisor.realStartActivityLocked(ActivityStackSupervisor.java:1007)
at
com.android.server.am.ActivityStackSupervisor.attachApplicationLocked(ActivityStackSupervisor.java:412)
at
com.android.server.am.ActivityManagerService.attachApplicationLocked(ActivityManagerService.java:5104)
at
com.android.server.am.ActivityManagerService.attachApplication(ActivityManagerService.java:5178)
at
android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:405)
at
com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2140)
at android.os.Binder.execTransact(Binder.java:404)
at dalvik.system.NativeStart.run(Native Method)
Force removing ActivityRecord{42d72cf0 u0
net.londatiga.android/.MainActivity t470}: app died, no saved state
Calling a method in the system process without a qualified user:
android.app.ContextImpl.sendBroadcast:1252
android.content.ContextWrapper.sendBroadcast:365
com.motorola.motocare.util.TriggerHelper$TriggerBuilder.send:76
com.motorola.motocare.internal.frameworkevents.PauseResumeTrigger.handleFrameworkEvent:53
com.motorola.motocare.internal.frameworkevents.FwEventMonitor$FrameworkListener.processFrameworkEvent:114
 
if any body knows then please let me know.
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to android-developers+unsubscribe@googlegroups.com.