[android-developers] What is difference between the Android App downloaded using Google Play store and the one directly installed?

2013-09-19 Thread gauri
Hello,

The android app downloaded/purchased from Google Play is stored in 
/data/app directory.
Does Play Store or android system modify the apk after download?
I have calculated message digest of apk before it's upload to Play store.
I am calculating message digest of the downloaded apk (present at 
/data/app) and verifying it with the digest stored in my app.
When I purchase it from Play store, after my app launch, digest 
verification is getting failed.
I found that the message digest which I have stored in app and the digest 
which I am calculating at run time are differing.
Am I going in right direction?

Thanks.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
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 android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[android-developers] Re: Highlight elements in Webview with Text to Speech

2013-09-19 Thread Dhamodharan S


Hi

 

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
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 android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[android-developers] Highlight elements in Webview with Text to Speech

2013-09-19 Thread Dhamodharan S
 

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
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 android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[android-developers] Re: Highlight elements in Webview with Text to Speech

2013-09-19 Thread Dhamodharan S

I would like to develop app like web page reader concept in android. But i 
feel it was bit difficult to find element from web pages. As far as i know 
it is possible by implementing by using java script functionality. kindly 
share your knowledge for further

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
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 android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [android-developers] onPreviewFrame() not being called the same number of times as the frame rate

2013-09-19 Thread TimeManx
I certainly am using setPreviewDisplay(). But I also need the frames to do 
some image processing.

On Thursday, 19 September 2013 05:29:30 UTC+5:30, Baodong Chen wrote:

 Though not sure why this happened,this is not a good way to show preview! 
 why not use setPreviewDisplay method?
 2013/09/18 18:41 TimeManx shubh...@gmail.com javascript::

 I've created a subclass of SurfaceView which also 
 implements Camera.PreviewCallback  SurfaceHolder.Callback. The time 
 difference between onPreviewFrame() calls is about 0.25 seconds which is 
 4/sec but the actual preview frame rate is definitely more than 25. I can't 
 figure out why this is happening
 The following are my classes
 https://dpaste.de/FP9QU/
 https://dpaste.de/as87Q/

 -- 
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to 
 android-d...@googlegroups.comjavascript:
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com javascript:
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en
 --- 
 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 android-developers+unsubscr...@googlegroups.com javascript:.
 For more options, visit https://groups.google.com/groups/opt_out.



-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
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 android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [android-developers] What is difference between the Android App downloaded using Google Play store and the one directly installed?

2013-09-19 Thread Nikolay Elenkov
On Thu, Sep 19, 2013 at 4:27 PM, gauri gauri.v...@gmail.com wrote:
 Hello,

 The android app downloaded/purchased from Google Play is stored in
 /data/app directory.
 Does Play Store or android system modify the apk after download?

Not for free apps.

 When I purchase it from Play store, after my app launch, digest verification
 is getting failed.
 I found that the message digest which I have stored in app and the digest
 which I am calculating at run time are differing.

On 4.1+, paid apps are forward locked by default, which is implemented
by splitting the APK in a public (in /data/app) and private part
(in /data/app-asec). You are most probably calculating the hash of the
public part only, hence the mismatch. If you have a rooted device
you can verify by searching for you package name in /data/app-asec.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
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 android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[android-developers] Re: Should SQLiteDatabases be limited to 2Gig?

2013-09-19 Thread Nathan
Also interested in any other reasons I might be getting 
SQLiteDiskIOException disk I/O error (code 1802) at random times in the 
field. 

After thinking this was a real breakthrough, I heard back from people 
saying that their database was less than 1 GB anyway. This could be not a 
real problem, or it could be just one of many problems. 

Data from the (singleton) SQliteDatabase can be read from multiple threads, 
but from my best understanding of SQLiteDatabases, reads and writes will 
simply block until they get access. 

Nathan

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
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 android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [android-developers] Re: Should SQLiteDatabases be limited to 2Gig?

2013-09-19 Thread Michael Banzon
Sorry for turning the discussion in another direction but I have to
ask out of curiosity: What kind of data do you have in the database to
make it 2GB or above?

