[android-developers] Digest for android-developers@googlegroups.com - 4 Messages in 3 Topics

Comments: (0)

Group: http://groups.google.com/group/android-developers/topics

    lselwd <webmaster@poliscarhire.com> Feb 28 05:27AM -0800  

    DO NOT KNOW IF CORRECT FORUM, BUT IF WRONG TELL WHERE TO POST.
     
    In PLAY OR chrome web apps consoles, how secondary users work if give the
    access.
    if give to a user, admin privilege to post Apps, in my account in Play, how
    he will access my account in Play to post his App under my name?

     

    lselwd <webmaster@poliscarhire.com> Feb 28 05:28AM -0800  

    Please note i know to create users... but how these users access my account?
     
    On Friday, February 28, 2014 3:27:19 PM UTC+2, lselwd wrote:

     

    Amit Siddhpura <siddhpuraamitr@gmail.com> Feb 28 02:37AM -0800  

    **If i share image one time in gmail and again come back and do some
    changes and again if i share then only previous image was displaying :(
    that was the issue with 4.1.1 when i run same problem in 4.2.2 it works
    perfectly :( :( :(**
     
    Hi i what to share image using Intent for that i have used below code
     
     
    public void otherBtn(View v) {
    FileOutputStream out = null;
    try {
    if (bitmap != null) {
    bitmap.recycle();
    bitmap = null;
    }
    Intent sharingIntent = new Intent(Intent.ACTION_SEND);
    File sdcard = Environment.getExternalStorageDirectory();
    File f = new File(sdcard, "temp.jpg");
    if (f.isFile()) {
    f.delete();
    }
    out = new FileOutputStream(f);
    captureRelativeLayout.setDrawingCacheEnabled(true);
    bitmap = captureRelativeLayout.getDrawingCache(true).copy(
    Config.ARGB_8888, false);
    bitmap.compress(Bitmap.CompressFormat.JPEG, 90, out);
     
    sharingIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(f)); // imageUri
    sharingIntent.setType("image/jpg");
    startActivity(sharingIntent);
    } catch (Exception e) {
    e.printStackTrace();
    } finally {
    if (out != null) {
    try {
    out.flush();
    out.close();
    } catch (Exception e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    }
     
    }
    }
    }
     
     
     
    for example when i share below image with above code
     
    <https://lh4.googleusercontent.com/-3A1l0CJnE5Y/UxBl4tEBFWI/AAAAAAAALYk/yOX8h4O3tH0/s1600/Qwydv%5B1%5D.png>

     
     
    the image which i have previously shared will shown but not above updated
    image is showing :(
     
    <http://i.stack.imgur.com/3dM89.png>
     
     
     
     
    ![enter image description here][2]

     

    sushant sharma <sushantsha@gmail.com> Feb 28 01:42AM -0800  

    What Vladimir suggests, should work for you.
     
    On Wednesday, February 26, 2014 3:37:03 PM UTC+5:30, nish1013 wrote:

     

--
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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

[android-developers] Digest for android-developers@googlegroups.com - 9 Messages in 6 Topics

Comments: (0)

Group: http://groups.google.com/group/android-developers/topics

    Rahul Kaushik <rahulkaushik85@gmail.com> Feb 27 12:02PM +0530  

    Hello ,
     
    I have created my own directory and i want cope the file from sd card to my
    dir
    please suggest
     
    Thanks
    RK

     

    TreKing <trekingapp@gmail.com> Feb 27 04:58PM -0600  


    > I have created my own directory and i want cope the file from sd card to
    > my dir
    > please suggest
     
    I would suggest you read the docs that refer to accessing external storage
    and general file I/O.
     
    -------------------------------------------------------------------------------------------------
    TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
    transit tracking app for Android-powered devices

     

    Rahul Kaushik <rahulkaushik85@gmail.com> Feb 27 11:36PM +0530  

    Hi
     
    How can i remove the viewgroup from framelayout(Code)
     
    Thanks
    Rk

     

    Rahul Kaushik <rahulkaushik85@gmail.com> Feb 27 09:44PM +0530  

    i have a tablelayout which is created dynamically i added a table row in it
    dynamically,now i added 5 check box in table row,all the checkbox are
    showing up but they are coming horizontally in table row but i want to show
    them vertically.
     
    please suggest
     
    Thanks
    RK

     

    dashman <erjdriver@gmail.com> Feb 27 08:17AM -0800  

    I'm writing an app that enables and disables the lockscreen.
     
    Sometimes the lockscreen is on the screen - my app running
    in the background disables it (actually sets the password length to zero).
     
    Now the user enters their full password and it's no longer the valid - it's
    blank.
     
    Any way t o avoid this.
     
    What's the preferred way to disable lockscreen - w/o setting the pin length
    to 0
     
    Any way to detect wx the lockscreen is currently up and visible.

     

    mastermind <denis.barkar@gmail.com> Feb 27 12:11AM -0800  

    When I open mounted directory (using opendir() function), I see only two
    files: "." and "..". Looks like itsn't mounted but other proccesses see
    files! How this could be???
     
    вторник, 25 февраля 2014 г., 19:21:05 UTC+4 пользователь mastermind написал:

     

    Nikolay Elenkov <nikolay.elenkov@gmail.com> Feb 27 05:28PM +0900  

    > When I open mounted directory (using opendir() function), I see only two
    > files: "." and "..". Looks like itsn't mounted but other proccesses see
    > files! How this could be???
     
    Linux (and Android) supports per-process namespaces. Execute
     
    cat /proc/<PID>/mounts
     
    where <PID> is your app's PID to check what is sees.
     
    Also do not use /storage/emaulted as mount point, it has a rather
    weird behaviour in recent Android versions in order to support
    isolated shared storage for multiple users, emulation and what not.
    If you have root access, create a mount point under /data and use that.

     

    mastermind <denis.barkar@gmail.com> Feb 27 02:33AM -0800  

    The cause of the problem was in multi-user storage implementation. By the
    way not only storage isolated but the whole root filesystem. You can read
    discussion here: http://forum.xda-developers.com/showthread.php?t=2106480

     

    nyiswan htet <nyiswanhtet@gmail.com> Feb 26 10:14PM -0800  

    Thank for that.

     

--
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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

[android-developers] Digest for android-developers@googlegroups.com - 10 Messages in 6 Topics

Comments: (0)

Group: http://groups.google.com/group/android-developers/topics

    Pradeep Phatak <pradeep.phatak@gmail.com> Feb 26 04:40PM -0800  

    Finally, programatically setting EAP-TLS is working for me.
    The last error was resolved after I added set phase2auth to none.
    I believe it was caused by call to getKeyIdForCredentials in
    WifiConfigStore.java.

     
    On Tuesday, February 25, 2014 8:18:46 PM UTC-8, Pradeep Phatak wrote:
     

     

    Yves Liu <yvesliu@gmail.com> Feb 26 12:16AM -0800  

    Yes, this is very inconvenient. Does google want to kill all the third
    party developers?
     
     

     

    Jonathan S <xfsunoles@gmail.com> Feb 26 11:31AM -0800  

    Users should have to backup data first.
     
    On Tuesday, February 25, 2014 3:21:14 PM UTC-5, Nathan wrote:

     

    Nathan <nathan.d.mellor@gmail.com> Feb 26 02:34PM -0800  

    On Wednesday, February 26, 2014 11:31:21 AM UTC-8, Jonathan S wrote:
     
    > Users should have to backup data first.
     
    I don't know that we have a way of forcing customers to backup data first.
    And if the data takes up a majority of space on the external card, I don't
    know what they would backup to.
     
    I expect they will find out after the fact.
     
    Nathan

     

    Rashmi <rashmi.ttr@gmail.com> Feb 26 03:52AM -0800  

    Hi,
     
    I am binding from service1 in app1 to service2 in app2 through aidl. In
    service2 to I have defined the aidl stub api's which has some handler.
    If I tried to access the service2 api through binder from service1, I am
    getting the following exception
     
    "java.lang.RuntimeException: Can't create handler inside thread that has
    not called Looper.prepare()"
     
    I am not creating any thread explicitly. Please let me know from where I
    can call Looper.prepare().
     
    Thank you,

     

    nish1013 <nishand2d@gmail.com> Feb 26 02:07AM -0800  

    I got a similar problem when building with maven. I have got an apklib that
    contain xml(s) that refers to drawables in src. But when build a project
    that has got this apklib as a dependency same error.
     
    On Wednesday, 6 January 2010 08:37:46 UTC, Vladimir wrote:

     

    mastermind <denis.barkar@gmail.com> Feb 26 12:10AM -0800  

    Thanks for the answer!
    Folder mounted outside of the app from adb shell.
    I just can't understand why some apps can't access it (ES File Explorer
    with root priveleges) and some can (Total Commander, even adb without root
    priveleges).
    May be it can be accessed only under root UID and adb is an exception?
    How can I set options appropriate?
    How can I enable root priveleges for my app so it can access the folder?

     

    Nikolay Elenkov <nikolay.elenkov@gmail.com> Feb 26 05:14PM +0900  

    Please reply to list.
     
    > May be it can be accessed only under root UID and adb is an exception?
    > How can I set options appropriate?
    > How can I enable root priveleges for my app so it can access the folder?
     
     
    It all depends on the permissions of those files, check those first.
    Root can generally access anything, regardless of permissions.
    For everyone else, it depends on the owner, group and permissions
    of the target file(s).

     

    mastermind <denis.barkar@gmail.com> Feb 26 12:35AM -0800  

    Permission of the file is "drwxr-xr-x", so everybody should access it.
    Owner and group is system.

     

    Yves Liu <yvesliu@gmail.com> Feb 26 12:15AM -0800  

    Yes, I did. The problem is like this. In my gallery, say, there are 6
    pictures, when i do the file.exist call, (with the path I got from
    Gallery), two works, and 4 of them are not working.
     
     

     

--
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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

[android-developers] Digest for android-developers@googlegroups.com - 12 Messages in 8 Topics

Comments: (0)

Group: http://groups.google.com/group/android-developers/topics

    Rahul Kaushik <rahulkaushik85@gmail.com> Feb 26 11:13AM +0530  

    Hello,
    I call some method A() onCreate then i pressed the home button then i
    resume to my app Method A() is called again which create data duplicacy
    how can i avoid calling that method A() to avoid data duplicacy ?
     
    I tried calling that method onRresume but stiil have the data duplicacy.
     
     
    Please suggest
     
    TX
    RK

     

    Pradeep Phatak <pradeep.phatak@gmail.com> Feb 25 08:18AM -0800  

    The alias is provided when we use the Keychain createInstallIntent API to
    store the p12 in the Android KeyStore.
    As you correctly noted in your earlier post, we can't retrieve the Private
    Key in that case.
    The only other method I found to load a p12 certificate in Keystore was the
    load method. But, it doesn't take any alias as parameter.
    How do I pass the alias while loading the certificate in the keystore?
     
    On Monday, February 24, 2014 7:53:29 PM UTC-8, Nikolay Elenkov wrote:

     

    Nikolay Elenkov <nikolay.elenkov@gmail.com> Feb 26 01:31AM +0900  

    On Wed, Feb 26, 2014 at 1:18 AM, Pradeep Phatak
    > The only other method I found to load a p12 certificate in Keystore was the
    > load method. But, it doesn't take any alias as parameter.
    > How do I pass the alias while loading the certificate in the keystore?
     
    Do read the JavaDoc of the KeyStore class before proceeding:
     
    https://developer.android.com/reference/java/security/KeyStore.html

     

    Pradeep Phatak <pradeep.phatak@gmail.com> Feb 25 08:18PM -0800  

    setClientKeyEntry API worked after I retrieved X509Certificate and
    PrivateKey from the KeyStore. The cert and key looked okay in the
    WifiConfiguration.

    Adding wifi network failed with the error below-
    E/WifiConfigStore(764): "8021x-wpa2-ssid" invalid config for key
    installation
    E/WifiConfigStore(764): Failed to set a network variable, removed network:
    12
     
    On Tuesday, February 25, 2014 8:31:17 AM UTC-8, Nikolay Elenkov wrote:
     

     

    mastermind <denis.barkar@gmail.com> Feb 25 07:21AM -0800  

    I've just mounted samba share to my Nexus 7 (CM 11) under root using kernel
    module.
     
    Everything seems ok for applications (ES File Manager, Total Commander
    etc), I see files and can read them, even "cat" command from shell works.
    But I'm unable to read them from my app! Neither with native calls (open
    sets errno to ENOENT) nor FileInputStream.
     
    I tried many names:
     
    /storage/emulated/0/mounted_folder/file.txt/storage/emulated/legacy/mounted_folder/file.txt/sdcard/mounted_folder/file.txt/mnt/shell/emulated/0/mounted_folder/file.txt
     
    with root privelegies, with read-write permissions and many other
    variations, still no luck :(
     
    What am I missing?

     

    Nikolay Elenkov <nikolay.elenkov@gmail.com> Feb 26 11:01AM +0900  

    > I see files and can read them, even "cat" command from shell works. But I'm
    > unable to read them from my app! Neither with native calls (open sets errno
    > to ENOENT) nor FileInputStream.
     
    ...
     
    > with root privelegies, with read-write permissions and many other
    > variations, still no luck :(
     
    > What am I missing?
     
    You are probably not executing a proper root shell from your app.
    Note that you cannot change the UID of your app, so either pass
    it as a mount option, or set other options appropriately.
     
    Cf. the usernamej, gid,file_mode,dir_mode options.

     

    Yves Liu <yvesliu@gmail.com> Feb 24 11:26PM -0800  

    Yes, I actually not hardcode the path. The app queries the content provider
    to get the picture path, which is different from the path I get
    from getExternalStorageDirectory(). Is there a better way for me to know if
    the picture is in internal build-in sd card or external removable sd card?
    Is there an API call to get the path for external removable sd card?
     
    Sorry, this happens on Nexus 5, kitkat.
     
    Thanks
     
     
     
     
     

     

    Nick <ympe4ko@gmail.com> Feb 25 03:44AM -0800  

    I'm writing an android web application using built in webkit engine. I have
    html files in the application local dir (wanted to put them in assets but
    we have a requirement to update them over http so I need to replace assets
    in runtime what is impossible). The application should work over SSL with
    one requirement: it should check CN for each request. I've implemented it
    the following way:
     
    1. I wrote MySSLSocketFactory that uses custom trust manager. In that
    trust manager I delegate call to default one and check CN.
    2. Then I wrote java-javascript bridge and transfer all ajax calls to
    android service.
    3. When call is done the service sends broadcast intent and I parse its
    data in the receiver(in main activity that contains a webview) and call a
    global js function with request id.
     
    It works....but... I forgot about a lot of js features like closure,
    anonimous functions etc. Is there any other way? Maybe it's possible to
    force webkit to use MyHttpClient instead of default one?
     
    Any ideas?

     

    Yathushan <yatmaster@gmail.com> Feb 25 02:58AM -0800  

    Sorry about that. The problem was that I was unable to call my getcard()
    method into my main activity and then parse the object data into a multiple
    text view.
    Thank you for reply. I have worked out how to call the data into my
    multiple textview without the need for an arrayadapter.
     
    On Thursday, 20 February 2014 23:29:24 UTC, TreKing wrote:

     

    gjs <garyjamessilva@gmail.com> Feb 24 11:57PM -0800  

    Hi,
     
    The only other way I'm aware of is just mirroring the tablet screen to the
    HDMI device using a HDMI cable connection, but that does not satisfy your
    requirement of different content on the two screens & it also means the
    tablet is tethered with the (short) HDMI cable.
     
    It would be great if we could just somehow simply create an secondary
    'external HDMI activity or widget' & display context as we would any other
    activity (but with no user interaction, you'd be using the main tablet
    activity to control the HDMI content etc) but that's not yet possible as
    far as I am aware - someone please tell me otherwise. It would also be good
    to be able to do this without the 'register your app' requirements of
    Chromecast & also relegate the necessary configuration details to an
    Android Settings screen - controlled by the user outside of your
    application.
     
    The Chromecast method seems to be a good (but somewhat complicated) way to
    go as you don't need to be tethered by a cable between the tablet & HDMI,
    the comms is via WIFI & you don't necessarily need to write any code on the
    Chromcast side if you can use the default receiver -
    https://developers.google.com/cast/docs/receiver_apps#Styled
     
    A completely different solution would be to mirror one Android device
    (tablet) to the HDMI output & then use a second Android device (connected
    over wifi or bluetooth) to control what the 1st Android device is
    mirroring. Just like this from a few years back...
    - http://blog.radioactiveyak.com/2011/05/android-protips-at-io-session-video-and.html
     
    Regards
     
    On Monday, February 24, 2014 9:56:08 PM UTC+11, Simon Giddings wrote:

     

--
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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

[android-developers] Digest for android-developers@googlegroups.com - 11 Messages in 7 Topics

Comments: (0)

Group: http://groups.google.com/group/android-developers/topics

    Pradeep Phatak <pradeep.phatak@gmail.com> Feb 24 07:30PM -0800  

    Thank you Nikolay.
    I added p12 file to the Keystore using the load method, passing the
    InputStream and password string.
    I didn't see any method to provide an alias for this entry.
    KeyStore getCertificate and getKey method require an alias to be passed.
    Without an alias, it is not clear how to get the certificate and key from
    the p12 file.
     
    On Sunday, February 23, 2014 5:24:14 AM UTC-8, Nikolay Elenkov wrote:
     

     

    Nikolay Elenkov <nikolay.elenkov@gmail.com> Feb 25 12:53PM +0900  

    On Tue, Feb 25, 2014 at 12:30 PM, Pradeep Phatak
    > KeyStore getCertificate and getKey method require an alias to be passed.
    > Without an alias, it is not clear how to get the certificate and key from
    > the p12 file.
     
    Presumably you know the alias, since you put it there?
     
    If not use the Enumeration<String> aliases () method to list,
    than pick the one you need.

     

    Larry Meadors <larry.meadors@gmail.com> Feb 24 10:39AM -0700  

    For the next poor sucker that hits this issue.
     
    The trick for me was to add the namespace and the custom permission to
    the MAIN manifest (not the amazon specific one).
     
    For a working sample project:
     
    https://github.com/lmeadors/ProductFlavorsProvided
     
    Larry

     

    SomeName <vania.raquel.lamas@gmail.com> Feb 24 07:22AM -0800  

    Hi.
     
    So I have a radio group, and instead of having the traditional view, I want
    to have be a png image I have. And when that radio button is activated is
    one image, and when it is not, then it is another image.
     
    I think I have all the right code, but still, all the images might change
    the first time (changing from deactivated to activated), but never go back
    to deactivated mode.
     
    This is the code for the images:
     
    <?xml version="1.0" encoding="utf-8"?>
     
    <selector xmlns:android="http://schemas.android.com/apk/res/android" >
     
    <item android:drawable="@drawable/camon" android:state_checked="true"
    android:state_pressed="false" />
     
    <item android:drawable="@drawable/camoff" android:state_checked="false"
    android:state_pressed="false" />
     
    <item android:drawable="@drawable/camon" android:state_checked="true"
    android:state_pressed="true" />
     
    <item android:drawable="@drawable/camoff" android:state_checked="false"
    android:state_pressed="true" />
     
    </selector>
     
     
    And the code in main xml:
     
    <RadioGroup
     
    android:id="@+id/radioGroup1"
     
    android:layout_width="match_parent"
     
    android:layout_height="wrap_content"
     
    android:orientation="vertical" >
     
     
    <TableRow
     
    android:id="@+id/tableRow3"
     
    android:layout_width="match_parent"
     
    android:layout_height="wrap_content"
     
    android:gravity="center" >
     
     
    <RadioButton
     
    android:id="@+id/radio0"
     
    android:layout_width="wrap_content"
     
    android:layout_height="wrap_content"
     
    android:checked="true"
     
    android:text=""
     
    android:background="@drawable/radio_1"
     
    android:button="@null" />
     
     
    <RadioButton
     
    android:id="@+id/radio1"
     
    android:layout_width="wrap_content"
     
    android:layout_height="wrap_content"
     
    android:background="@drawable/radio_2"
     
    android:text=""
     
    android:button="@null" />
     
     
    </TableRow>
     
     
    <TableRow
     
    android:id="@+id/tableRow4"
     
    android:layout_width="wrap_content"
     
    android:layout_height="wrap_content"
     
    android:gravity="center" >
     
     
    <TextView
     
    android:id="@+id/TextView01"
     
    android:layout_width="match_parent"
     
    android:layout_height="wrap_content"
     
    android:text="View 1"
     
    android:textAppearance=
    "?android:attr/textAppearanceSmall" />
     
     
    <TextView
     
    android:id="@+id/textView2"
     
    android:layout_width="match_parent"
     
    android:layout_height="wrap_content"
     
    android:text="View 2"
     
    android:textAppearance=
    "?android:attr/textAppearanceSmall" />
     
    </TableRow>
     
     
    <TableRow
     
    android:id="@+id/tableRow1"
     
    android:layout_width="match_parent"
     
    android:layout_height="wrap_content"
     
    android:gravity="center" >
     
     
    <RadioButton
     
    android:id="@+id/radio2"
     
    android:layout_width="wrap_content"
     
    android:layout_height="wrap_content"
     
    android:background="@drawable/radio_3"
     
    android:text=""
     
    android:button="@null" />
     
     
    <RadioButton
     
    android:id="@+id/radio3"
     
    style="@drawable/button_radio"
     
    android:layout_width="wrap_content"
     
    android:layout_height="wrap_content"
     
    android:background="@drawable/radio_4"
     
    android:text=""
     
    android:button="@null" />
     
     
    </TableRow>
     

     
    <TableRow
     
    android:id="@+id/tableRow4"
     
    android:layout_width="wrap_content"
     
    android:layout_height="wrap_content"
     
    android:gravity="center" >
     
     
    <TextView
     
    android:id="@+id/TextView03"
     
    android:layout_width="match_parent"
     
    android:layout_height="wrap_content"
     
    android:text="View 3"
     
    android:textAppearance=
    "?android:attr/textAppearanceSmall" />
     
     
    <TextView
     
    android:id="@+id/textView4"
     
    android:layout_width="match_parent"
     
    android:layout_height="wrap_content"
     
    android:text="View 4"
     
    android:textAppearance=
    "?android:attr/textAppearanceSmall" />
     
    </TableRow>
     
    </RadioGroup>

     

    janvi <jagruthi.bhatia@gmail.com> Feb 24 02:37AM -0800  

    Any info on this???
     
    On Friday, February 14, 2014 2:46:34 PM UTC+5:30, janvi wrote:

     

    Larry Meadors <larry.meadors@gmail.com> Feb 24 06:19AM -0700  

    What version are you using for development?
     

     

    Simon Giddings <mr.s.giddings@gmail.com> Feb 24 02:56AM -0800  

    After having looked at this, it would seem to be a bit overkill.
    Is there not another, more "direct" way to output to an HDMI display ?
     
    On Saturday, 22 February 2014 07:20:32 UTC+1, gjs wrote:

     

    TreKing <trekingapp@gmail.com> Feb 24 12:20AM -0600  


    > Then in my app, I tried to access that picture, it says file is not found.
     
     
    What API level are you running and how are you accessing the file?
     
    -------------------------------------------------------------------------------------------------
    TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
    transit tracking app for Android-powered devices

     

    Yves Liu <yvesliu@gmail.com> Feb 23 10:27PM -0800  

    TreKing,
     
    Here is the code snippet
     
    File file = new File(" /storage/emulated/0/Download/12345.jpg");
     
    if(file.exists())
    return true;
     
    And another file which I can see through astro file manager there works.
     
     
     
     

     

    TreKing <trekingapp@gmail.com> Feb 24 12:56AM -0600  


    > Here is the code snippet
     
     
    OK, first thing is you should not be hard-coding paths. Use the external
    storage APIs.
     
    Second, you didn't answer the other question: which platform version are
    you running on?
     
    -------------------------------------------------------------------------------------------------
    TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
    transit tracking app for Android-powered devices

     

--
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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

[android-developers] Digest for android-developers@googlegroups.com - 11 Messages in 6 Topics

Comments: (0)

Group: http://groups.google.com/group/android-developers/topics

    Larry Meadors <larry.meadors@gmail.com> Feb 23 09:14PM -0700  

    I've been fighting with this all weekend and could use some help.
     
    Hope this isn't tl;dr. :-/
     
    Short version: I'm looking for a way to add a "provided" scope, but
    the trick where you add a "provided" configuration doesn't seem to
    work with android apps that use "productFlavors".
     
    I have an application that uses google maps and device messaging.
     
    I'm am now trying to make it work with amazon maps and device messaging.
     
    I've reconfigured the project to use "productFlavors" named "google"
    and "amazon".
     
    I added a dependency for the google flavor like this:
    - googleCompile('com.google.android.gms:play-services:4.0.30')
     
    The google flavor now compiles and works. Joy.
     
    Next, I tried to add the dependency for amazon in a similar way, but
    it turns out that the jars for the amazon APIs are just stubs and are
    not intended to be deployed with the APK - they are just supposed to
    be available at compile time.
     
    Using this "provided" trick adds the jars to the "main" compile classpath.
     
    main{
    compileClasspath += configurations.provided
    }
     
    However, that isn't the classpath that's used when compiling the
    amazon flavor. I tried to do this:
     
    android.sourceSets.amazon{
    compileClasspath += configurations.provided
    }
     
    But I get this error:
     
    Could not find method plus() for arguments [configuration ':provided']
    on source set 'compile classpath'.
     
    I've tried 100 things, and nothing seems to work. :-/
     
    Anyone know how to do this?
     
    Larry

     

    "yvesliu@gmail.com" <yvesliu@gmail.com> Feb 23 04:41PM -0800  

    This is the strangest thing. This problem I found is on Nexus 5. Maybe this
    applies to all Android devices.
     
    I downloaded a picture from gmail, and from Gallery, i can see that
    picture. By click on Details, I can see the file path
    is /storage/emulated/0/Download/12345.jpg. Then in my app, I tried to
    access that picture, it says file is not found. So, I used Astro File
    Manager and get to that folder location, I cant find that file. But if I
    connect the phone to a PC, and after the storage is mounted, I get to
    \Nexus 5\Internal storage\Download folder and the file is there. Anyone
    knows why? How can I find the real path of the file?
     
    Any help will be appreciated.
     
    Thanks
     
    Yves

     

    "yvesliu@gmail.com" <yvesliu@gmail.com> Feb 23 04:37PM -0800  

    This is the strangest thing.

     

    Danny D <daniel.m.devine@gmail.com> Feb 22 10:44PM -0800  

    Is the object instance for the content provider different between test runs? How are you destroying and recreating the ContentProvider?
     
    I suspect that if the Application instance is the same between test runs the ContentProvider might be too. It's created at the Application level through the manifest, so you may need to use an ApplicationTestCase or something similar to be sure that the App instance is killed and restarted between tests.

     

    Code Guru <codeguru42@gmail.com> Feb 23 12:16AM -0700  

    The `ContentProvider` is created indirectly by calling
    `getContentResolver()` from inside a method of the `Activity` under test. I
    will have to look into using `ApplicationTestCase` as you suggest.
     
     

     

    Code Guru <codeguru42@gmail.com> Feb 23 12:33AM -0700  

    My current test class extends `ActivityInstrumentationTestCase2`. If I
    change it to extend `ApplicationTestCase`, how do I start an activity?
     
     

     

    Danny D <daniel.m.devine@gmail.com> Feb 23 11:29AM -0800  

    As I read your reply, I'm confused now about what's being tested. Are you testing the ContentProvider or the Activity? If testing the Activity, it may be better to create a MockContentProvider that's responsible for providing back the info. If testing the ContentProvider, skip the Activity and use an Application test case, as you get direct control of when its created or destroyed.
     
    Sometimes its hard to do, but the goal in testing is to isolate the components and build known conditions around them.

     

    Code Guru <codeguru42@gmail.com> Feb 23 02:33PM -0700  

    In this case, I am testing the activities of my app with
    ActivityInstrumentationTestCase2. (I also have tests for the
    ContentProvider using ProviderTestCase2.) The two tests that I outlined
    earlier are for the data entry activity. I want to verify that the data
    entered is inserted into the underlying database. The Activity inserts the
    data via `getContentResolver.insert()`. The test case then opens the
    database directly to assert that the data is there. How would I use a
    MockContentProvider and/or other mock objects to perform this kind of
    testing?
     
    > To unsubscribe from this group and all its topics, send an email to
    > android-developers+unsubscribe@googlegroups.com.
    > For more options, visit https://groups.google.com/groups/opt_out.
     
    On Sun, Feb 23, 2014 at 12:29 PM, Danny D <daniel.m.devine@gmail.com> wrote:
     

     

    Kostya Vasilyev <kmansoft@gmail.com> Feb 24 02:18AM +0400  

    I think you're seeing normal Unix (and Linux) file system semantics, with
    respect to deleting a file that's currently open. This unlinks the name
    from the underlying file system, but the file itself continues to stay
    open, and has same content as before unlinking -- until the process that
    has the file open terminates.
     
    So, if you're going to execute both tests in one run, you need a way to
    reset the database some other way.
     
    One method would be to ensure that the CP closes the database before
    deleting the files (then reopens).
     
    Another would be to delete all data (DELETE FROM tablename).
     
    Yet another would be to drop all tables (and to re-create them).
     
    In any case, you'll need a way for your test code to trigger this code
    inside the CP.
     
    One way to do this would be to create a special purpose content:// URI and
    call it from the test code (and the CP would recognize it and reset its
    data using one of the methods above).
     
    -- K
     
     
     

     

    Nikolay Elenkov <nikolay.elenkov@gmail.com> Feb 23 10:24PM +0900  

    On Sat, Feb 22, 2014 at 9:02 AM, Pradeep Phatak
     
    > Expectation-
    > In Wifi Settings, this EAP-TLS wifi configuration should show this user
    > certificate pre-selected.
     
    I haven't looked at this for a while, but IIRC it doesn't work the way
    you expect it to (see below).
     
    > setClientKeyEntry method throws this exception if getEncoded method returns
    > null for the PrivateKey object reference.
    > It is not clear why getEncoded returns null in this case.
     
    Once a key is imported into the device keystore you can use it, but
    not extract the private part. That is why getEncoded() returns null.
    If it returned the encoded key bytes, that would let you extract
    the private key, which defeats the purpose of storing it in the
    keystore.
     
     
    > Can a password protected .p12 file stored in keystore be used for
    > programatically configuring Wifi EAP-TLS using this procedure?
     
    Again IIRC (I might be wrong, so do check), WifiEnterpriseConfig
    imports the key into the keystore for you, so you should provide
    it a key it can read. To do that, load the PKCS#12 file using
    a KeyStore.getInstance("PKCS12"), then find the private key
    entry and pass it to WifiEnterpriseConfig. Do *not* import into
    the Android keystore first.

     

--
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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

[android-developers] Digest for android-developers@googlegroups.com - 3 Messages in 3 Topics

Comments: (0)

Group: http://groups.google.com/group/android-developers/topics

    codeguru <codeguru42@gmail.com> Feb 22 08:57PM -0800  

    Two of my JUnit tests against my app pass when I run them separately but
    fail when run consecutively.
     
    The two tests run through the following sequence of actions:
     
    *Test 1:*
     
    1.

    Insert a single row to the database.

    This all occurs within the app using getContentResolver().insert().
    2.

    Clean up the test.

    In particular, I delete the database using
    context.deleteDatabase(DB_NAME);.

    *Test 2:*
     
    1.

    Insert multiple rows to the database.

    This again occurs within the app using multiple calls to
    getContentResolver.insert(). The data inserted to the database includes
    the data for the single row from Test 1. When this row of data is reached
    in test 2, the test fails.

    From what I can tell, the ContentProvider in Test 2 still "sees" the data
    added during Test 1. I suspect this is due to my method of cleaning up the
    test. I verified with adb shell that the database file is deleted when Test
    1 cleans up and that it is recreated when Test 2 starts.
     
    How do I correctly clean up the first test so that the second test doesn't?
    I guess I could split the two test methods into two separate classes. Even
    if this works, it means that I will have to split up other classes with
    even more test methods that experience the same issue. Does anyone have
    other suggesions?
     
    Code Guru

     

    Ubuntu guy <sam_cit@yahoo.co.in> Feb 22 09:14AM -0800  

    Thanks Eric. However, i still don't get as to why the service can't be
    distributed through the play store. Even if its installed in unsupported
    devices, the APIs like getDolbyAudioProcessing(...,...) could just return
    null and applications would anyways be handling such cases, isn't it?
     
    The pro being any quick fix to the service can be deployed quickly via
    play store rather than being bottlenecked by OEM's update schedule, which
    is often influenced by many factors and there by delaying the dolby's fix.
     
    On Thursday, February 20, 2014 1:41:24 PM UTC-8, Eric Ang wrote:

     

--
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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

[android-developers] Digest for android-developers@googlegroups.com - 7 Messages in 5 Topics

Comments: (0)

Group: http://groups.google.com/group/android-developers/topics

    Pradeep Phatak <pradeep.phatak@gmail.com> Feb 21 04:02PM -0800  

    Client device-
    Nexus 5
    Android 4.4.2 Kitkat

    Context-
    I have stored a password protected .p12 client certificate/key
    programatically in the Android keystore.
    During provisioning, Wifi was selected in the dialog (instead of VPN and
    apps).
    I want to use it for Wifi EAP-TLS configuration using the Android API.

    Expectation-
    In Wifi Settings, this EAP-TLS wifi configuration should show this user
    certificate pre-selected.

    Procedure-
    1) Used KeyChain API to get the certificate and key by providing the
    keystore alias. Confirmed that the object references returned were not null.
    2) Used WifiEnterpriseConfig setClientKeyEntry API passing the
    X509certificate and PrivateKey reference.

    Observation-
    setClientKeyEntry method throws exception-
    java.lang.IllegalArgumentException: Private key cannot be encoded.
    setClientKeyEntry method throws this exception if getEncoded method returns
    null for the PrivateKey object reference.
    It is not clear why getEncoded returns null in this case.

    Can a password protected .p12 file stored in keystore be used for
    programatically configuring Wifi EAP-TLS using this procedure?

     

    Rahul Kaushik <rahulkaushik85@gmail.com> Feb 21 01:24PM +0530  

    i have tabs each containg 50 +edit text and this may very up to 1000 so
    saving the data will make the app too bulky,so
     
    i added view(Containing spinner and buttons) in tabwidget and set the
    default tabs of width 1dp, now am able to switch between tabs data with the
    spinner item click without losing data but now issue is when i click on
    spinner item scrolling is not working
     
    Please suggest
     
    Thanks
    RK
     
     

     

    TreKing <trekingapp@gmail.com> Feb 21 02:08PM -0600  


    > i have tabs each containg 50 +edit text and this may very up to 1000 so
    > saving the data will make the app too bulky,so
     
    More bulky than 50+ edit texts? OK.
     
     
    > spinner item click without losing data but now issue is when i click on
    > spinner item scrolling is not working
     
    > Please suggest
     
    It's hard to suggest since your description is, again, so vague. I suggest
    you debug your app and implement a solution. Or better describe the
    problem. Or show a picture of the issue.
     
    -------------------------------------------------------------------------------------------------
    TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
    transit tracking app for Android-powered devices

     

    Marco Serioli <mserioli@gmail.com> Feb 21 05:23AM -0800  

    Hi guys!
     
    I've already posted this question on Stack
    Overflow: http://stackoverflow.com/questions/21932685/httpurlconnection-slow-post-multipart-content
     
    But maybe here I can find more solution :)
     
     
    I'm trying to post a test File to a tomcat server using Android. I'm
    developing on Android 4.1.2, but I have verified same problem on 4.0.3.
     
    The problem is that the file upload requires a very long time (about 70
    seconds for a 4MB file), also in local network. The time is equiparable
    using a 3g connection. I've excluded that it could be a server problem:
    executing the same call with curl it takes 1 / 2 seconds.
     
    I'm using Spring Android RestClient 1.0.1.RELEASE and, given Android
    version and the fact that I'm not overriding default behaviour, it uses
    HttpUrlConnection instead of HttpClient to make http requests.
     
    I have also implemented my custom ClientHttpSessionFactory in order to
    manipulate some details of SSL connection and I have defined my own
    implementation of ClientHttpRequestInterceptor in order to modify
    authentication header.
     
    All works, also the posting of small file. But when I try to send "big"
    files the time increase.
     
    I have also set setBufferRequestBody(false) in order to avoid
    OutOfMemoryException on big files. But this property have no effects on
    time required.
     
    Looking in DDMS shell, on Network Statistics I've also found that the
    network throughput is never over 250kb in TX.
     
    There seems to be a bootleneck, but how to investigate it?
     
    I can post some code if it could be useful!
     
    Thank you for any suggestion!
    Marco

     

    Simon Giddings <mr.s.giddings@gmail.com> Feb 21 07:32AM -0800  

    I am creating an application which needs to display on an HDMI connected
    screen, display content which is different to that displayed on the tablet.
     
    This could be used in the context of presentations where the presenters
    notes are only displayed on the tablet and the "illustration" content on
    the HDMI output device.
     
    Is there any resource which describes how to go about writing specifically
    to the HDMI output screen ?
    Tutorials even ?

     

    saex <elpablosaez@gmail.com> Feb 21 01:27AM -0800  

    Im using the solution of this website:
    http://www.nowherenearithaca.com/2012/03/too-easy-using-contentprovider-to-send.htmlto share images from assets folder, but it is not working. The share panel
    is being opened, but when i select gmail, google+ or some other social
    sharing network, the image is not being shared.
     
    The method public AssetFileDescriptor openAssetFile(Uri uri, String mode)is not being called when i try to share an image, and the image is not
    being shared.
     
    Logcat tells this: No content provider found for permission check:
    content:/com.appname/img319030.jpg
     
    I created a class called AssetsContentProvider on my com.appname.utilpackage and i added this line to my manifest:
     
    <provider android:name="com.appname.util.AssetsContentProvider"
    android:authorities="com.appname"/>
     
    The class that is trying to use ACTION_SEND to share the image is located
    on the package com.appname.actions, and it simply does this:
     
    Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND);
    shareIntent.setType("image/jpg");
    Uri theUri = Uri.parse("content:/com.appname/img319030.jpg");
    shareIntent.putExtra(Intent.EXTRA_STREAM,theUri);
    SectionManager.getCurrentActivity().startActivity(Intent.createChooser(shareIntent, ""));
     
     
    The image is called img319030.jpg and it is located in assets folder.
     
    This is my AssetsContentProvider class:
     
    public class AssetsContentProvider extends ContentProvider{
    @Override
    public AssetFileDescriptor openAssetFile(Uri uri, String mode) throws FileNotFoundException {
    AssetManager am = getContext().getAssets();
    String file_name = uri.getLastPathSegment();
    if(file_name == null)
    throw new FileNotFoundException();
    AssetFileDescriptor afd = null;
    try {
    afd = am.openFd(file_name);
    } catch (IOException e) {
    e.printStackTrace();
    }
    return afd;//super.openAssetFile(uri, mode);
    }
     
    @Override
    public int delete(Uri uri, String selection, String[] selectionArgs) {
    return 0;
    }
    @Override
    public String getType(Uri uri) {
    return null;
    }
    @Override
    public Uri insert(Uri uri, ContentValues values) {
    return null;
    }
    @Override
    public boolean onCreate() {
    return false;
    }
    @Override
    public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
    return null;
    }
    @Override
    public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) {
    return 0;
    }}

     

--
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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.