Re: [android-developers] Is there any special method to write file on removable storage on android 4.4 and above

2015-12-10 Thread J Decker
do you have something like



in your androidmanifest.xml ?

http://developer.android.com/guide/topics/manifest/uses-permission-element.html
http://developer.android.com/reference/android/Manifest.permission.html

On Wed, Dec 9, 2015 at 10:43 PM, Dinesh Balu  wrote:
> Hi,
> I'm trying to write on removable storage , But getting IOException
>
> java.io.FileNotFoundException:
> /storage/extSdCard/PWC/Images/IMG_20151210_113150.jpg: open failed: EACCES
> (Permission denied)
> at libcore.io.IoBridge.open(IoBridge.java:409)
>
> Caused by: libcore.io.ErrnoException: open failed: EACCES (Permission
> denied)
> at libcore.io.Posix.open(Native Method)
> at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
> at libcore.io.IoBridge.open(IoBridge.java:393)
>
> The line I used to write is
>
> try{
>
> FileInputStream myinput = new FileInputStream(from);
>
> String outfilename = to;
>
> OutputStream myoutput = new FileOutputStream(outfilename);
> // transfer byte to inputfile to outputfile
> byte[] buffer = new byte[1024];
> int length;
> while ((length = myinput.read(buffer)) > 0) {
> myoutput.write(buffer, 0, length);
> }
>
> //Close the streams
> myoutput.flush();
> myoutput.close();
> myinput.close();
>
> return true;
> }
> catch ( IOException e){
> e.printStackTrace();
> return false;
> }
>
> from and to is a valid file location.
>
> If I use Internal and Emulated External file path , Above is working fine.
> If I use secondary or removable storage file path , getting issue.
>
> The path gives canWrite as true.
>
> Testing on Android 4.4.2 Samsung SM-G350E
>
> --
> 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.
> To post to this group, send email to android-developers@googlegroups.com.
> Visit this group at http://groups.google.com/group/android-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/android-developers/43d0467c-9c45-407c-a990-7941bfbd89a2%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/CAA2GJqUvYm0rFnWvPsbiHZBnBh0DcatgqfW1-a2UpMo6Z1bg%3DQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: 'org.apache.http.params.HttpParam' is deprecated

2015-12-10 Thread Hanis Hassan
Somebody please help me...
Until i'm still stuck at here... 
All java class are fine. BUT only this IRAQServerRequest.java have 
problems...





Above are the problem which the are the cross word...

What should I adjust with my gradle.app file??
Below are my gradle:-

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
useLibrary 'org.apache.http.legacy'

defaultConfig {
applicationId "com.example.hanishassan.iraqapplication"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 
'proguard-rules.pro'
}
}
}

dependencies {


compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'

compile group: 'org.apache.httpcomponents' , name: 'httpclient-android' , 
version: '4.3.5.1'

compile files('libs/httpmime-4.5.1.jar')
compile files('libs/httpclient-4.5.1.jar')
compile files('libs/httpclient-cache-4.5.1.jar')
compile files('libs/httpcore-4.4.3.jar')

}



The java coding for IRAQServerRequest.java as below :-


package com.example.hanishassan.iraqapplication;

import android.app.ProgressDialog;
import android.content.Context;
import android.os.AsyncTask;

import org.apache.http.client.HttpClient;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.params.BasicHttpParams;
import org.apache.http.params.HttpConnectionParams;
import org.apache.http.params.HttpParams;
import org.apache.http.util.EntityUtils;
import org.json.JSONObject;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;

import java.util.ArrayList;