On Thu, Sep 19, 2013 at 7:09 PM, Nathan nathan.d.mel...@gmail.com wrote:
 Also interested in any other reasons I might be getting
 SQLiteDiskIOException disk I/O error (code 1802) at random times in the
 field.

 After thinking this was a real breakthrough, I heard back from people saying
 that their database was less than 1 GB anyway. This could be not a real
 problem, or it could be just one of many problems.

 Data from the (singleton) SQliteDatabase can be read from multiple threads,
 but from my best understanding of SQLiteDatabases, reads and writes will
 simply block until they get access.

 Nathan

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en
 ---
 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 android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.



-- 
Michael Banzon
http://michaelbanzon.com/

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
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 android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [android-developers] Re: Should SQLiteDatabases be limited to 2Gig?

2013-09-19 Thread Kostya Vasilyev
I also get -- rare and very unpleasant -- support emails with this
error, also database disk image is malformed.

Sometimes it's one of the databases used internally by WebView (and
yet, a crash is a crash).

Then there are rare cases when the app's database just disappears.

The framework has code to detect corrupted databases and delete them.
Most likely it's this code that kicks in. I doubt it was added into
the framework just for my app.

SQLite is supposedly the best tested piece of software ever. However,
there was one case when its developer admitted on a mailing list that
a particular version, which happened to be included in a particular
Android release, could corrupt its in-memory buffer, albeit not disk
image (if my memory serves me). So nothing is perfect, all software
has bugs, yada yada yada...

I don't even have a theory on what the root cause is: other SQLite
bugs, Android's use of ext4, memory chips going bad... I just look at
it as a given.

-- K

2013/9/19 Nathan nathan.d.mel...@gmail.com:
 Also interested in any other reasons I might be getting
 SQLiteDiskIOException disk I/O error (code 1802) at random times in the
 field.

 After thinking this was a real breakthrough, I heard back from people saying
 that their database was less than 1 GB anyway. This could be not a real
 problem, or it could be just one of many problems.

 Data from the (singleton) SQliteDatabase can be read from multiple threads,
 but from my best understanding of SQLiteDatabases, reads and writes will
 simply block until they get access.

 Nathan

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en
 ---
 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 android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
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 android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[android-developers] Android USB problems

2013-09-19 Thread eli
   http://stackoverflow.com/questions/18900666/android-usb-problems# 
**
  
I have a tablet, an OTG cable and a barcode reader. I know this works 
because when I start the Google app I can scan barcodes and see them on the 
screen.

I created a very simple application that starts the USB manager and checks 
how many devices are attached.

When I have a memory flash stick in the OTG cable the program shows 1. 
(correct) 

When I have a mouse in the OTG cable it shows 0. (why)

Interesting observation. When I connect the mouse to the OTG cable it works 
fine. I use it to click on the button to ask the usbManager how many 
devices are attached and the response is 0.

 When I attach a barcode reader to the OTG cable, the application goes 
through onDestroy() and then shows 0. (Why does this happen)

Basics of my program developed using Eclipse:

In onCreate() I have:

usbManager = (UsbManager)getSystemService(Context.USB_SERVICE);

 

In onClick() I have  (there is a button on the screen):

MapString, UsbDevice usbDeviceList = 
sbManager.getDeviceList();Toast.makeText(this, String.format(Number of devices 
= %d, usbDeviceList.size()), Toast.LENGTH_SHORT).show();

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
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 android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[android-developers] Re: Should SQLiteDatabases be limited to 2Gig?

2013-09-19 Thread Nobu Games
I just did some digging around and your error code translates into the 
following define constant: 
*SQLITE_IOERR_FSTAT*http://sqlite.org/c3ref/c_abort_rollback.html

So basically it's an fstat error which according to this 
threadhttp://sqlite.1065341.n5.nabble.com/reasons-for-SQLITE-IOERR-FSTAT-td66646.htmlcan
 happen when you try to access the database after it (or one of the 
journal files) have been deleted. 
Othershttp://t3391.codeinpro.us/q/51502007e8432c04261a3ca8also mention that 
this error has to do with changing data while another 
thread is trying to read it simultaneously. I guess the write-ahead 
journaling of SQLite does not mix well with thread concurrency. In my 
experience you should try to synchronize all concurrent read and write 
access to your SQLite database yourself and not rely on the built-in 
locking facilities (they never worked for me correctly).


On Wednesday, September 18, 2013 7:22:34 PM UTC-5, Nathan wrote:

 I am investigating the cause of some handled exceptions: 
 SQLiteDiskIOException disk I/O error (code 1802) 

 I ran across this thread which implies that, due to a bug in Android's 
 version of SQLite, I should be limiting SQlite Databases to 2GB. 


 https://groups.google.com/forum/#!searchin/android-developers/Sqlitediskioexception/android-developers/eYNJrIgabxU/e7sKm9QCfN4J

 I am already restricting users to 4GB because I believe most SD Cards 
 limit a single file to that size. 
 Of course some power users are going to bug me about allowing them more 
 for extFat. I have resisted because: 
 A. I don't know how to automatically detect that. 
 B. Users aren't sophisticated enough to know how their 

 But now, it looks like I will have to limit them to 2 GB. Is that true?

 And, in fact, it does appear that some users have seen data disappear and 
 reappear, and it could be tied to handled SQLiteDiskIOExceptions, and that 
 could be tied to this bug. 

 And does it differ by Android version?

 Nathan


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
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 android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [android-developers] Re: Should SQLiteDatabases be limited to 2Gig?

2013-09-19 Thread Nathan


On Thursday, September 19, 2013 11:48:46 AM UTC-7, mbanzon wrote:

 Sorry for turning the discussion in another direction but I have to 
 ask out of curiosity: What kind of data do you have in the database to 
 make it 2GB or above? 


Apology not accepted, but your deed will be forgiven if the discussion gets 
around to solving the problem. A bunch of tiled images such as for 
reconstructing a map of a national forest, etc.   

Please just skip telling me that I (or my customers) shouldn't be using 
that big of a database, that I should instead store it as loose files (that 
has its own ugly problems), or that all databases should be kept in app 
internal space (like a 2 gig file would fit there anyway). 

Nathan

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
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 android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[android-developers] Automatic Google+ sign-in

2013-09-19 Thread FReDD
Hi everyone,

sorry if this topic has been discussed before, I didn't find a definitive 
answer.
I am developing a game with Google Play Game capabilities (leaderboards  
achievements).
I implemented Google+ sign-in, following the tutorial and the provided code 
examples.

Everything is working fine, but the problem I am currently facing occurs in 
the following scenario,
at least on an Android 2.2 device :

   - I have two Google accounts, both of them are declared and syncing on 
   my device
   - I start my game, and a dialog (of my own) asks me whether I want to 
   use Google Play Game capabilities,
   and therefore if I want to sign in to Google+
   - I click 'Yes' and my code starts calling the Google+ sign-in API
   - Android Google+ API kicks in and asks me to choose one of my two 
   accounts to sign in

What I'd like for my future players is allow them to do this once, and 
never bother to sign in again (if they
allow it, of course). Is there a way to tell the Google+ API to use one 
account in particular and use it to
sign in automatically ?
I can understand that a completely silent sign-in can be a privacy concern, 
but is there a way to store
which account was used and use it later ?

Thanks

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
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 android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[android-developers] Re: Should SQLiteDatabases be limited to 2Gig?

2013-09-19 Thread Nathan


On Thursday, September 19, 2013 12:50:27 PM UTC-7, Nobu Games wrote:

 I just did some digging around and your error code translates into the 
 following define constant: 
 *SQLITE_IOERR_FSTAT*http://sqlite.org/c3ref/c_abort_rollback.html

 So basically it's an fstat error which according to this 
 threadhttp://sqlite.1065341.n5.nabble.com/reasons-for-SQLITE-IOERR-FSTAT-td66646.htmlcan
  happen when you try to access the database after it (or one of the 
 journal files) have been deleted. 
 Othershttp://t3391.codeinpro.us/q/51502007e8432c04261a3ca8also mention that 
 this error has to do with changing data while another 
 thread is trying to read it simultaneously. I guess the write-ahead 
 journaling of SQLite does not mix well with thread concurrency. In my 
 experience you should try to synchronize all concurrent read and write 
 access to your SQLite database yourself and not rely on the built-in 
 locking facilities (they never worked for me correctly).


Your eyes are sharp, I couldn't decode that one. 

I do think I will have to tighten up the concurrency, without knowing 
beforehand if it will help. 

At the time this occurs, nothing *should* be writing, but I already know of 
one bug that may make that untrue. Multiple threads could be reading. I 
think they just block but who knows.  
I am not using write ahead, which the docs tell me should be off by 
default. 