public class IRAQServerRequest {

ProgressDialog progressDialog;
public static final int CONNECTION_TIMEOUT = 1000 * 15;
public static final String SERVER_ADDRESS = "http://hanishassan.net23.net;;

public IRAQServerRequest(Context context) {
progressDialog = new ProgressDialog(context);
progressDialog.setCancelable(false);
progressDialog.setTitle("Processing");
progressDialog.setMessage("Please wait...");
}

public void storeUserDataInBackground(IRAQUser user, IRAQGetUserCallback 
userCallback) {
progressDialog.show();
new StoreUserDataAsyncTask(user, userCallback).execute();
}

public void fetchUserDataInBackground(IRAQUser user, IRAQGetUserCallback 
callBack) {
progressDialog.show();
new fetchUserDataAsyncTask(user, callBack).execute();
}

public class StoreUserDataAsyncTask extends AsyncTask {
IRAQUser user;
IRAQGetUserCallback userCallback;

public StoreUserDataAsyncTask(IRAQUser user, IRAQGetUserCallback 
userCallback) {
this.user = user;
this.userCallback = userCallback;
}

@Override
protected Void doInBackground(Void... params) {
ArrayList dataToSend = new ArrayList<>();
dataToSend.add(new BasicNameValuePair("name", user.name));
dataToSend.add(new BasicNameValuePair("age", user.age + ""));
dataToSend.add(new BasicNameValuePair("username", user.username));
dataToSend.add(new BasicNameValuePair("password", user.password));

HttpParams httpRequestParams = new BasicHttpParams();
HttpConnectionParams.setConnectionTimeout(httpRequestParams, 
CONNECTION_TIMEOUT);
HttpConnectionParams.setSoTimeout(httpRequestParams, 
CONNECTION_TIMEOUT);

HttpClient client = new DefaultHttpClient(httpRequestParams);
HttpPost post = new HttpPost(SERVER_ADDRESS + "Register.php");

try {
post.setEntity(new UrlEncodedFormEntity(dataToSend));
client.execute(post);
} catch (Exception e) {
e.printStackTrace();
}

return null;
}

@Override
protected void onPostExecute(Void aVoid) {
progressDialog.dismiss();
userCallback.done(null);
super.onPostExecute(aVoid);
}
}

public class fetchUserDataAsyncTask extends AsyncTask 
{
IRAQUser user;
IRAQGetUserCallback userCallback;

public fetchUserDataAsyncTask(IRAQUser user, IRAQGetUserCallback 
userCallback) {
this.user = user;

[android-developers] Android Media Player mMediaPlayer.setDisplay(validHolder) in surfaceCreated() bug with Prepared MediaPlayer.

2015-12-10 Thread Jimmy Tran
Hi Android Developers,
I believe I have found a bug in the native implementation of the Android 
Media Player. My specific use case.
I am instantiating a MediaPlayer with new MediaPlayer(), the very first 
time in the onCreateView() of my VideoFragment. When I background the app, 
I destroy the fragment, but *SAVE the MEDIAPLAYER. *In* onCreateView(),* I 
have added all the appropriate callbacks for SurfaceCallbacks().

 In *surfaceCreated()*, I make sure to *mediaPlayer.setDisplay()*, as well 
on* surfaceChanged()*, making sure the surfaces are valid. When I 
background the app, I call *surfaceDestroyed(),* and I set the display to 
null. I know that is called and I have even logged it.

Also, when I background the app, i save an instance of the mediaPlayer. 
(This is to make sure I don't have to prepareAsync it anymore).

*Here is the trippy part:*
When I foreground the app, I reuse the media player. I make sure to add the 
appropriate callbacks and such again. When surfaceCreated() is called, and 
it does get called, I call* mMediaPlayer.setDisplay(holder)*. That doesn't 
actually set the display and make it visible. This will result in a *BLANK 
VIDEO SCREEN with AUDIO. This is super weird. *However, if I do 
*mMediaPlayer.setDisplay(null) 
and then mMediaPlayer.setDisplay(holder) the video shows up correctly*, and 
*THIS 
HAS TO HAPPEN ANYTIME AFTER surfaceCreated() is called otherwise *it 
doesn't work as intended and you still get a blank screen. 

@Override
public void surfaceCreated(SurfaceHolder holder) {

   if (mMediaPlayer != null) {

   mMediaPlayer.setDisplay(null);

   mMediaPlayer.setDisplay(holder);

   }

}


I believe this is a bug in the MediaPlayer native implementation. I'm not 
sure exactly what _setVideoSurface(surface) is doing since it is a NATIVE 
call.

public void setDisplay(SurfaceHolder sh) {
mSurfaceHolder = sh;
Surface surface;
if (sh != null) {
surface = sh.getSurface();
} else {
surface = null;
}
_setVideoSurface(surface);
updateSurfaceScreenOn();
}


However, I have reason to believe it is not behaving correctly because I 
would have to call mMediaPlayer.setDisplay(null) followed by 
mMediaPlayer.setDisplay(holder) for it to work correctly. This is only 
REPRODUCIBLE IF I keep an instance of the MediaPlayer that has ALREADY BEEN 
PREPARED, as in my specific use case. If I make a completely new media 
player, and go through the async prepare process again as usual and the 
usual callback, it wouldn't occur. The only problem with this is that it is 
wasting time I don't want to spend with buffering and preparing the 
mediaPlayer again...

There is also a possibility that I am doing something wrong, but I have 
looked into this extensively and it doesn't seem to be an error on my end. 
However, I am willing to try whatever people recommend to try and fix the 
problem. To be honest, that setDisplay(null) and then setDisplay(holder) is 
a complete workaround that I'm not satisfied with.

Thanks,
Your Junior Android Developer.



-- 
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.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/7d264526-6d1d-4e0a-b949-7a75e309b1e1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: Android Media Player mMediaPlayer.setDisplay(validHolder) in surfaceCreated() bug with Prepared MediaPlayer.

2015-12-10 Thread Jimmy Tran
Hi Android Developers,

*UPDATE, MORE TO DO WITH surfaceChanged() for some reason...*

I believe I have found a bug in the native implementation of the Android 
Media Player. My specific use case.
I am instantiating a MediaPlayer with new MediaPlayer(), the very first 
time in the onCreateView() of my VideoFragment. When I background the app, 
I destroy the fragment, but *SAVE the MEDIAPLAYER. *In* onCreateView(),* I 
have added all the appropriate callbacks for SurfaceCallbacks().

 In *surfaceCreated()*, I make sure to *mediaPlayer.setDisplay()*, as well 
on* surfaceChanged()*, making sure the surfaces are valid. When I 
background the app, I call *surfaceDestroyed(),* and I set the display to 
null. I know that is called and I have even logged it.

Also, when I background the app, i save an instance of the mediaPlayer. 
(This is to make sure I don't have to prepareAsync it anymore).

*Here is the trippy part:*
When I foreground the app, I reuse the media player. I make sure to add the 
appropriate callbacks and such again. When surfaceCreated() is called, and 
it does get called, I call* mMediaPlayer.setDisplay(holder)*. I do the same 
in *surfaceChanged(). *That doesn't actually set the display and make it 
visible. This will result in a *BLANK VIDEO SCREEN with AUDIO. This is 
super weird. *However, if I do *mMediaPlayer.setDisplay(null) and then 
mMediaPlayer.setDisplay(holder) the video shows up correctly*, and *THIS 
HAS TO HAPPEN ANYTIME AFTER surfaceCreated() is called otherwise *it 
doesn't work as intended and you still get a blank screen. This means, I 
have to do* mMediaPlayer.setDisplay(null)* in *surfaceChanged() *and then 
call* setDisplay(holder) *for the video to show up correctly.

@Override
public void surfaceChanged(SurfaceHolder holder, int width, int height) {

   if (mMediaPlayer != null) {

   mMediaPlayer.setDisplay(null);

   mMediaPlayer.setDisplay(holder);

   }

}


I believe this is a bug in the MediaPlayer native implementation. I'm not 
sure exactly what _setVideoSurface(surface) is doing since it is a NATIVE 
call.

public void setDisplay(SurfaceHolder sh) {
mSurfaceHolder = sh;
Surface surface;
if (sh != null) {
surface = sh.getSurface();
} else {
surface = null;
}
_setVideoSurface(surface);
updateSurfaceScreenOn();
}


However, I have reason to believe it is not behaving correctly because I 
would have to call mMediaPlayer.setDisplay(null) followed by 
mMediaPlayer.setDisplay(holder) for it to work correctly. This is only 
REPRODUCIBLE IF I keep an instance of the MediaPlayer that has ALREADY BEEN 
PREPARED, as in my specific use case. If I make a completely new media 
player, and go through the async prepare process again as usual and the 
usual callback, it wouldn't occur. The only problem with this is that it is 
wasting time I don't want to spend with buffering and preparing the 
mediaPlayer again...

There is also a possibility that I am doing something wrong, but I have 
looked into this extensively and it doesn't seem to be an error on my end. 
However, I am willing to try whatever people recommend to try and fix the 
problem. To be honest, that setDisplay(null) and then setDisplay(holder) is 
a complete workaround that I'm not satisfied with.

Thanks,
Your Junior Android Developer.

On Thursday, December 10, 2015 at 3:43:11 PM UTC-8, Jimmy Tran wrote:
>
> Hi Android Developers,
> I believe I have found a bug in the native implementation of the Android 
> Media Player. My specific use case.
> I am instantiating a MediaPlayer with new MediaPlayer(), the very first 
> time in the onCreateView() of my VideoFragment. When I background the app, 
> I destroy the fragment, but *SAVE the MEDIAPLAYER. *In* onCreateView(),* 
> I have added all the appropriate callbacks for SurfaceCallbacks().
>
>  In *surfaceCreated()*, I make sure to *mediaPlayer.setDisplay()*, as 
> well on* surfaceChanged()*, making sure the surfaces are valid. When I 
> background the app, I call *surfaceDestroyed(),* and I set the display to 
> null. I know that is called and I have even logged it.
>
> Also, when I background the app, i save an instance of the mediaPlayer. 
> (This is to make sure I don't have to prepareAsync it anymore).
>
> *Here is the trippy part:*
> When I foreground the app, I reuse the media player. I make sure to add 
> the appropriate callbacks and such again. When surfaceCreated() is called, 
> and it does get called, I call* mMediaPlayer.setDisplay(holder)*. That 
> doesn't actually set the display and make it visible. This will result in a 
> *BLANK 
> VIDEO SCREEN with AUDIO. This is super weird. *However, if I do 
> *mMediaPlayer.setDisplay(null) 
> and then mMediaPlayer.setDisplay(holder) the video shows up correctly*, 
> and *THIS HAS TO HAPPEN ANYTIME AFTER surfaceCreated() is 
> called otherwise *it doesn't work as intended and you still get a blank 
> screen. 
>
> @Override
> public void 

[android-developers] Measuring distance with IR laser sensor Nexus 6P and 5X

2015-12-10 Thread Bastiaan
Is there a possibility to measuring distance with the build in IR laser 
sensor? 

-- 
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.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/7c10d7dd-e0c4-40ec-87d4-206408bef9da%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] ANDRIOD SDK taking more Disk Space which is approximately 68 GB

2015-12-10 Thread Mohan Vajjha
Hi all,
Andriod SDK taking more Disk Space which is approximately 68 GB,for 
every machine iam downloading sdk  from web,can you please guide me to 
reduce the disk image.it will be more help full to me..

-- 
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.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/7de3675d-8876-42f2-b944-4559243ee127%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Open my application from Calendar

2015-12-10 Thread raveesh L


I'm trying to open my android application from calendar event using 
CUSTOM_APP_URI Here is the code i used for inserting the events into 
calendar

@Overrideprotected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

Calendar beginCal = Calendar.getInstance();
beginCal.set(2015, 11, 10, 4, 30);
long startTime = beginCal.getTimeInMillis();

Calendar endCal = Calendar.getInstance();
endCal.set(2015, 11, 10, 4, 30);
long endTime = endCal.getTimeInMillis();

ContentValues values = new ContentValues();
values.put(CalendarContract.Events.CALENDAR_ID, 1);
values.put(CalendarContract.Events.TITLE, "Check Demo Calendar4");
values.put(CalendarContract.Events.DTSTART, startTime);
values.put(CalendarContract.Events.DTEND, endTime);
values.put(CalendarContract.Events.EVENT_TIMEZONE, 
TimeZone.getDefault().getID());

values.put(CalendarContract.Events.CUSTOM_APP_PACKAGE, getPackageName());
values.put(CalendarContract.Events.CUSTOM_APP_URI, "calendar://1");

getContentResolver().insert(CalendarContract.Events.CONTENT_URI, values);
}

Problem is even after inserting the event, calendar doesn't show the URI in 
my calendar event page. What is wrong inserting the event with 
CUSTOM_APP_URI? Any help?

-- 
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.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/d1539e05-611a-4a60-b2f1-ed271217c3b9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Off heap memory management

2015-12-10 Thread Soumitra Kumar
Fellow Developers,

I am experimenting with off-heap memory management in Java. The results are 
promising in Android as well.

I am using FileChannel.map to memory map large segments of file and manage 
allocation/deallocation in that buffer to create collections. It can handle 
a list of 100M integers, which may not be possible or pretty expensive 
using Java heap.

I am wondering if others have tried it, and if you would like to share your 
experience? Moreover, if anyone is struggling to fit their data structures 
in heap, would like to hear that as well to continue, and contribute in 
that effort.

Thanks in advance.
-Soumitra.

-- 
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.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/fad4c6ef-245c-4780-ba4a-ec6d83b02f97%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Notification behaviors in watch chaged after Wear 1.4

2015-12-10 Thread atcle kim
In Wear 1.3.x(before November?), All notifications(which have no 
LOCAL_ONLY|ON_GOING...flags) in smartphone is sended to smartwatch 
immediately.

But I guess, after wear 1.4, only some notifications(maybe vib 
notificaiton) are sended to watch immediately, and
the others are sended in piggiback fashion when vib notification or 
notification remove or any watch apps synchronization happend.

Is it right? or only my problems?
It's seem very important changes but I can't find the details.

I'm using a LG Watch Urbane, Nexus 5.1
and tested on Wear 1.3.0.2369832(10/28), 1.4.0.2392391(11/07), 
1.4.0.2462440.(12/04) in same environments.

Thank you.

-- 
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.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/5d4febdf-cfea-49f1-a2ef-e9eb8bfe7076%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: How to make you Android app run on Android 3.0 and bellow?

2015-12-10 Thread gc
You'll also need an emulator that you can test on unless you have a device 
with those versions.
If you need an emulator for anything before 3.0 I recommend Genymotion.

On Tuesday, December 8, 2015 at 2:16:51 AM UTC-6, Đức Nguyễn Huỳnh wrote:
>
> [Android Question] Hi everyone. Our app currently not working on Android 
> 3.0 and bellow. It just crash before everything. Anyone have experience on 
> this? Many Thanks.
> Our app only request picture and video from server and load:
> https://goo.gl/fN1IbE
>

-- 
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.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/e20975fc-03b8-4527-9e37-7b4ce8c08902%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: ZipInputStream getNextEntry does not return file header info

2015-12-10 Thread Simon Giddings
Shame I didn't get any answers here.

Here is my solution, which might not be the best but is good for me.
Use the class ZipFile to open and read the zip contents.
Inspired from here ZipInputStream: getting file size of -1 when reading 


Le samedi 5 décembre 2015 18:16:28 UTC+1, Simon Giddings a écrit :
>
> This would appear to be a bug.
>
> I create a zip file using ZipOutputStream with success.
> I can then transfer it from the tablet to my PC and look at it with WinZip.
> All files have the corresponding size, compressed size, and CRC values.
>
> Now, if I open the zip with ZipInputStream and call getNextEntry, these 
> values are not set.
> Here is how I am reading the file :
>
> try
> {
> // open the archive
> FileInputStream fis = new FileInputStream(fArchive);
> ZipInputStream zis = new ZipInputStream(new BufferedInputStream(fis));
> bBuffer = new byte[2048];
>
> // iterate through all files, putting them back into the same place
> ze = zis.getNextEntry();
> while(ze != null)
> {
> strFileName = ze.getName();
> strFileName = FILE_PATH + "/" + strFileName;
> fCheck = new File(strFileName);
> lZipFileSize = ze.getSize(); // <--- returns -1 systematically
> lTargetFileSize = fCheck.length();
> fCheck = null;
> FileOutputStream fos = new FileOutputStream(strFileName);
>
> // read the data
> while((iCount = zis.read(bBuffer)) != -1)
> {
> fos.write(bBuffer, 0, iCount);
> }
> fos.close();
>
> ze = zis.getNextEntry();
> }
> zis.close();
> fis.close();
> bOk = true;
> }
> catch(Exception e)
> {
> e.printStackTrace();
> }
>
>
> When I look into the source for ZipInputStream, I see the following code :
> if (!hasDD) {
> ceCrc = ((long) Memory.peekInt(hdrBuf, LOCCRC - LOCVER, ByteOrder.
> LITTLE_ENDIAN)) & 0xL;
> ceCompressedSize = ((long) Memory.peekInt(hdrBuf, LOCSIZ - LOCVER, 
> ByteOrder.LITTLE_ENDIAN)) & 0xL;
> ceSize = ((long) Memory.peekInt(hdrBuf, LOCLEN - LOCVER, ByteOrder.
> LITTLE_ENDIAN)) & 0xL;
> }
>
> This is the only position that I can see where the values are retrieved, 
> yet it is ignored because of the !hasDD condition.
>
> Have I misunderstood something here ?
> Is this a real bug or is there an extra step to be taken ?
>

-- 
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.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/5ba7c710-99ae-4b6f-9c55-947870c3ccbc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: SdkController app

2015-12-10 Thread colin
Hi.

Wow.  I'm surprised to see this topic revived after so long!

I can't offer very much help; I haven't looked at this since the time of my 
original post.  In fact I haven't really done much Android work at all.  
Given the pace of change in the Android world, I'm surprised this tool is 
still available in its original form.

It's interesting to learn that you had the same issue as me but on a Mac; 
 makes me wonder what was actually being shown at Google I/O.

I'm struggling to remember exactly what I found once I got over the initial 
connectivity hurdle.  I was mainly interested in sensor emulation, and I 
think one of the disappointing things I found was that not all sensor 
events were included.

Regarding the multitouch and display aspects, I think I may have had 
similar problems to you, but my memory is very hazy.  Possibly the issue is 
a mismatch between the portrait/landscape orientations of the phone and the 
emulator.  You could try disabling auto-rotate on your phone (and maybe you 
also need to make sure that the resolution and default orientation of the 
emulator matches that of your phone).

Sorry I can't be more helpful.  Please do report back if you make any 
progress.


On Wednesday, December 9, 2015 at 10:11:35 PM UTC, Vel Asta wrote:

> Hello Colin, an update. The debug output I get from the emulator when 
> running your approach to the SDK (I see the emulator on my connected 
> Samsung device and the multi-touch goes through as I can see in the debug 
> in the correct coordinates. 
>
> ---> Below I clicked the Menu button and then the top right, top left, 
> bottom left, bottom right and then two fingers in the middle to get the 
> output below.
> ---> seems to be going through very nicely but on the screen it shows at 
> different parts. I can click on the top Google search and that works. Seems 
> there is an error with RESOLUTION like as if the EMULATOR reads correctly 
> but INPUTS the coordinates wrong. 
>
> PS: using a Mac but same results on a Windows 8,9 or 10. 
>
> ::
>
> $ ./emulator -avd ta1 -debug sensors_port,mtport,sdkctlsocket -screen 
> multi-touch
>
>
> Pavels-MacBook-Pro:tools Pavel$ ./emulator -avd ta1 -debug 
> sensors_port,mtport,sdkctlsocket -screen multi-touch
>
> HAXM is working and emulator runs in fast virt mode
>
> emulator: emulator window was out of view and was recentered
>
>
> emulator: UpdateChecker: skipped version check
>
> emulator: SDKCtl sensors: Socket is connected.
>
> emulator: SDKCtl sensors: Sending endianness: 0
>
> emulator: SDKCtl multi-touch: Socket is connected.
>
> emulator: SDKCtl multi-touch: Sending endianness: 0
>
> emulator: SDKCtl sensors: Sending handshake query...
>
> emulator: SDKCtl multi-touch: Sending handshake query...
>
> emulator: SDKCtl multi-touch: Handshake succeeded. Port is connected
>
> emulator: Multi-touch: Handshake succeeded with connected port.
>
> emulator: Multi-touch: SDK Controller is connected
>
> emulator: Multi-touch: SDK Controller port is enabled.
>
> emulator: SDKCtl sensors: Handshake succeeded. Port is connected
>
> emulator: Sensors: SDK Controller has succeeded handshake, and port is 
> connected.
>
> emulator: Sensors: SDK Controller is connected.
>
> emulator: Sensors: Emulation has been started.
>
> emulator: Sensors: SDK Controller is enabled.
>
> emulator: Sensors: Sensor list received with 10 sensors.
>
> emulator: Sensors: Sensor 'light' is not support by emulator
>
> emulator: Sensors: Emulated sensor 'proximity': Device id = 8, Emulator id 
> = 4
>
> emulator: Sensors: Sensor 'pressure' is not support by emulator
>
> emulator: Sensors: Sensor 'gyroscope' is not support by emulator
>
> emulator: Sensors: Emulated sensor 'acceleration': Device id = 1, Emulator 
> id = 0
>
> emulator: Sensors: Emulated sensor 'magnetic-field': Device id = 2, 
> Emulator id = 1
>
> emulator: Sensors: Emulated sensor 'orientation': Device id = 3, Emulator 
> id = 2
>
> emulator: Sensors: Sensor 'rotation' is not support by emulator
>
> emulator: Sensors: Sensor 'linear-acceleration' is not support by emulator
>
> emulator: Sensors: Sensor 'gravity' is not support by emulator
>
> emulator: Sensors: Emulating 4 sensors
>
> emulator: Sensors: Sensor 'proximity' is enabled on SDK controller.
>
> emulator: Sensors: Sensor 'acceleration' is enabled on SDK controller.
>
> emulator: Sensors: Sensor 'magnetic-field' is enabled on SDK controller.
>
> emulator: Sensors: Sensor 'orientation' is enabled on SDK controller.
>
> emulator: Sensors: Emulation has been started.
>
> emulator: Multi-touch: compressing 16320 bytes frame buffer
>
> emulator: Multi-touch: Sent 1446 bytes in framebuffer update. Compression 
> rate is 8.62%
>
> emulator: Framebuffer update ACK.
>
> emulator: Framebuffer update handled.
>
> emulator: Multi-touch: compressing 4608 bytes frame buffer
>
> emulator: Multi-touch: Sent 854 bytes in framebuffer update. Compression 
> rate is 17.66%
>
> emulator: Framebuffer update ACK.
>
> emulator: 

[android-developers] Re: Notification behaviors in watch chaged after Wear 1.4

2015-12-10 Thread atcle
I test some notifications and I supposed that wear's policy has been 
changed.

Wear 1.3.X
notification w/o vib   immediately, dim screen
vib{0,0}   immediately, dim screen
vib{0,1}   immediately, screen on, vib

Wear 1.4.X
notification w/o vib   piggyback
vib{0,0}   immediately, dim screen
vib{0,1}   immediately, screen on, vib

you can test any notification test app.
(https://play.google.com/store/apps/details?id=com.sloy.jbnotif
http://www.apkmirror.com/apk/google-inc/android-wear/
'adb install -r -d wear.xxx.apk' make no need to new paring with watch or 
factory reset)

If you make any notifications without vib., it may not notified to watch on 
time after Wear 1.4.

On Friday, December 11, 2015 at 11:52:17 AM UTC+9, atcle wrote:
>
> In Wear 1.3.x(before November?), All notifications(which have no 
> LOCAL_ONLY|ON_GOING...flags) in smartphone is sended to smartwatch 
> immediately.
>
> But I guess, after wear 1.4, only some notifications(maybe vib 
> notificaiton) are sended to watch immediately, and
> the others are sended in piggiback fashion when vib notification or 
> notification remove or any watch apps synchronization happend.
>
> Is it right? or only my problems?
> It's seem very important changes but I can't find the details.
>
> I'm using a LG Watch Urbane, Nexus 5.1
> and tested on Wear 1.3.0.2369832(10/28), 1.4.0.2392391(11/07), 
> 1.4.0.2462440.(12/04) in same environments.
>
> Thank you.
>

-- 
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.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/35a7fef5-8632-44bc-9129-4b924edc900c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Animations

2015-12-10 Thread Mabedi Motimedi
Hi everyone,
can anyone help me with how to make power point like effects on my android 
application..how to i go about doing it...
what libs to use
e.g ,making text slide in out etc
thank you

-- 
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.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/20b83382-bbf3-4964-819d-1a79d77f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] adb wireless usage for multiple devices and single MAC

2015-12-10 Thread 80Vikram
Hi All,

With steps mentioned in 
http://developer.android.com/tools/help/adb.html#wireless , I could connect 
to single android device over wi-fi.

I am trying to run automation scripts on multiple devices ( selenium grid 
setup ) and need to connect multiple devices ( without USB ).

But with above steps it's not possible.

Kindly clarify how to connect to multiple devices over wi-fi

Thanks in advance.

Regards,
Vikram

-- 
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.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/09bb20db-5122-4846-8c51-8fe2b6d567b2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Dynamic menu in Navigation View

2015-12-10 Thread Hector Navarro
It's possible  add a notification counter to MenuItem on NavigationView (as 
gmail)? I'm developing a dynamic menu and I tried to do that 
programatically via MenuItemCompat.setActionView(), but it doesn't work:

private void cargarAvisosMenu() { 
  // Menu final 
  Menu menu = this.mNavigationView.getMenu(); 
  // Carga de datos 
  CentroSelection selection = new CentroSelection(); 
  CentroCursor cur = 
selection.query(getApplicationContext().getContentResolver()); 
  // Recorro el cursor de centros 
  while (cur.moveToNext()) { 
boolean avisosTipoA = false; 
boolean avisosTipoB = false; 
Centro c = Centro.getFromCursor(cur); 
if (c.getIsTipoAVisible() && 
c.getComponenteTipoA().getControlesTipoAPendientes() > 0) {
  avisosTipoA = true; 
} 
if (c.getIsTipoBVisible() && 
c.getComponenteTipoB().getControlesTipoBPendientes() > 0){
  avisosTipoB = true; 
} 
if (avisosTipoA || avisosTipoB) { 
  // Añado la sección y los items. 
  final SubMenu subMenu = menu.addSubMenu(c.getNombre()); 
  if (avisosTipoA) { 
subMenu.add("TipoA").setIcon(R.drawable.ic_tipoA); 
  } 
  if (avisosTipoB) { 
// subMenu.add("TipoB").setIcon(R.drawable.ic_tipoB); 
int itemId = subMenu.add("TipoB").getItemId(); 
View menuItem = MenuItemCompat.setActionView(subMenu.findItem(itemId), 
R.layout.menu_notificaciones).getActionView(); 
((ImageView) 
menuItem.findViewById(R.id.ivMenuNotificaciones)).setBackground(getDrawable(R.drawable.ic_barcode));
 
((TextView) 
menuItem.findViewById(R.id.tvMenuNotificaciones)).setText("TipoB"); 
((TextView) 
menuItem.findViewById(R.id.tvContadorNotificaciones)).setText("100"); 
  } 
} 
  } 
}




-- 
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.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/081212f6-0e4c-4303-9286-76307ee25f11%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.