Nathan

 

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
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 android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [android-developers] Re: Should SQLiteDatabases be limited to 2Gig?

2013-09-19 Thread Nathan


On Thursday, September 19, 2013 12:38:19 PM UTC-7, Kostya Vasilyev wrote:

 I also get -- rare and very unpleasant -- support emails with this 
 error, also database disk image is malformed. 

 Sometimes it's one of the databases used internally by WebView (and 
 yet, a crash is a crash). 

 Then there are rare cases when the app's database just disappears. 

 The framework has code to detect corrupted databases and delete them. 
 Most likely it's this code that kicks in. I doubt it was added into 
 the framework just for my app. 

 SQLite is supposedly the best tested piece of software ever. However, 
 there was one case when its developer admitted on a mailing list that 
 a particular version, which happened to be included in a particular 
 Android release, could corrupt its in-memory buffer, albeit not disk 
 image (if my memory serves me). So nothing is perfect, all software 
 has bugs, yada yada yada... 

 I don't even have a theory on what the root cause is: other SQLite 
 bugs, Android's use of ext4, memory chips going bad... I just look at 
 it as a given. 


My experience matches yours in that some databases just disappear. I would 
like to look at the frameworks code for doing that if you know where I 
should look. 

The unusual part, as I've seen, is that people are seeing data disappear 
and sometimes reappear, within a database where other data may be intact. 
It can drive one insane, and I've been able to eliminate user error ( I 
think) in many cases. 

To sum up, I've got at least three issues. 

1. Databases disappear and I can't stop them. 
2. Some weird file thing could be preventing me from getting to the file 
(do devices unmount and mount their storage whenever they feel like it?) 
3. I could be seeing conflicts in threads. Shouldn't happen if they are all 
reader , but . .. 
4 (Maybe). Databases above 2 Gigabytes cause undefined behavior in SQLite. 

In the thread I cited, Diane Hackborn said (two years ago):
Yeah it's actually very likely the problem.  Android for various reasons 
defines off_t to be 32 bit, so if you want to support  2GB files you need 
to use off64_t.  That unfortunately makes it easy to have code paths that 
break like this.

https://groups.google.com/forum/#!searchin/android-developers/Sqlitediskioexception/android-developers/eYNJrIgabxU/e7sKm9QCfN4J

I don't know where in the framework to look for off_t and where it is used 
for SQLite files. Any pointers would help. 

I would really like to know for what versions of Android this is a problem, 
if at all. 

If this 2 gigabyte thing *isn't a problem*, then I want to hold off on 
telling my users that it is. Some already find 4 Gigabytes restrictive. 
Somebody just told me they are using 8 gigabytes safely on seven different 
devices and sharing them among a group of 200 people. Which means he got 
around my checks in the code to prevent from going over 4 gigabytes. Maybe 
he is just getting lucky, because if the 2 gig problem is real, it seems 
like it would fail rather often. 

Nathan

 

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
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 android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[android-developers] Camera preview slowing down on re-adding callback buffer in onPreviewFrame()

2013-09-19 Thread TimeManx
I'm trying to capture frames from a camera preview so that I can do some 
image processing on the frames in the background while the user sees the 
camera preview.
For that, I'm adding 60 buffers initially using addCallbackBuffer() in 
surfaceChanged() method of the SurfaceView and then on each 
onPreviewFrame() call, I'm re-adding the used buffer.
The problem is re-adding the buffer in onPreviewFrame() slows down the 
preview.
I'm also counting the number of calls to onPreviewFrame() every second. In 
the first second, I'm getting more than 70 calls to onPreviewFrame() which 
decreases to less than 25 in the second second and later.

Here is the code for the SurfaceView which 
implements SurfaceHolder.Callback and Camera.PreviewCallback
https://dpaste.de/ZvCdE/
and the FPSCounter class which is used in the above class
https://dpaste.de/as87Q/

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
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 android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [android-developers] Re: Should SQLiteDatabases be limited to 2Gig?

2013-09-19 Thread Nathan
I'm hoping I can get Jeff Brown to comment on this commit:

https://github.com/android/platform_external_sqlite/commit/af4ab8b27c84e71dcdd6edf9e05967a3f9c3e5f2

It looks like it might fix, er . ., something for Bionic, for everything 
but Bionic, or fix something that was only a problem on Bionic. 

Jeff Brown, are you on this forum?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
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 android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [android-developers] Re: Should SQLiteDatabases be limited to 2Gig?

2013-09-19 Thread Kostya Vasilyev

http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/2.1_r2/android/database/sqlite/SQLiteDatabase.java

Look for a method called onCorruption.




Nathan nathan.d.mel...@gmail.com 20 сентября 2013 г. 2:20:05 написал:



On Thursday, September 19, 2013 12:38:19 PM UTC-7, Kostya Vasilyev wrote:

 I also get -- rare and very unpleasant -- support emails with this error, 
also database disk image is malformed. 
 Sometimes it's one of the databases used internally by WebView (and yet, 
a crash is a crash). 

 Then there are rare cases when the app's database just disappears. 
 The framework has code to detect corrupted databases and delete them. 
Most likely it's this code that kicks in. I doubt it was added into the 
framework just for my app. 
 SQLite is supposedly the best tested piece of software ever. However, 
there was one case when its developer admitted on a mailing list that a 
particular version, which happened to be included in a particular Android 
release, could corrupt its in-memory buffer, albeit not disk image (if my 
memory serves me). So nothing is perfect, all software has bugs, yada yada 
yada... 
 I don't even have a theory on what the root cause is: other SQLite bugs, 
Android's use of ext4, memory chips going bad... I just look at it as a 
given. 


My experience matches yours in that some databases just disappear. I would 
like to look at the frameworks code for doing that if you know where I 
should look.
The unusual part, as I've seen, is that people are seeing data disappear 
and sometimes reappear, within a database where other data may be intact. 
It can drive one insane, and I've been able to eliminate user error ( I 
think) in many cases.

To sum up, I've got at least three issues.
1. Databases disappear and I can't stop them. 2. Some weird file thing 
could be preventing me from getting to the file (do devices unmount and 
mount their storage whenever they feel like it?) 3. I could be seeing 
conflicts in threads. Shouldn't happen if they are all reader , but . .. 4 
(Maybe). Databases above 2 Gigabytes cause undefined behavior in SQLite.

In the thread I cited, Diane Hackborn said (two years ago):
Yeah it's actually very likely the problem.  Android for various reasons 
defines off_t to be 32 bit, so if you want to support  2GB files you need 
to use off64_t.  That unfortunately makes it easy to have code paths that 
break like this.


https://groups.google.com/forum/#!searchin/android-developers/Sqlitediskioexception/android-developers/eYNJrIgabxU/e7sKm9QCfN4J

I don't know where in the framework to look for off_t and where it is used 
for SQLite files. Any pointers would help.
I would really like to know for what versions of Android this is a problem, 
if at all.
If this 2 gigabyte thing *isn't a problem*, then I want to hold off on 
telling my users that it is. Some already find 4 Gigabytes restrictive. 
Somebody just told me they are using 8 gigabytes safely on seven different 
devices and sharing them among a group of 200 people. Which means he got 
around my checks in the code to prevent from going over 4 gigabytes. Maybe 
he is just getting lucky, because if the 2 gig problem is real, it seems 
like it would fail rather often.

Nathan



--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 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 android-developers+unsubscr...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.


--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
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 android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [android-developers] Re: Should SQLiteDatabases be limited to 2Gig?

2013-09-19 Thread Nathan


On Thursday, September 19, 2013 4:31:23 PM UTC-7, Kostya Vasilyev wrote:

  
 http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/2.1_r2/android/database/sqlite/SQLiteDatabase.java

 Look for a method called onCorruption.


It looks like we could, in 4.0+, define a custom DatabaseErrorHandler that 
could do something different. 

I have not done so. 

Nathan
 

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
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 android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [android-developers] Re: Should SQLiteDatabases be limited to 2Gig?

2013-09-19 Thread Kostya Vasilyev
Yes, but if the database can't be opened at sqlite level, it would only 
help the app know that, not recover the data... And there are other ways to 
detect that. Back to square one: why do they get corrupted in the first place?



Nathan nathan.d.mel...@gmail.com 20 сентября 2013 г. 4:05:53 написал:



On Thursday, September 19, 2013 4:31:23 PM UTC-7, Kostya Vasilyev wrote:

 
http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/2.1_r2/android/database/sqlite/SQLiteDatabase.java


 Look for a method called onCorruption.


It looks like we could, in 4.0+, define a custom DatabaseErrorHandler that 
could do something different.

I have not done so.
Nathan


--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 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 android-developers+unsubscr...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.


--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
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 android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [android-developers] Automatic Google+ sign-in

2013-09-19 Thread Douglas Drumond
After the user signed in, unless they signed out, this should be automatic.
At least on my phone (4.3), when I signed in my app, I had to manually sign
out to test login with Google+ again because it already used the last
account to login the second time I launched the app. I have three accounts
on this device.


--
Douglas Drumond
*GDG Campinas http://www.gdg-campinas.org/
 –
**eee19.com* http://eee19.com/
*gplus.to/douglasdrumond

* – *@douglasdrumond https://twitter.com/douglasdrumond*



2013/9/19 FReDD altesse.fr...@gmail.com

 Hi everyone,

 sorry if this topic has been discussed before, I didn't find a definitive
 answer.
 I am developing a game with Google Play Game capabilities (leaderboards 
 achievements).
 I implemented Google+ sign-in, following the tutorial and the provided
 code examples.

 Everything is working fine, but the problem I am currently facing occurs
 in the following scenario,
 at least on an Android 2.2 device :

- I have two Google accounts, both of them are declared and syncing on
my device
- I start my game, and a dialog (of my own) asks me whether I want to
use Google Play Game capabilities,
and therefore if I want to sign in to Google+
- I click 'Yes' and my code starts calling the Google+ sign-in API
- Android Google+ API kicks in and asks me to choose one of my two
accounts to sign in

 What I'd like for my future players is allow them to do this once, and
 never bother to sign in again (if they
 allow it, of course). Is there a way to tell the Google+ API to use one
 account in particular and use it to
 sign in automatically ?
 I can understand that a completely silent sign-in can be a privacy
 concern, but is there a way to store
 which account was used and use it later ?

 Thanks

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en
 ---
 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 android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
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 android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[android-developers] adb forward tcp=38300 tcp=38300 error: cannot bind to socket

2013-09-19 Thread Tony Pitman
I have a tablet (Galaxy Note 10.1) and Windows 7. I have been doing dev 
just fine on it. I have executed this command:

adb forward tcp=38300 tcp=38300

many times and it has been working. I can't think of anything that has 
changed except that I have not worked on this for about a week.

Now all of a sudden I get: error: cannot bind to socket

I have tried rebooting, adb kill-server, there is nothing else running on 
that port that I can find. I do the adb forward --list and it shows nothing.

I can't figure this out. Can anyone please help? I am desperate. I need to 
get this working again to finish my project.

I have tried other ports with no luck. As I said this worked a week ago 
just fine and nothing has changed that I know of. The only thing is maybe 
the latest Microsoft patches did something?

Thanks...

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
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 android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [android-developers] adb forward tcp=38300 tcp=38300 error: cannot bind to socket

2013-09-19 Thread Tony Pitman
Duh, figured it out. It is supposed to be tcp: not tcp=. Sorry to be so
stupid. Too many projects in too many languages...


On Thu, Sep 19, 2013 at 9:44 PM, Tony Pitman t...@shatalmic.com wrote:

 I have a tablet (Galaxy Note 10.1) and Windows 7. I have been doing dev
 just fine on it. I have executed this command:

 adb forward tcp=38300 tcp=38300

 many times and it has been working. I can't think of anything that has
 changed except that I have not worked on this for about a week.

 Now all of a sudden I get: error: cannot bind to socket

 I have tried rebooting, adb kill-server, there is nothing else running on
 that port that I can find. I do the adb forward --list and it shows nothing.

 I can't figure this out. Can anyone please help? I am desperate. I need to
 get this working again to finish my project.

 I have tried other ports with no luck. As I said this worked a week ago
 just fine and nothing has changed that I know of. The only thing is maybe
 the latest Microsoft patches did something?

 Thanks...

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en
 ---
 You received this message because you are subscribed to a topic in the
 Google Groups Android Developers group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/android-developers/qJia_CTS6hk/unsubscribe
 .
 To unsubscribe from this group and all its topics, send an email to
 android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
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 android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.