[android-developers] Re: How to READ a MODE_WORLD_READABLE file from ANOTHER application

2011-12-04 Thread Saied
I spoke too soon.
It works ONCE and then it

12-04 22:38:05.330: WARN/System.err(763):
java.io.FileNotFoundException: This file can not be opened as a file
descriptor; it is probably compressed

This is the routine in the Content Provider:

@Override
public AssetFileDescriptor openAssetFile(Uri uri, String mode) {
String fileName = "asset_text.txt";
AssetManager assetManager = this.getContext().getAssets();
AssetFileDescriptor afd = null ;
try {
afd = assetManager.openFd(fileName);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return afd;
}

What I don't understand is why did it work once and no more? The file
is still there, intact. Does it get compressed on the device? How can
I read it reliably?

Thanks.


On Dec 4, 3:02 pm, Saied  wrote:
> wow. that was dumb of me!! Thanks for pointing it out.
>
> so I changed it to:
>
> @Override
>         public AssetFileDescriptor openAssetFile(Uri uri, String mode) {
>                 String fileName = "asset_text_orig.txt";       // hardcoding 
> the
> file name for now
>
>                 AssetManager assetManager = getAssets();
>                 AssetFileDescriptor afd = assetManager.openFd(fileName);
>                 return afd;
>         }
>
> and it WORKS!!
>
> Thank you VERY much for your help and indulgence!
>
> On Dec 4, 2:09 pm, skink  wrote:
>
>
>
>
>
>
>
> > Saied wrote:
> > > Thanks again!
>
> > > Actually, this seems to be working on the ContentProvider now:
>
> > > public AssetFileDescriptor openAssetFile(Uri uri, String mode) {
> > >            String fileName = "asset_text_orig.txt";
> > >            URI uri1 = URI.create(fileName);
> > >            AssetFileDescriptor parcel =  this.openAssetFile(uri1, mode);  
> > > //
> > > for testing purposes, I hardwired this to uri1 >
> > > "asset_text_orig.txt";
> > >            return parcel;
> > >    }
>
> > it will not work since you call openAssetFile recursively and you will
> > get stack overflow error
>
> > > Now, how do I read this from an app?
>
> > >            String packageName = "com.example.text.cp";
> > >            FileInputStream fstream = new FileInputStream("content://" +
> > > packageName); // there is only one kind of file exposed
> > >    DataInputStream in = new DataInputStream(fstream);
> > >    BufferedReader br = new BufferedReader(new InputStreamReader(in));
> > >    String strLine = br.readLine();
>
> > >    ...
>
> > > Or should I include openAssetFile(Uri uri, String mode) at the end of
> > > the uri goint to FileInputStream?
>
> > > Thank you very much for your help so far.
>
> > seehttp://developer.android.com/guide/topics/providers/content-providers...
>
> > pskink

-- 
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


[android-developers] Re: My Newbie problem with compiling the HelloAndroid App

2011-12-04 Thread Droid
You have to right click on the project folder and then find "run"
I think you are right clicking on R java or something.

Its only the project file at the top that "runs"

That's my guess.

On Nov 29, 3:48 am, Jerry  wrote:
> I have Eclipse Gallileo hosting Android 4.0 platform, running on WinOS
> 7.  I am trying to write an app that will run on my HTC Desire.  The
> Desire version is 2.2, and "no updates are available."  I can follow
> the tutorial and run the programmed HelloAndroid app on the Desire,
> but when I try to build the .xml layout, I can't compile.  The error
> message says that "R.layout.main can't be run..." because the 4.0
> platform either makes the use of the R.layout.main statement
> impossible, or the fix requires some action on my part that is more
> complicated than I can deal with.
>
> Can somebody either suggest a different tutorial app for a green
> Android developer like myself, or, somehow, help me get past this
> problem in the HelloAndroid tutorial?
>
> Thanks for any help.
>
> Jerry

-- 
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


[android-developers] Is is possible to block android system updates with out rooting the device?

2011-12-04 Thread srihari babu
Hi All,

Is there is any way to block android OS updates in the device.
I even don't want to show notification of system update
and at the same time i am not interested to root the device.
Is is possible? any suggestions are highly appreciated.

Regards,
Sri

-- 
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

[android-developers] Re: User cannot install an update

2011-12-04 Thread John Coryat
How many times have I read that same complaint from a user. I'm guessing 
hundreds.

it's unrelated to your app. I send this to the user and it has always 
solved the problem:

The launcher, installer and Android Market installer are part of your 
device manufacturer or carrier's specific Android OS version. As such, 
Android devices are subject to a wide variety of unusual behavior. Issues 
with the Android Market and launcher are controlled by your carrier, 
manufacturer of the device and Google. Luckily, there are a couple of 
things you can do that usually solve the problem:

Please do the following:

Turn off your device.
Take out the battery.
Put the battery back in.
Restart your device.

That should fix it. If not, try this:

Uninstall our app.
Reinstall our app.

If this doesn't work, please try the Android Market Support:

http://www.google.com/support/androidmarket/

The thing about taking the battery out may be extreme but (no joking here!) 
a lot of users don't know how to turn their phone off completely. Telling 
them to take the battery out is the surest way to make sure they're 
actually turning it off. It has nothing to do with the battery.

-John Coryat

-- 
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

[android-developers] Re: User cannot install an update

2011-12-04 Thread John Gaby
There is one more relevant point.  I have had the user completely
uninstall the app and re-install the new version and the above log is
what he is seeing

-- 
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


[android-developers] User cannot install an update

2011-12-04 Thread John Gaby
I have a user who is trying to install an update and it is failing.
He has sent me the logcat and it seems to be failing because of some
kind of incompatibility with the shared UserID.  However, I am able to
install the same update over the same old version without this
problem.  Here is the relevant logcat section.  Does anyone have an
idea as to what might be going wrong.

12-04 22:48:02.803 I/ActivityManager(1784): Starting activity: Intent
{ act=android.intent.action.VIEW dat=file:///mnt/sdcard/
oubliette20B5.apk typ=application/vnd.android.package-archive
cmp=com.android.packageinstaller/.PackageInstallerActivity }
12-04 22:48:03.173 I/ActivityManager(1784): Displayed activity
com.android.packageinstaller/.PackageInstallerActivity: 354 ms (total
354 ms)
12-04 22:48:03.923 I/ActivityManager(1784): Starting activity: Intent
{ dat=file:///mnt/sdcard/oubliette20B5.apk
cmp=com.android.packageinstaller/.InstallAppProgress (has extras) }
12-04 22:48:04.203 D/PackageParser(1784): Scanning package: /data/app/
vmdl24026.tmp
12-04 22:48:04.273 I/ActivityManager(1784): Displayed activity
com.android.packageinstaller/.InstallAppProgress: 315 ms (total 315
ms)
12-04 22:48:04.403 D/PackageManager(1784): Scanning package
com.gabysoft.oubliette
12-04 22:48:04.403 D/PackageManager(1784): Shared UserID
com.gabysoft.oubliette (uid=10083): packages=[PackageSetting{46644bf0
com.gabysoft.oubbeta/10083}, PackageSetting{4660ffd0
com.gabysoft.oubliettelite/10083}]
12-04 22:48:04.413 I/PackageManager(1784): /data/app/
com.gabysoft.oubliette-1.apk changed; unpacking
12-04 22:48:04.413 D/PackageManager(1784): Caching shared lib lib/
armeabi/liboubliette-jni.so
12-04 22:48:04.413 E/PackageManager(1784): Package
com.gabysoft.oubliette has mismatched uid: 10113 on disk, 10083 in
settings
12-04 22:48:04.423 W/PackageManager(1784): Failed to cache package
shared libs
12-04 22:48:04.423 W/PackageManager(1784): java.io.IOException:
Permission denied
12-04 22:48:04.423 W/PackageManager(1784):  at
java.io.File.createNewFileImpl(Native Method)
12-04 22:48:04.423 W/PackageManager(1784):  at
java.io.File.createNewFile(File.java:1160)
12-04 22:48:04.423 W/PackageManager(1784):  at
java.io.File.createTempFile(File.java:1224)
12-04 22:48:04.423 W/PackageManager(1784):  at
com.android.server.PackageManagerService.cacheNativeBinaryLI(PackageManagerService.java:
3767)
12-04 22:48:04.423 W/PackageManager(1784):  at
com.android.server.PackageManagerService.cachePackageSharedLibsForAbiLI(PackageManagerService.java:
3647)
12-04 22:48:04.423 W/PackageManager(1784):  at
com.android.server.PackageManagerService.cachePackageSharedLibsLI(PackageManagerService.java:
3718)
12-04 22:48:04.423 W/PackageManager(1784):  at
com.android.server.PackageManagerService.scanPackageLI(PackageManagerService.java:
3233)
12-04 22:48:04.423 W/PackageManager(1784):  at
com.android.server.PackageManagerService.installNewPackageLI(PackageManagerService.java:
5602)
12-04 22:48:04.423 W/PackageManager(1784):  at
com.android.server.PackageManagerService.installPackageLI(PackageManagerService.java:
5949)
12-04 22:48:04.423 W/PackageManager(1784):  at
com.android.server.PackageManagerService.access
$2100(PackageManagerService.java:137)
12-04 22:48:04.423 W/PackageManager(1784):  at
com.android.server.PackageManagerService
$5.run(PackageManagerService.java:4752)
12-04 22:48:04.423 W/PackageManager(1784):  at
android.os.Handler.handleCallback(Handler.java:587)
12-04 22:48:04.423 W/PackageManager(1784):  at
android.os.Handler.dispatchMessage(Handler.java:92)
12-04 22:48:04.423 W/PackageManager(1784):  at
android.os.Looper.loop(Looper.java:123)
12-04 22:48:04.423 W/PackageManager(1784):  at
android.os.HandlerThread.run(HandlerThread.java:60)
12-04 22:48:04.423 W/PackageManager(1784): Package couldn't be
installed in /data/app/com.gabysoft.oubliette-1.apk

-- 
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


[android-developers] how to retrieve connected bluetooth headset battery strength

2011-12-04 Thread Amit Mangal
Hi Developers,

I am trying to calculate the battery strength of Bluetooth headset that is
connected to my android mobile.

I have downloaded code

https://github.com/cgjones/android-frameworks-base/blob/gingerbread-b2g/core/java/android/bluetooth/BluetoothHeadset.java

but i am unable to use it please any body guide me how to use this class.

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

Re: [android-developers] How can I get Active Activity of a service from an annotation

2011-12-04 Thread TreKing
On Tue, Nov 29, 2011 at 1:05 PM, pedrohms  wrote:

> I have a little problem in my application when I try get an active
> activity.
>

You want us to guess what the little problem is?

-
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] My Newbie problem with compiling the HelloAndroid App

2011-12-04 Thread TreKing
On Mon, Nov 28, 2011 at 9:48 PM, Jerry  wrote:

> The error message says that "R.layout.main can't be run..."
>

That file is not something that can be "run". You should elaborate on what
*exactly* you're doing and what *exactly* is the error that you're getting.

-
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Problems reading/writing to SQLite db on SD card.

2011-12-04 Thread Nikolay Elenkov
On Mon, Dec 5, 2011 at 4:14 AM, MarkG123  wrote:
> Hi, writing an Android application that reads data from a SQLite
> database created by a 3rd party camera.
>
> I have added permission WRITE_EXTERNAL_STORAGE, but I still get
> "attempt to write a readonly database" exception
>
> I have tried different API levels and such, without any
> difference.      I have checked the SDCard in the emulator isn't
> readonly.

Check/post the full stack trace and the logcat for hints.
Can you open and read the DB with the sqlite3 utility?

-- 
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


Re: [android-developers] Unity for Android

2011-12-04 Thread TreKing
On Sun, Dec 4, 2011 at 8:00 PM, bob  wrote:

> Can you do anything for free using Unity for Android?
>
> Or, do you have to pay $400 or $1500?
>

Why not ask that to the people at Unity ... ? Or do some basic research ...
?

-
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] How to set background color for context menu

2011-12-04 Thread rambabu mareedu
HI to allIn my app iam using context menu for this i want to set
some background colors to my context menu can anyone tell is it
possible?

Thanks in advance

-- 
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


[android-developers] Unity for Android

2011-12-04 Thread bob

Can you do anything for free using Unity for Android?

Or, do you have to pay $400 or $1500?

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


[android-developers] Re: In app billing: restore single transaction?

2011-12-04 Thread xstream
i know this is over a month old...but bump as i just found it and am having 
the same exact issue.

I have the dungeons sample working perfectly, however i want to try to add 
code to see if a certain managed item was purchased on app start 
upplease assist! thank you.

-- 
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

Re: [android-developers] Re: Mobile app discovery

2011-12-04 Thread Mark Murphy
On Sun, Dec 4, 2011 at 7:05 PM, klewelling  wrote:
> Oh you mean replicate what Amazon did, do it for the web first then
> maybe the device later.

Well, I hadn't been considering the device at all. I was more
interested in Web-based app previews, using a hosted Android
environment. Using an app on a device to access the hosted Android
environment was a wrinkle that popped to mind while considering your
situation.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training...At Your Office: http://commonsware.com/training

-- 
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


[android-developers] Re: Mobile app discovery

2011-12-04 Thread klewelling
>
> > (figuring out the stack for doing this sort of preview is on my
> > 18,000-item to-do list, though I probably would be aiming to replicate
> > the Web-based client)
>
> What do you mean "replicate the Web-based client"? Is this another
> item on your todo list?

Oh you mean replicate what Amazon did, do it for the web first then
maybe the device later.

-- 
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


Re: [android-developers] Re: Mobile app discovery

2011-12-04 Thread Mark Murphy
On Sun, Dec 4, 2011 at 6:59 PM, klewelling  wrote:
>> (figuring out the stack for doing this sort of preview is on my
>> 18,000-item to-do list, though I probably would be aiming to replicate
>> the Web-based client)
>
> What do you mean "replicate the Web-based client"?

Amazon AppStore uses a Flash RDP(?) client that appears in a desktop
Web browser for these previews. That is the "Web-based client".

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training...At Your Office: http://commonsware.com/training

-- 
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


[android-developers] Re: Mobile app discovery

2011-12-04 Thread klewelling

> If I were you, I'd go a different route. For example, go with a mobile
> edition of the Amazon AppStore preview model. AFAIK, they're using
> android-x86 instances hosted in their cloud, where they cooked up a
> Flash RDP(?) client to connect to those from the browser. You could do
> something along those lines, using RDP or VNC in your stumbling app to
> peek into the virtualized device running the app in question. Same
> zero-install experience, but now your infrastructure is in the cloud,
> which you can mock up on home equipment temporarily. You eliminate the
> security issues, you eliminate the need for developers to rebuild
> their apps to fit your model, etc.
>

Very interesting idea. I am going to do some research.


> (figuring out the stack for doing this sort of preview is on my
> 18,000-item to-do list, though I probably would be aiming to replicate
> the Web-based client)
>

What do you mean "replicate the Web-based client"? Is this another
item on your todo list?

-- 
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


Re: [android-developers] Why doesn't layout_alignCenterInParent work?

2011-12-04 Thread Mark Murphy
I would assume that GridView does not support wrap_content for
android:layout_height, no different that ListView. I'm not sure it
supports wrap_content for android:layout_width, either. And, of
course, your RelativeLayout doesn't have the attribute in your post
title, though I assume that's a copy/paste issue. :-)

Try it with a GridView with fixed dimensions and see what happens.

On Sun, Dec 4, 2011 at 5:41 PM, Christopher Van Kirk
 wrote:
> I've tried several times now to use android:layout_alignCenterInParent to
> center a child in its parent RelativeLayout view, but it never seems to
> work.
>
> What's wrong with this code, and why doesn't it center the GridView in the
> outer RelativeView?
>
> 
> http://schemas.android.com/apk/res/android";
>    android:layout_width="fill_parent"
>    android:layout_height="fill_parent"
>>        android:id="@+id/select_grid"
>        android:layout_width="wrap_content"
>        android:layout_height="wrap_content"
>        android:layout_centerInParent="true"
>        android:numColumns="3"
>        android:columnWidth="90dp"
>        android:stretchMode="none"
>        android:gravity="center"
>        android:verticalSpacing="10dp"
>        android:horizontalSpacing="10dp"
>        android:layout_marginLeft="20dp"
>        android:layout_marginRight="20dp" >
> 
> 
>
> --
> 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



-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training...At Your Office: http://commonsware.com/training

-- 
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


Re: [android-developers] Re: Mobile app discovery

2011-12-04 Thread Mark Murphy
>From a security standpoint, what you're describing is a sandbox,
which, done properly, can certainly help with security.

However, you're also describing a complete app rewrite to create the
stumble-able edition of the app. The odds of your convincing
developers to rewrite their app to support your service will be
dependent upon your ability to deliver results. Since your audience
size is dependent upon your ability to deliver apps, you are in a
chicken-and-egg situation that usually requires venture capital to
resolve.

Combine that with Mr. Micinski's recent reply (as he seems to be
writing the same time I am...), and I hope you have a decent-sized
team as well.

If I were you, I'd go a different route. For example, go with a mobile
edition of the Amazon AppStore preview model. AFAIK, they're using
android-x86 instances hosted in their cloud, where they cooked up a
Flash RDP(?) client to connect to those from the browser. You could do
something along those lines, using RDP or VNC in your stumbling app to
peek into the virtualized device running the app in question. Same
zero-install experience, but now your infrastructure is in the cloud,
which you can mock up on home equipment temporarily. You eliminate the
security issues, you eliminate the need for developers to rebuild
their apps to fit your model, etc.

(figuring out the stack for doing this sort of preview is on my
18,000-item to-do list, though I probably would be aiming to replicate
the Web-based client)

On Sun, Dec 4, 2011 at 5:47 PM, klewelling  wrote:
>
>> I don't completely follow your description, sorry. You're using too
>> many terms ("the app", "host APK", "UI APK", "dynamic apps") that you
>> know how they relate, but I don't. Perhaps I'm just being thick.
>
> Ya what I wrote was a bit stream-of-consciousness. Let me try again.
>
> Here is my suggestion for a more secure model. The stumbleUpon like
> service involves installing two apks, a UI apk and a Host apk.  The UI
> apk has a lot of permissions including access to the internet and has
> a "Next App" button. A second host apk has a limited set of
> permissions, basically no direct access to the network, SMS, or
> personally identifying information. When the user want to "stumble"
> onto a new app they click the "Next App" button and the UI app
> downloads the trial app which is then transferred to the host app via
> a Service. The host app then loads the trial app. When/if the trial
> app needs a resource the host does not have (SMS, network, contacts,
> etc) it will ask the UI apk which does have the permissions (assume
> the trial app uses a different API to make its requests). The UI app
> receives the requests and asks the user via a dialog if it is OK to
> allow the trial app access to the requested resource. For example the
> UI app may pop up a dialog and say "App xyz wants to send a text
> message. OK or Cancel". If the app does not request access from the UI
> app and instead tries to directly access a resource the android
> security model will kick it and throw an exception.  I know there are
> performance and usability issues with what I described, but from a
> security point of view what are your thoughts?
>
> --
> 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



-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training...At Your Office: http://commonsware.com/training

-- 
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


Re: [android-developers] Re: Mobile app discovery

2011-12-04 Thread Kristopher Micinski
On Sun, Dec 4, 2011 at 5:47 PM, klewelling  wrote:

>
> > I don't completely follow your description, sorry. You're using too
> > many terms ("the app", "host APK", "UI APK", "dynamic apps") that you
> > know how they relate, but I don't. Perhaps I'm just being thick.
>
> Ya what I wrote was a bit stream-of-consciousness. Let me try again.
>
> Here is my suggestion for a more secure model. The stumbleUpon like
> service involves installing two apks, a UI apk and a Host apk.  The UI
> apk has a lot of permissions including access to the internet and has
> a "Next App" button. A second host apk has a limited set of
> permissions, basically no direct access to the network, SMS, or
> personally identifying information. When the user want to "stumble"
> onto a new app they click the "Next App" button and the UI app
> downloads the trial app which is then transferred to the host app via
> a Service. The host app then loads the trial app. When/if the trial
> app needs a resource the host does not have (SMS, network, contacts,
> etc) it will ask the UI apk which does have the permissions (assume
> the trial app uses a different API to make its requests).


How?  Have you thought about the fact that certain apps will have calls to
find out if they have a permission, and if they don't the app will not
behave the same?

How do you host the app via a service?  Marshalling instrumentation calls
over IPC?

The UI app
> receives the requests and asks the user via a dialog if it is OK to
> allow the trial app access to the requested resource.


Okay, but how do you catch the app when it tries to access that resource?
 What happens if the app tries to access the network, sets a timeout, and
the user doesn't press the "okay" button in time?


> For example the
> UI app may pop up a dialog and say "App xyz wants to send a text
> message. OK or Cancel".


So you also have to halt the main app's UI, how do you plan to do that?


> If the app does not request access from the UI
> app and instead tries to directly access a resource the android
> security model will kick it and throw an exception.


True.


>  I know there are
> performance and usability issues with what I described, but from a
> security point of view what are your thoughts?


My thoughts are that there are a lot of implementation issues you're not
thinking about that will make this extremely complicated.

Kris

-- 
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

[android-developers] Re: How to READ a MODE_WORLD_READABLE file from ANOTHER application

2011-12-04 Thread Saied
wow. that was dumb of me!! Thanks for pointing it out.

so I changed it to:

@Override
public AssetFileDescriptor openAssetFile(Uri uri, String mode) {
String fileName = "asset_text_orig.txt";   // hardcoding the
file name for now

AssetManager assetManager = getAssets();
AssetFileDescriptor afd = assetManager.openFd(fileName);
return afd;
}

and it WORKS!!

Thank you VERY much for your help and indulgence!

On Dec 4, 2:09 pm, skink  wrote:
> Saied wrote:
> > Thanks again!
>
> > Actually, this seems to be working on the ContentProvider now:
>
> > public AssetFileDescriptor openAssetFile(Uri uri, String mode) {
> >            String fileName = "asset_text_orig.txt";
> >            URI uri1 = URI.create(fileName);
> >            AssetFileDescriptor parcel =  this.openAssetFile(uri1, mode);  //
> > for testing purposes, I hardwired this to uri1 >
> > "asset_text_orig.txt";
> >            return parcel;
> >    }
>
> it will not work since you call openAssetFile recursively and you will
> get stack overflow error
>
>
>
>
>
>
>
>
>
> > Now, how do I read this from an app?
>
> >            String packageName = "com.example.text.cp";
> >            FileInputStream fstream = new FileInputStream("content://" +
> > packageName); // there is only one kind of file exposed
> >    DataInputStream in = new DataInputStream(fstream);
> >    BufferedReader br = new BufferedReader(new InputStreamReader(in));
> >    String strLine = br.readLine();
>
> >    ...
>
> > Or should I include openAssetFile(Uri uri, String mode) at the end of
> > the uri goint to FileInputStream?
>
> > Thank you very much for your help so far.
>
> seehttp://developer.android.com/guide/topics/providers/content-providers...
>
> pskink

-- 
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


Re: [android-developers] Re: Mobile app discovery

2011-12-04 Thread Jim Graham
On Sun, Dec 04, 2011 at 02:53:25PM -0800, klewelling wrote:
> Why_More_Is_Less

And, as almost every Unix user knows, less is better than more.  :-)

(Sorry, couldn't resist.)

Later,
   --jim

-- 
THE SCORE:  ME:  2  CANCER:  0
73 DE N5IAL (/4)| Peter da Silva:  No, try "rm -rf /"
spooky1...@gmail.com| Dave Aronson:As your life flashes before
< Running FreeBSD 7.0 > |  your eyes, in the unit of time known as an
ICBM / Hurricane:   |  ohnosecond (alt.sysadmin.recovery)
   30.44406N 86.59909W  |

Android Apps Listing at http://www.jstrack.org/barcodes.html

-- 
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


[android-developers] Re: Mobile app discovery

2011-12-04 Thread klewelling
> The UI app
> receives the requests and asks the user via a dialog if it is OK to
> allow the trial app access to the requested resource. For example the
> UI app may pop up a dialog and say "App xyz wants to send a text
> message. OK or Cancel".

I forgot to mention that if the user click OK then the request is
fulfilled (send SMS request) or the result is proxied back to the
trial app (query contacts).

-- 
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


[android-developers] Re: Mobile app discovery

2011-12-04 Thread klewelling
I think a central issue involves the paradox of choice (http://
en.wikipedia.org/wiki/The_Paradox_of_Choice:_Why_More_Is_Less) where
too many app options prevent people from trying new things. Thats why
I think a StumbleUpon type service could be so valuable, it involves
no choice. You try an app and if you like it you click an install or
buy it button.

Kenneth

On Dec 4, 4:30 pm, Jim Graham  wrote:
> On Sun, Dec 04, 2011 at 10:32:31AM -0800, klewelling wrote:
> > I don't have the marketing resources to draw mass appeal. Part of the
> > problem are the overcrowded app markets that overwhelm users with
> > choices.
>
> That's part of the problem.  Another part is the lack of a temporary
> home for new apps.  As the market is now, new apps must be in the
> top-rated category before they're even released, otherwise they get
> a few hours of being displayed, then they're gone for good, and rely
> only on people searching for your app that they don't know exists, or
> keyword searches that might or might not display your app (without
> users knowing that there's a little button up there to display the
> rest of the matches, where your app might be hiding).
>
> Perhaps a section in the market for NEW apps (NOT UPDATES), with
> categories for apps vs games, and under those, subcategories for
> different types of apps and types of games.  They could then be sorted
> by age (newest first), not ratings, and stay there for some set period
> of time (such as, one month).
>
> Then, the apps with high ratings can be moved into the existing top-rated
> sections as appropriate.
>
> Sound reasonable?  Yeah, I know...it'll never happen...at least, not on
> the Google market, that is
>
> Later,
>    --jim
>
> --
> THE SCORE:  ME:  2  CANCER:  0
> 73 DE N5IAL (/4)            MiSTie #49997      < Running FreeBSD 7.0 >
> spooky1...@gmail.com                    ICBM/Hurr.: 30.44406N 86.59909W
>
>           "The iPad is a status symbol for yuppies. The Android
>          is for people who actually want something that works."
>
> Android Apps Listing athttp://www.jstrack.org/barcodes.html

-- 
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


[android-developers] Re: Mobile app discovery

2011-12-04 Thread klewelling

> I don't completely follow your description, sorry. You're using too
> many terms ("the app", "host APK", "UI APK", "dynamic apps") that you
> know how they relate, but I don't. Perhaps I'm just being thick.

Ya what I wrote was a bit stream-of-consciousness. Let me try again.

Here is my suggestion for a more secure model. The stumbleUpon like
service involves installing two apks, a UI apk and a Host apk.  The UI
apk has a lot of permissions including access to the internet and has
a "Next App" button. A second host apk has a limited set of
permissions, basically no direct access to the network, SMS, or
personally identifying information. When the user want to "stumble"
onto a new app they click the "Next App" button and the UI app
downloads the trial app which is then transferred to the host app via
a Service. The host app then loads the trial app. When/if the trial
app needs a resource the host does not have (SMS, network, contacts,
etc) it will ask the UI apk which does have the permissions (assume
the trial app uses a different API to make its requests). The UI app
receives the requests and asks the user via a dialog if it is OK to
allow the trial app access to the requested resource. For example the
UI app may pop up a dialog and say "App xyz wants to send a text
message. OK or Cancel". If the app does not request access from the UI
app and instead tries to directly access a resource the android
security model will kick it and throw an exception.  I know there are
performance and usability issues with what I described, but from a
security point of view what are your thoughts?

-- 
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


[android-developers] Why doesn't layout_alignCenterInParent work?

2011-12-04 Thread Christopher Van Kirk
I've tried several times now to use android:layout_alignCenterInParent 
to center a child in its parent RelativeLayout view, but it never seems 
to work.


What's wrong with this code, and why doesn't it center the GridView in 
the outer RelativeView?



http://schemas.android.com/apk/res/android";
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>



--
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


Re: [android-developers] Mobile app discovery

2011-12-04 Thread Jim Graham
On Sun, Dec 04, 2011 at 10:32:31AM -0800, klewelling wrote:

> I don't have the marketing resources to draw mass appeal. Part of the
> problem are the overcrowded app markets that overwhelm users with
> choices.

That's part of the problem.  Another part is the lack of a temporary
home for new apps.  As the market is now, new apps must be in the
top-rated category before they're even released, otherwise they get
a few hours of being displayed, then they're gone for good, and rely
only on people searching for your app that they don't know exists, or
keyword searches that might or might not display your app (without
users knowing that there's a little button up there to display the
rest of the matches, where your app might be hiding).

Perhaps a section in the market for NEW apps (NOT UPDATES), with
categories for apps vs games, and under those, subcategories for
different types of apps and types of games.  They could then be sorted
by age (newest first), not ratings, and stay there for some set period
of time (such as, one month).

Then, the apps with high ratings can be moved into the existing top-rated
sections as appropriate.

Sound reasonable?  Yeah, I know...it'll never happen...at least, not on
the Google market, that is

Later,
   --jim

-- 
THE SCORE:  ME:  2  CANCER:  0
73 DE N5IAL (/4)MiSTie #49997  < Running FreeBSD 7.0 >
spooky1...@gmail.comICBM/Hurr.: 30.44406N 86.59909W

  "The iPad is a status symbol for yuppies. The Android
 is for people who actually want something that works."

Android Apps Listing at http://www.jstrack.org/barcodes.html

-- 
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


Re: [android-developers] Re: Mobile app discovery

2011-12-04 Thread Mark Murphy
On Sun, Dec 4, 2011 at 5:17 PM, klewelling  wrote:
> Getting back to the StumbleUpon-style service I believe a lot of the
> security issues can be reduced by limiting the permissions available
> to the dynamic applications. Split the app into two pieces, a UI APK
> and a host APK. They are signed with different certs so they are
> independent. The host APK has a limited set of permissions (no SMS,
> network, etc). The dynamic apps must route all network, sms, contact,
> etc requests to the UI apk. The UI apk then asks the user if the
> request is ok. Ignoring performance and usability issues and focusing
> on the security issue, does this sound secure?

I don't completely follow your description, sorry. You're using too
many terms ("the app", "host APK", "UI APK", "dynamic apps") that you
know how they relate, but I don't. Perhaps I'm just being thick.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training...At Your Office: http://commonsware.com/training

-- 
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


[android-developers] Re: Mobile app discovery

2011-12-04 Thread klewelling


>
> I think there are other patterns for this, like betas, that have
> worked with success. Also, what you're describing is a more controlled
> scenario than what I inferred from a StumbleUpon-style service.
>

Yes those were very different than a StumbleUpon-style service. I was
listing some other possible uses of the technology that hopefully
didn't raise as many security issues.

Getting back to the StumbleUpon-style service I believe a lot of the
security issues can be reduced by limiting the permissions available
to the dynamic applications. Split the app into two pieces, a UI APK
and a host APK. They are signed with different certs so they are
independent. The host APK has a limited set of permissions (no SMS,
network, etc). The dynamic apps must route all network, sms, contact,
etc requests to the UI apk. The UI apk then asks the user if the
request is ok. Ignoring performance and usability issues and focusing
on the security issue, does this sound secure?

Kenneth

-- 
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


[android-developers] Re: How to READ a MODE_WORLD_READABLE file from ANOTHER application

2011-12-04 Thread skink


Saied wrote:
> Thanks again!
>
> Actually, this seems to be working on the ContentProvider now:
>
> public AssetFileDescriptor openAssetFile(Uri uri, String mode) {
>   String fileName = "asset_text_orig.txt";
>   URI uri1 = URI.create(fileName);
>   AssetFileDescriptor parcel =  this.openAssetFile(uri1, mode);  
> //
> for testing purposes, I hardwired this to uri1 >
> "asset_text_orig.txt";
>   return parcel;
>   }
>

it will not work since you call openAssetFile recursively and you will
get stack overflow error


> Now, how do I read this from an app?
>
>   String packageName = "com.example.text.cp";
>   FileInputStream fstream = new FileInputStream("content://" +
> packageName); // there is only one kind of file exposed
>   DataInputStream in = new DataInputStream(fstream);
>   BufferedReader br = new BufferedReader(new InputStreamReader(in));
>   String strLine = br.readLine();
>
>   ...
>
> Or should I include openAssetFile(Uri uri, String mode) at the end of
> the uri goint to FileInputStream?
>
> Thank you very much for your help so far.
>
>
>

see http://developer.android.com/guide/topics/providers/content-providers.html

pskink

-- 
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


Re: [android-developers] Re: Mobile app discovery

2011-12-04 Thread Mark Murphy
On Sun, Dec 4, 2011 at 3:38 PM, klewelling  wrote:
>> > I understand you have some technical reservations but that
>> > is for me to worry about:)
>>
>> I'm sure that CarrierIQ thinks the same thing.
>>
>> Surprisingly enough, I disagree with that opinion.
>
> Ouch! I don't think I made my point clear. By saying you had technical
> reservations I wasn't referring to the security I was referring to the
> application virtualization which you said "Only by writing custom
> firmware, AFAIK.". You security concerns are very valid. Sorry for the
> confusion.

Ah, OK. I interpreted your statement as more of "sod off", as the
British might say. My apologies for my confusion.

> For example I have an idea for a new
> feature or layout design I want to see how people react. I make the
> changes to my app and then distribute the new app to a small percent
> of users. You can do this on an opt in basis. Then use analytics to
> determine if users like the change or not. If they do like it update
> the apk to the market to be distributed to everyone.

I think there are other patterns for this, like betas, that have
worked with success. Also, what you're describing is a more controlled
scenario than what I inferred from a StumbleUpon-style service.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training...At Your Office: http://commonsware.com/training

-- 
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


Re: [android-developers] Re: Mobile app discovery

2011-12-04 Thread Kristopher Micinski
On Sun, Dec 4, 2011 at 3:18 PM, Mark Murphy  wrote:

> On Sun, Dec 4, 2011 at 2:49 PM, klewelling  wrote:
> To echo Mr. Micinski's reply, I have no problem with more social tools
> for app discovery, so long as they do not introduce security and
> privacy issues. And there may be excellent uses of your APK-in-an-APK
> techniques for user+developer controlled circumstances (e.g., plugins
> for a main app).


I definitely agree with the commons guy on his last statement there!

kris

-- 
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

[android-developers] Re: an app with web-services

2011-12-04 Thread juliagrig
I would like to know the basic steps to do something like that.
This can be done by more than one way?
I would appreciate if you give me some information, such if additional
libraries are used, what exactly is good to read to understand what
elements are used and why. Also, I need to create a service and then
call her?
Sorry if my questions are simple, but I have no mind how to begin.
Do I have to read "Web Service Definition Language (WSDL)"?


On 4 Δεκ, 21:42, Michael Banzon  wrote:
> It is indeed possible.
>
> Where do you want to start??
>
>
>
>
>
>
>
>
>
> On Sun, Dec 4, 2011 at 6:51 PM, juliagrig  wrote:
> > Hi all,
> > I would like to know, how I could make an application which will be
> > linked to a web server and use web services.
> > Could you help me to make a beginning, because I have not dealt at all
> > with a similar issue in the past.
>
> > Thanks in advance.
>
> > --
> > 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
>
> --
> Michael Banzonhttp://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


[android-developers] Re: Mobile app discovery

2011-12-04 Thread klewelling


On Dec 4, 2:18 pm, Mark Murphy  wrote:
> On Sun, Dec 4, 2011 at 2:49 PM, klewelling  wrote:
> > My take-away from your comments is that a fundamental risk is
> > security. I understand you have some technical reservations but that
> > is for me to worry about:)
>
> I'm sure that CarrierIQ thinks the same thing.
>
> Surprisingly enough, I disagree with that opinion.

Ouch! I don't think I made my point clear. By saying you had technical
reservations I wasn't referring to the security I was referring to the
application virtualization which you said "Only by writing custom
firmware, AFAIK.". You security concerns are very valid. Sorry for the
confusion.

>
> > You are of course correct that every APK
> > executing in the host will have the same rights and abilities. Is your
> > main concern  that one or more of the APKs will take advantage of what
> > is essentially privilege escalation? The risk of privilege escalation
> > is obviously malware where an app sends SMS's and/or uploads private
> > information. The challenge is to prevent or stop this kind of
> > behavior. Is this analysis correct?
>
> That's certainly a starting point on the security front. Bear in mind
> that it's not only things the apps do explicitly that might be a
> problem, but any security flaws in the apps you are hosting will be
> magnified by the vast array of permissions your host app will require.
> There may be more issues than this -- I haven't exactly given this
> scenario tons of thought recently.
>
> To echo Mr. Micinski's reply, I have no problem with more social tools
> for app discovery, so long as they do not introduce security and
> privacy issues. And there may be excellent uses of your APK-in-an-APK
> techniques for user+developer controlled circumstances (e.g., plugins
> for a main app).
>

What do you think about treating your entire app as a plugin so you
can perform true A/B testing? For example I have an idea for a new
feature or layout design I want to see how people react. I make the
changes to my app and then distribute the new app to a small percent
of users. You can do this on an opt in basis. Then use analytics to
determine if users like the change or not. If they do like it update
the apk to the market to be distributed to everyone.

You can take this even further and take over distribution completely
and even do continuous deployment. I think this could work well in a
corporate environment.

-- 
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


[android-developers] Re: How to READ a MODE_WORLD_READABLE file from ANOTHER application

2011-12-04 Thread Saied
Thanks again!

Actually, this seems to be working on the ContentProvider now:

public AssetFileDescriptor openAssetFile(Uri uri, String mode) {
String fileName = "asset_text_orig.txt";
URI uri1 = URI.create(fileName);
AssetFileDescriptor parcel =  this.openAssetFile(uri1, mode);  
//
for testing purposes, I hardwired this to uri1 >
"asset_text_orig.txt";
return parcel;
}

Now, how do I read this from an app?

String packageName = "com.example.text.cp";
FileInputStream fstream = new FileInputStream("content://" +
packageName); // there is only one kind of file exposed
DataInputStream in = new DataInputStream(fstream);
BufferedReader br = new BufferedReader(new InputStreamReader(in));
String strLine = br.readLine();

...

Or should I include openAssetFile(Uri uri, String mode) at the end of
the uri goint to FileInputStream?

Thank you very much for your help so far.



On Dec 3, 11:30 am, skink  wrote:
> Saied wrote:
> > Thanks Pskink!
>
> > Per your suggestion, I have created a content provider and tried this:
>
> > @Override
> >    public AssetFileDescriptor openAssetFile1(Uri uri, String mode) {
> >            String fileName = "asset_text_orig.txt";
> >            ParcelFileDescriptor parcel = openAssetFile(fileName,
> > ParcelFileDescriptor.MODE_READ_ONLY);
>
> >            return parcel;
> >    }
>
> > there is a conflict as parcel  type is ParcelFileDescriptor, but I
> > need to return AssetFileDescriptor. How do I resolve that.
>
> > And once this is corrected? How do I read this?
>
> > Thanks.
>
> > On Dec 3, 9:21 am, skink  wrote:
> > > Saied wrote:
> > > > Thanks.
>
> > > > I did create a contentProvider with a single asset file.
>
> > > > I also tried  ParcelFileDescriptor
>
> > > > @Override
> > > > public ParcelFileDescriptor openFile(Uri uri, String mode) throws
> > > > FileNotFoundException{
> > > > ...
> > > > ParcelFileDescriptor parcel = ParcelFileDescriptor.open(file,
> > > > ParcelFileDescriptor.MODE_READ_ONLY);
> > > > return parcel;
> > > > }
>
> > > > but  could not make it work. Then thought just making a regular app
> > > > would be less tricky.
> > > > Now I do have the app which WRITES a worldReadable file that I can
> > > > read from my other app.
> > > > But there is that extra step I am trying to avoid.
>
> > > > I understand reading the asset file may be impossible.
>
> > > > Would it be easier if I read a raw file?
>
> > > > Or should I definitely go back to making a content provider and try to
> > > > read its asset?
>
> > > > Thank you very muchfor your help.
>
> > > create custom ContententProvider and try to override openAssetFile()
> > > method
>
> > > pskink
>
> use this: developer.android.com/reference/android/content/res/
> AssetManager.html#openFd(java.lang.String)
>
> pskink

-- 
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


[android-developers] Re: Mobile app discovery

2011-12-04 Thread klewelling
kris,

Thanks for your comments. By saying "just a 'social app discovery'
service" you imply that app discovery is not important to you. How
would you rate app discovery with respect to other developer concerns?
My main point of my original post was to gauge interest. I don't mind
having a technical debate but if I am trying to build something no one
wants then the technical discussions are pointless.

As a mobile developer here are my major concerns:

App discoverability
Can’t do true A/B Testing on a mobile platform. I want the ability to
push different versions of my app to a subset of my users and gauge
their usage. Pre-baking multiple version of an app to be distributed
is a pretty poor way to do A/B Testing in my opinion.
Getting valuable metrics from mobile platforms is difficult. You have
to know what your looking for before deployment and instrument your
app accordingly which is usually done poorly as an after though.


Kenneth

On Dec 4, 1:52 pm, Kristopher Micinski  wrote:
> On Sun, Dec 4, 2011 at 2:49 PM, klewelling  wrote:
> > My take-away from your comments is that a fundamental risk is
> > security. I understand you have some technical reservations but that
> > is for me to worry about:) You are of course correct that every APK
> > executing in the host will have the same rights and abilities. Is your
> > main concern  that one or more of the APKs will take advantage of what
> > is essentially privilege escalation? The risk of privilege escalation
> > is obviously malware where an app sends SMS's and/or uploads private
> > information. The challenge is to prevent or stop this kind of
> > behavior. Is this analysis correct?
>
> I think Mark's comments mean this:
>   -- Are you prepared to reinvent the entire android security system just
> for your app
>   -- That seems like a lot of work for something that is just a "social app
> discovery" service
>   -- If you do it wrong you're inviting badness.
>
> kris

-- 
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


Re: [android-developers] Re: Mobile app discovery

2011-12-04 Thread Mark Murphy
On Sun, Dec 4, 2011 at 2:49 PM, klewelling  wrote:
> My take-away from your comments is that a fundamental risk is
> security. I understand you have some technical reservations but that
> is for me to worry about:)

I'm sure that CarrierIQ thinks the same thing.

Surprisingly enough, I disagree with that opinion.

> You are of course correct that every APK
> executing in the host will have the same rights and abilities. Is your
> main concern  that one or more of the APKs will take advantage of what
> is essentially privilege escalation? The risk of privilege escalation
> is obviously malware where an app sends SMS's and/or uploads private
> information. The challenge is to prevent or stop this kind of
> behavior. Is this analysis correct?

That's certainly a starting point on the security front. Bear in mind
that it's not only things the apps do explicitly that might be a
problem, but any security flaws in the apps you are hosting will be
magnified by the vast array of permissions your host app will require.
There may be more issues than this -- I haven't exactly given this
scenario tons of thought recently.

To echo Mr. Micinski's reply, I have no problem with more social tools
for app discovery, so long as they do not introduce security and
privacy issues. And there may be excellent uses of your APK-in-an-APK
techniques for user+developer controlled circumstances (e.g., plugins
for a main app).

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training...At Your Office: http://commonsware.com/training

-- 
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


Re: [android-developers] Re: Mobile app discovery

2011-12-04 Thread Kristopher Micinski
On Sun, Dec 4, 2011 at 2:49 PM, klewelling  wrote:

> My take-away from your comments is that a fundamental risk is
> security. I understand you have some technical reservations but that
> is for me to worry about:) You are of course correct that every APK
> executing in the host will have the same rights and abilities. Is your
> main concern  that one or more of the APKs will take advantage of what
> is essentially privilege escalation? The risk of privilege escalation
> is obviously malware where an app sends SMS's and/or uploads private
> information. The challenge is to prevent or stop this kind of
> behavior. Is this analysis correct?
>

I think Mark's comments mean this:
  -- Are you prepared to reinvent the entire android security system just
for your app
  -- That seems like a lot of work for something that is just a "social app
discovery" service
  -- If you do it wrong you're inviting badness.

kris

-- 
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

[android-developers] Re: Mobile app discovery

2011-12-04 Thread klewelling
My take-away from your comments is that a fundamental risk is
security. I understand you have some technical reservations but that
is for me to worry about:) You are of course correct that every APK
executing in the host will have the same rights and abilities. Is your
main concern  that one or more of the APKs will take advantage of what
is essentially privilege escalation? The risk of privilege escalation
is obviously malware where an app sends SMS's and/or uploads private
information. The challenge is to prevent or stop this kind of
behavior. Is this analysis correct?

Kenneth

On Dec 4, 1:10 pm, Mark Murphy  wrote:
> On Sun, Dec 4, 2011 at 2:01 PM, klewelling  wrote:
> > Thanks for the feedback. There are definitively security issues to
> > work out. APKs can be multi-process which can be used to isolate the
> > dynamic apks at runtime.
>
> Not really. The secondary process has all the rights and abilities of
> the original process.
>
> > An application virtualization layer can be
> > used to keep the apks from writing over each other's files
>
> Only by writing custom firmware, AFAIK.
>
> > and the
> > APKs themselves can be vetted for malicious code and mis-behaving
> > apps.
>
> If you say so.
>
> Having more social means of discovering apps is great, but not at the
> cost of security.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> Android Training...At Your Office:http://commonsware.com/training

-- 
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


Re: [android-developers] an app with web-services

2011-12-04 Thread Michael Banzon
It is indeed possible.

Where do you want to start??

On Sun, Dec 4, 2011 at 6:51 PM, juliagrig  wrote:
> Hi all,
> I would like to know, how I could make an application which will be
> linked to a web server and use web services.
> Could you help me to make a beginning, because I have not dealt at all
> with a similar issue in the past.
>
> Thanks in advance.
>
> --
> 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



-- 
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


[android-developers] Problems reading/writing to SQLite db on SD card.

2011-12-04 Thread MarkG123
Hi, writing an Android application that reads data from a SQLite
database created by a 3rd party camera.

I have added permission WRITE_EXTERNAL_STORAGE, but I still get
"attempt to write a readonly database" exception

I have tried different API levels and such, without any
difference.  I have checked the SDCard in the emulator isn't
readonly.

Code Snippet:

public class DatabaseHelper
{

public static final String  DATABASE_NAME  = "MISC/EREVIEW.DB";
public static final String  SHARE_TABLE = "Share";
public static final String  PICTURE_TABLE   = "Picture";

private SQLiteDatabase  database;
private File sdDir = Environment.getExternalStorageDirectory();

public DatabaseHelper()
{
try
{
database = SQLiteDatabase.openDatabase(sdDir +
File.separator + DATABASE_NAME, null,SQLiteDatabase.OPEN_READWRITE);
}
catch (SQLiteException ex)
{
Log.e(TAG, "error -- " + ex.getMessage(), ex);
}
finally
{
DBUtil.safeCloseDataBase(database);
}
}
}

-- 
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


Re: [android-developers] Re: Mobile app discovery

2011-12-04 Thread Mark Murphy
On Sun, Dec 4, 2011 at 2:01 PM, klewelling  wrote:
> Thanks for the feedback. There are definitively security issues to
> work out. APKs can be multi-process which can be used to isolate the
> dynamic apks at runtime.

Not really. The secondary process has all the rights and abilities of
the original process.

> An application virtualization layer can be
> used to keep the apks from writing over each other's files

Only by writing custom firmware, AFAIK.

> and the
> APKs themselves can be vetted for malicious code and mis-behaving
> apps.

If you say so.

Having more social means of discovering apps is great, but not at the
cost of security.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training...At Your Office: http://commonsware.com/training

-- 
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


[android-developers] Re: Mobile app discovery

2011-12-04 Thread klewelling
Thanks for the feedback. There are definitively security issues to
work out. APKs can be multi-process which can be used to isolate the
dynamic apks at runtime. An application virtualization layer can be
used to keep the apks from writing over each other's files and the
APKs themselves can be vetted for malicious code and mis-behaving
apps. I don't have all the answers so I appreciate the opportunity to
think these issues through.

Kenneth

On Dec 4, 12:38 pm, Mark Murphy  wrote:
> On Sun, Dec 4, 2011 at 1:32 PM, klewelling  wrote:
> > I have developed a technology that allows a host app to
> > download and run APKs in its own process.
>
> That is *so* not a good idea. The backbone of Android security is
> process isolation.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> Android Training...At Your Office:http://commonsware.com/training

-- 
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


Re: [android-developers] Mobile app discovery

2011-12-04 Thread Mark Murphy
On Sun, Dec 4, 2011 at 1:32 PM, klewelling  wrote:
> I have developed a technology that allows a host app to
> download and run APKs in its own process.

That is *so* not a good idea. The backbone of Android security is
process isolation.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training...At Your Office: http://commonsware.com/training

-- 
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


[android-developers] Mobile app discovery

2011-12-04 Thread klewelling
I am collecting information about difficulties related to app
discovery on mobile platforms. I released my Android app Text Easy in
2008, and while I have had some modest success, I don’t have the
marketing resources to draw mass appeal. Part of the problem are the
overcrowded app markets that overwhelm users with choices. The only
practical way of being discovered in one of the app markets is to be
featured and the chances of that are slim. I want to create a service
similar to StumbleUpon that features mobile apps rather than web-
pages. I have developed a technology that allows a host app to
download and run APKs in its own process.  My vision is to create a
service that provides the same discoverability opportunities for apps
with small budgets as those apps with unlimited budgets. I want to
interview developers to discuss app discoverability and solutions.
Please respond to this post or email me if you are interested.

Kenneth Lewelling

-- 
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


[android-developers] Re: SDK 4, R15, where is the navigation button?

2011-12-04 Thread Lew
You know, you  asked this question on Oct. 28.  Now you're "bumping" it, 
yet again, as of Nov. 15.  I write this on Dec. 4.  Googling this 
information would have been faster.

To make sure I am not full of it, I used 
http://lmgtfy.com/?q=Android+Ice+Cream+Sandwich+missing+back+and+home+buttons
and found a number of hits pertaining to your question, including 
workarounds.

You may have to tweak the query to get exactly what you're looking for, but 
my experiment indicates that this question is eminently googleable.

GIYF.

-- 
Lew

On Tuesday, November 15, 2011 10:23:32 AM UTC-8, sblantipodi wrote:
>
> bump. 
>
> On Nov 9, 12:12 am, sblantipodi  wrote: 
> > I mean the three button we see in ICS, the back, the home and the 
> > recent. 
> > 
> > On Nov 8, 10:08 pm, Chris Stewart  wrote: 
> > > I suspect you mean the menu button.  I believe, and could be very 
> wrong, 
> > > but if you're using Android 4.0 and on a display of 720p or better 
> (e.g., 
> > > Galaxy Nexus), you won't see that button. 
> > 
> > > On Tue, Nov 8, 2011 at 1:56 PM, Kumar Bibek  
> wrote: 
> > > > What do you mean by the navigation button? 
> > 
> > > > On Nov 8, 11:54 pm, sblantipodi  wrote: 
> > > > > bump 
> > 
> > > > > On Nov 1, 3:17 pm, sblantipodi  wrote: 
> > 
> > > > > > Bumping the question until I'll get an answer. 
>
>
Nag, nag, nag.
 

-- 
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

[android-developers] C2DM - frequent “timeouts” or errors when sending; webservice does not respond

2011-12-04 Thread Ted
Hey,
I just posted this on StackOverflow, thought I'd post it here too.

http://stackoverflow.com/questions/8377185/c2dm-frequent-timeouts-or-errors-when-sending-webservice-does-not-respond

So I have set up a connection to Googles C2DM system. It works - sort
of.

When I ask C2DM to "ping" my Android device, it does so sometimes, but
far from always. The problem shows itself on the server-side of
things.

Usually, the first "ping" (after the server has started) goes through.
I get a response immediately after I call the webservice and shortly
thereafter the "ping" shows up on my Android device.

However, if I shortly after the first "ping" again tell my server to
send a "ping", the webservice call fails. It never manages to call the
C2DM and after a while I get a WebException (C#) saying the following:

The underlying connection was closed: An unexpected error occurred on
a receive.

No other information is there. If I then try to send again, also that
call is blocked.

I change nothing in the code, sometimes it manages to call the
webservice and sometimes it doesnt. It seems to me there is a
"timeout" for calling the Google webservice. If you call it, you need
to wait for X seconds before calling again otherwise it just won't
return an answer and give the exception. Thats just a guess...

Any ideas?

The code I am using to send can be found at SO:
http://stackoverflow.com/questions/8377185/c2dm-frequent-timeouts-or-errors-when-sending-webservice-does-not-respond

-- 
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


[android-developers] an app with web-services

2011-12-04 Thread juliagrig
Hi all,
I would like to know, how I could make an application which will be
linked to a web server and use web services.
Could you help me to make a beginning, because I have not dealt at all
with a similar issue in the past.

Thanks in advance.

-- 
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


Re: [android-developers] Re: database connectivity on real device

2011-12-04 Thread Narendra Singh Rathore
Now that you achieved that, do the following test:  Take out the SD card
> and run your app.
>
>
I will definitely give that test later, and hopefully will achieve that.
anyways thanx for the challenging test. :)

-- 
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

[android-developers] Re: Fail to connect to camera service

2011-12-04 Thread Pedro Teixeira
Yes that's the only way I know how to do it. I'll try to contact them
and hear what they have to say about it. Thank you

On Dec 4, 3:20 pm, Mark Murphy  wrote:
> On Sun, Dec 4, 2011 at 10:10 AM, Pedro Teixeira
>
>  wrote:
> > I'm almost sure the problem is as you mentioned that thecamerais
> > already in use.
>
> > I'm going from an activity that uses thecamera(wikitude applicaiton)
> > to an activity that still uses thecamera(my own).
>
> > I'm not sure what are my options here:
> > Am I able to continue without releasing thecameraor do I have to
> > release thecameraand then start again?
>
> Unless you want problems (technical or user), activities should
> release theCamerain onPause(), or at the very latest onStop(). If
> Wikitude is not doing this, and Wikitude is starting your activity,
> then you need to talk to the authors of Wikitude.
>
> > Another issue that I'm having is that I can't seem to find any code on
> > wikitude demonstration example that starts thecameraso I'm not even
> > sure how to stop it.
>
> Presumably, they have a support board or email address or something.
>
> > Is there any general or standard mode of doing this? I mean.. release
> > thecameraindependently from which activity I'm on at the moment?
>
> You can only release cameras that you open. If you open in (onStart()
> or onResume()), you release it (onPause() or onStop()).
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> Android Training...At Your Office:http://commonsware.com/training

-- 
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


Re: [android-developers] Re: Fail to connect to camera service

2011-12-04 Thread Mark Murphy
On Sun, Dec 4, 2011 at 10:10 AM, Pedro Teixeira
 wrote:
> I'm almost sure the problem is as you mentioned that the camera is
> already in use.
>
> I'm going from an activity that uses the camera (wikitude applicaiton)
> to an activity that still uses the camera (my own).
>
> I'm not sure what are my options here:
> Am I able to continue without releasing the camera or do I have to
> release the camera and then start again?

Unless you want problems (technical or user), activities should
release the Camera in onPause(), or at the very latest onStop(). If
Wikitude is not doing this, and Wikitude is starting your activity,
then you need to talk to the authors of Wikitude.

> Another issue that I'm having is that I can't seem to find any code on
> wikitude demonstration example that starts the camera so I'm not even
> sure how to stop it.

Presumably, they have a support board or email address or something.

> Is there any general or standard mode of doing this? I mean.. release
> the camera independently from which activity I'm on at the moment?

You can only release cameras that you open. If you open in (onStart()
or onResume()), you release it (onPause() or onStop()).

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training...At Your Office: http://commonsware.com/training

-- 
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


[android-developers] Re: Fail to connect to camera service

2011-12-04 Thread Pedro Teixeira
HEy again.

I'm almost sure the problem is as you mentioned that the camera is
already in use.

I'm going from an activity that uses the camera (wikitude applicaiton)
to an activity that still uses the camera (my own).

I'm not sure what are my options here:
Am I able to continue without releasing the camera or do I have to
release the camera and then start again?

Another issue that I'm having is that I can't seem to find any code on
wikitude demonstration example that starts the camera so I'm not even
sure how to stop it.

Is there any general or standard mode of doing this? I mean.. release
the camera independently from which activity I'm on at the moment?

I would appreciate some insight. Thank you in advance.

Pedro

On Nov 28, 12:40 am, Mark Murphy  wrote:
> One place I have encountered that error is if theCamerais already in
> use (by you or another app on thedevice).
>
> On Sun, Nov 27, 2011 at 7:33 PM, Pedro Teixeira
>
>
>
>
>
>  wrote:
> > Hi,
>
> > I have a location based application that depending on the position of
> > the use relating to a certain spot it turns on thecamera. In layman
> > terms, when there's proximity to a place it triggers thecamera.
>
> > If I'm already near the sport when it's suppose to trigger ( I've
> > build a proximity algorithm based on user position (lat,long) and the
> > spot position) thecameramode opens just fine trough an intent that
> > calls the activity where thecameraaccess is implemented.
>
> > But if I'm walking towards the spot and the trigger is set I get an
> > error. This is the logcat:
>
> > 11-27 20:03:42.451: E/AndroidRuntime(1380): Uncaught handler: thread
> > main exiting due to uncaught exception
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):
> > java.lang.RuntimeException:Failto connect tocameraservice
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > android.hardware.Camera.native_setup(Native Method)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > android.hardware.Camera.(Camera.java:85)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > android.hardware.Camera.open(Camera.java:67)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > com.pedroteixeira.thennnow.thenNnowMode.surfaceCreated(thenNnowMode.java:
> > 229)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > android.view.SurfaceView.updateWindow(SurfaceView.java:392)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > android.view.SurfaceView.dispatchDraw(SurfaceView.java:264)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > android.view.ViewGroup.drawChild(ViewGroup.java:1524)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > android.view.ViewGroup.drawChild(ViewGroup.java:1524)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > android.view.View.draw(View.java:6277)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > android.widget.FrameLayout.draw(FrameLayout.java:352)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > android.view.ViewGroup.drawChild(ViewGroup.java:1526)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > android.view.View.draw(View.java:6277)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > android.widget.FrameLayout.draw(FrameLayout.java:352)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > com.android.internal.policy.impl.PhoneWindow
> > $DecorView.draw(PhoneWindow.java:1883)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > android.view.ViewRoot.draw(ViewRoot.java:1332)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > android.view.ViewRoot.performTraversals(ViewRoot.java:1097)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > android.view.ViewRoot.handleMessage(ViewRoot.java:1613)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > android.os.Handler.dispatchMessage(Handler.java:99)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > android.os.Looper.loop(Looper.java:123)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > android.app.ActivityThread.main(ActivityThread.java:4203)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > java.lang.reflect.Method.invokeNative(Native Method)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > java.lang.reflect.Method.invoke(Method.java:521)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > com.android.internal.os.ZygoteInit
> > $MethodAndArgsCaller.run(ZygoteInit.java:791)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > dalvik.system.NativeStart.main(Native Metho

[android-developers] Re: Unique ID, but not IMEI, IMSI, MAC, AndroidID

2011-12-04 Thread Rich
http://developer.android.com/reference/android/provider/Settings.Secure.html#ANDROID_ID

-- 
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

[android-developers]

2011-12-04 Thread Nir Lavi


-- 
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

Re: [android-developers] duplicate and rename package

2011-12-04 Thread Mark Murphy
On Sun, Dec 4, 2011 at 9:27 AM, Mark Murphy  wrote:
> On Sun, Dec 4, 2011 at 9:17 AM, Nikolay Elenkov
>  wrote:
>> I haven't actually used it, but at least int ADT15, there is a 'Rename
>> Application
>> Package' action (right click project, Android Tools->Rename Application
>> Package) . Judging from the preview it looks like it:
>>
>> * changes the package name in the manifest
>> * updates component path in the manifest
>> * changes the R imports to the new package
>>
>> It doesn't change the package of actual class files, but that is easy
>> enough with native Eclipse refactoring.
>
> Oh, hey, I hadn't noticed that -- thanks!

In fact, I happened to be editing a project just now that could stand
a rename, so I tried it. It works just as you indicated -- use the
Rename Application Package, then refactor the source code into the
same package.

Thanks again!

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training...At Your Office: http://commonsware.com/training

-- 
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


Re: [android-developers] duplicate and rename package

2011-12-04 Thread Mark Murphy
On Sun, Dec 4, 2011 at 9:17 AM, Nikolay Elenkov
 wrote:
> I haven't actually used it, but at least int ADT15, there is a 'Rename
> Application
> Package' action (right click project, Android Tools->Rename Application
> Package) . Judging from the preview it looks like it:
>
> * changes the package name in the manifest
> * updates component path in the manifest
> * changes the R imports to the new package
>
> It doesn't change the package of actual class files, but that is easy
> enough with native Eclipse refactoring.

Oh, hey, I hadn't noticed that -- thanks!

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training...At Your Office: http://commonsware.com/training

-- 
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


Re: [android-developers] duplicate and rename package

2011-12-04 Thread Nikolay Elenkov
On Sun, Dec 4, 2011 at 9:51 PM, Mark Murphy  wrote:
> On Sat, Dec 3, 2011 at 11:43 PM, bob  wrote:
>> Let's say you have an Android game.
>
> You have an Android game.
>
>> You want to duplicate the project
>> and change the package name to make a new game.  Is there a simple 20-
>> second way of doing this?  I've tried many methods and somehow this
>> always takes about half an hour of fiddling for something that ought
>> to be trivial.
>
> Assuming that you're using Eclipse:
>
> Step #1. Copy the project directory to a new directory.
>
> Step #2: Import the new copy into Eclipse, giving it a different project name.
>
> Step #3: Fix up the manifest to have the new package, and double-check.
>

I haven't actually used it, but at least int ADT15, there is a 'Rename
Application
Package' action (right click project, Android Tools->Rename Application
Package) . Judging from the preview it looks like it:

* changes the package name in the manifest
* updates component path in the manifest
* changes the R imports to the new package

It doesn't change the package of actual class files, but that is easy
enough with native Eclipse refactoring.

-- 
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


Re: [android-developers] Re: database connectivity on real device

2011-12-04 Thread lbendlin
Now that you achieved that, do the following test:  Take out the SD card 
and run your app.

-- 
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

[android-developers] Re: Is it possible to add rows to the listview from the top?

2011-12-04 Thread lbendlin
not if you are trying to visually please your users, Clear difference 
between Android and iOS here...

-- 
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

Re: [android-developers] duplicate and rename package

2011-12-04 Thread Mark Murphy
On Sat, Dec 3, 2011 at 11:43 PM, bob  wrote:
> Let's say you have an Android game.

You have an Android game.

> You want to duplicate the project
> and change the package name to make a new game.  Is there a simple 20-
> second way of doing this?  I've tried many methods and somehow this
> always takes about half an hour of fiddling for something that ought
> to be trivial.

Assuming that you're using Eclipse:

Step #1. Copy the project directory to a new directory.

Step #2: Import the new copy into Eclipse, giving it a different project name.

Step #3: Fix up the manifest to have the new package, and double-check.

Step #4: Use Eclipse refactoring to move your source code to the new
package, which will handle all of the directory/package statement
changes.

Step #5: Double-check the manifest to ensure that all your components
still have the right android:name attributes after the refactoring.

This will probably be more than 20 seconds but should be less than a
half-hour for reasonable-sized projects.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training...At Your Office: http://commonsware.com/training

-- 
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


[android-developers] Re: getting lattitude and longitude using GPS

2011-12-04 Thread lbendlin
then why do you specify 5m?

-- 
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

[android-developers] Re: SDK 4, R15, where is the navigation button?

2011-12-04 Thread Kumar Bibek
On a phone emulator or a tablet one?

-- 
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


[android-developers] Re: grid view is not showing remote images

2011-12-04 Thread skink


Ratheesh Valamchuzhy wrote:
> i am developing an app which shows thumbnail of images using grid view   i
> created image adapter class to get the thumbnail images , but it is not
> working plse help me(force close)
>
> here is my code
>

you are trying to use BitmapFactory.decodeFile with somethig that
starts with "http://";

it will not work

pskink

-- 
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


[android-developers] Re: Example to use setError in EditText

2011-12-04 Thread Kumar Bibek
Use the addTextChangedListener method on your EditText.

http://developer.android.com/reference/android/widget/TextView.html#addTextChangedListener%28android.text.TextWatcher%29

-- 
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


[android-developers] Re: Pass Data From Activity to All Attached Fragments

2011-12-04 Thread Kumar Bibek
This approach is fine.

-- 
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


[android-developers] Re: MP4 video not working on Google Nexus One

2011-12-04 Thread Kumar Bibek
Moreover, MP4 is not really a video format.

If a file has an mp4 extension, it doesn't necessarily mean that it's
a MP4 format.

So, looking at the actual format/encoding will help you to figure out
if a video will play on a device or not.

As Doug suggested, some device manufacturers go out of the way to
support additional formats. But, ideally, if you are using any videos
for your apps, you should be better off using the core video formats
so that they would play on all 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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] grid view is not showing remote images

2011-12-04 Thread Raghav Sood
Please post the relevant part of the LogCat.

Raghav Sood
Sent from my Nexus S
On Dec 4, 2011 11:29 AM, "Ratheesh Valamchuzhy" 
wrote:

> i am developing an app which shows thumbnail of images using grid view   i
> created image adapter class to get the thumbnail images , but it is not
> working plse help me(force close)
>
> here is my code
>
> package com.playswf;
>
> import java.io.IOException;
> import java.io.InputStream;
> import java.net.HttpURLConnection;
> import java.net.MalformedURLException;
> import java.net.URL;
> import java.util.ArrayList;
>
> import org.json.JSONArray;
> import org.json.JSONException;
> import org.json.JSONObject;
>
> import android.app.Activity;
> import android.content.Context;
> import android.graphics.Bitmap;
> import android.graphics.BitmapFactory;
> import android.os.Bundle;
> import android.util.Log;
> import android.view.View;
> import android.view.ViewGroup;
> import android.widget.BaseAdapter;
> import android.widget.GridView;
> import android.widget.ImageView;
>
> public class playswf extends Activity {
>String[] imageURLs = new String[100];
>Bitmap bitmap;
>ArrayListlist=new  ArrayList();
>   public  JSONObject json;
>  int   count;
> //  String[] mylist =new String[100];
>
> //private ImageAdapter imageAdapter;
>  /** Called when the activity is first created. */
>  @Override
> public void onCreate(Bundle savedInstanceState) {
> super.onCreate(savedInstanceState);
>  setContentView(R.layout.main);
> //getimageurl();
>  GridView sdcardImages = (GridView) findViewById(R.id.gridview);
> list.add("
> http://works.sodprojects.com/mobile/$userfiles/thumb_82_431_39.jpg";);
>  list.add("
> http://works.sodprojects.com/mobile/$userfiles/thumb_82_431_39.jpg";);
>  list.add("
> http://works.sodprojects.com/mobile/$userfiles/thumb_82_431_39.jpg";);
> sdcardImages.setAdapter(new ImageAdapter(this));
>  //  Toast.makeText(getBaseContext(),
> //  " selected"+ list.toString() ,
> //   Toast.LENGTH_SHORT).show();
>
> }
>   private class ImageAdapter extends BaseAdapter {
>
> private final Context context;
>
> public ImageAdapter(Context localContext) {
> context = localContext;
> }
>
> public int getCount()
> {
> return list.size();
> }
> public Object getItem(int position)
> {
> return position;
> }
> public long getItemId(int position)
> {
> return position;
> }
>
> public View getView(int position, View convertView, ViewGroup
> parent)
> {
> ImageView picturesView;
> if (convertView == null) {
> picturesView = new ImageView(context);
>
> for(int i=0;i {
> Bitmap mBitmap = BitmapFactory.decodeFile(list.get(i));
> picturesView.setImageBitmap(mBitmap);
> }
> picturesView.setScaleType(ImageView.ScaleType.FIT_CENTER);
> picturesView.setPadding(8, 8, 8, 8);
> picturesView.setLayoutParams(new
> GridView.LayoutParams(100, 100));
> }
> else
> {
> picturesView = (ImageView)convertView;
> }
> return picturesView;
> }
> }
>
>
> private ArrayList getimageurl() {
>
>  json =JsonImplementation.getJSONfromURL("
> http://works.sodprojects.com/mobile/mobile/ViewPhotos/?id=82";);
>
> // Toast.makeText(getBaseContext(),
>  //   " selected"+ json .toString(),
>//  Toast.LENGTH_SHORT).show();
>  try{
>
>   JSONArray  data = json.getJSONArray("result");
>
>   count =data.length();
>
>   for(int i=0;i
>   JSONObject e = data.getJSONObject(i);
>
>   //getting the value of message_id and conversation_id
>   //MainActivity.MESSAGE_ID=e.getString("username");
>   list.add("http://works.sodprojects.com/mobile/"+e.getString("Photo"));
>   //list[i]="http://works.sodprojects.com/mobile/"+e.getString("Photo");
>
>   }
>   /// Toast.makeText(getBaseContext(),
>  //   " selected"+ mylist[0],
>  //Toast.LENGTH_SHORT).show();
>  }
>   catch(JSONException e){
>  Log.e("log_tag", "Error parsing data "+e.toString());
>   }
>  return list;
>   // TODO Auto-generated method stub
>  }
> public static Bitmap downloadFile(String fileUrl){
> Bitmap bmImg = null;
> URL myFileUrl =null;
> try {
>  myFileUrl= new URL(fileUrl);
> } catch (MalformedURLException e) {
>  // TODO Auto-generated catch block
>  e.printStackTrace();
> }
> try {
>  HttpURLConnection conn=
> (HttpURLConnection)myFileUrl.openConnection();
>  conn.setDoInput(true);
>  conn.connect();
>  InputStream is = conn.getInputStream();
>
>  bmImg

[android-developers] grid view is not showing remote images

2011-12-04 Thread Ratheesh Valamchuzhy
i am developing an app which shows thumbnail of images using grid view   i
created image adapter class to get the thumbnail images , but it is not
working plse help me(force close)

here is my code

package com.playswf;

import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.ImageView;

public class playswf extends Activity {
   String[] imageURLs = new String[100];
   Bitmap bitmap;
   ArrayListlist=new  ArrayList();
  public  JSONObject json;
 int   count;
//  String[] mylist =new String[100];

//private ImageAdapter imageAdapter;
 /** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
//getimageurl();
 GridView sdcardImages = (GridView) findViewById(R.id.gridview);
list.add("http://works.sodprojects.com/mobile/$userfiles/thumb_82_431_39.jpg
");
list.add("http://works.sodprojects.com/mobile/$userfiles/thumb_82_431_39.jpg
");
list.add("http://works.sodprojects.com/mobile/$userfiles/thumb_82_431_39.jpg
");
sdcardImages.setAdapter(new ImageAdapter(this));
 //  Toast.makeText(getBaseContext(),
//  " selected"+ list.toString() ,
//   Toast.LENGTH_SHORT).show();

}
  private class ImageAdapter extends BaseAdapter {

private final Context context;

public ImageAdapter(Context localContext) {
context = localContext;
}

public int getCount()
{
return list.size();
}
public Object getItem(int position)
{
return position;
}
public long getItemId(int position)
{
return position;
}

public View getView(int position, View convertView, ViewGroup
parent)
{
ImageView picturesView;
if (convertView == null) {
picturesView = new ImageView(context);

for(int i=0;i getimageurl() {

 json =JsonImplementation.getJSONfromURL("
http://works.sodprojects.com/mobile/mobile/ViewPhotos/?id=82";);

// Toast.makeText(getBaseContext(),
 //   " selected"+ json .toString(),
   //  Toast.LENGTH_SHORT).show();
 try{

  JSONArray  data = json.getJSONArray("result");

  count =data.length();

  for(int i=0;ihttp://works.sodprojects.com/mobile/"+e.getString("Photo"));
  //list[i]="http://works.sodprojects.com/mobile/"+e.getString("Photo");

  }
  /// Toast.makeText(getBaseContext(),
 //   " selected"+ mylist[0],
 //Toast.LENGTH_SHORT).show();
 }
  catch(JSONException e){
 Log.e("log_tag", "Error parsing data "+e.toString());
  }
return list;
  // TODO Auto-generated method stub
 }
public static Bitmap downloadFile(String fileUrl){
Bitmap bmImg = null;
URL myFileUrl =null;
try {
 myFileUrl= new URL(fileUrl);
} catch (MalformedURLException e) {
 // TODO Auto-generated catch block
 e.printStackTrace();
}
try {
 HttpURLConnection conn=
(HttpURLConnection)myFileUrl.openConnection();
 conn.setDoInput(true);
 conn.connect();
 InputStream is = conn.getInputStream();

 bmImg = BitmapFactory.decodeStream(is);
   //  imView.setImageBitmap(bmImg);
} catch (IOException e) {
 // TODO Auto-generated catch block
 e.printStackTrace();
}
return bmImg;
   }
}


xml file


http://schemas.android.com/apk/res/android";
android:id="@+id/gridview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:numColumns="auto_fit"
android:verticalSpacing="10dp"
android:horizontalSpacing="10dp"
android:columnWidth="90dp"
android:stretchMode="columnWidth"
android:gravity="center"
/>

urgent
thnks



-- 
-- 
ωιтн яєgαя∂ѕ
Ratheesh * *...

-- 
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

[android-developers] Re: Is it possible to add rows to the listview from the top?

2011-12-04 Thread Ali Chousein
Exactly Doug! Adding the data at the desired location in the relevant
container (e.g. ArrayList) and then calling the notifyDatasetChanged()
method, is the only decent way of adding rows to a listview at any
location (top, bottom, middle, random location etc etc)

-
Ali Chousein
Weather-Buddy
http://weatherbuddy.blogspot.com | http://twitter.com/weather_buddy
Geo-Filtered Assistant
http://geo-filtered-assistant.blogspot.com
https://marketplace.cisco.com/apphq/products/994

-- 
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


[android-developers] Re: list actvity is scrolling

2011-12-04 Thread Ali Chousein
The first step to get assitance in this group would be to articulate
your questions. Reading your questions for the last some months, I've
never understood what exactly you are trying to do. If expressing a
coding question in plain English is difficult (and most of the times
it is), copy paste the most relevant parts of your code and rewrite
your question by referring to the code you pasted. Otherwise, you are
trying to get assistance in vain.

-
Ali Chousein
Weather-Buddy
http://weatherbuddy.blogspot.com | http://twitter.com/weather_buddy
Geo-Filtered Assistant
http://geo-filtered-assistant.blogspot.com
https://marketplace.cisco.com/apphq/products/994


On Dec 4, 5:54 am, jaggu  wrote:
> yes list is scrolling but my list contains image text image like this
>
> and even my list content have only 8 elements its shouldnt be scroll
> even in my layout i haven't given scrollview also
>
> is there any procedure can any one suggest me for this
>

-- 
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


[android-developers] Graphics Information

2011-12-04 Thread Raghav Sood
Hi all,

Just saw this great post by Dianne on Google+. You should definitely read
it if your app has lots of graphics and drawing to do.

https://plus.google.com/105051985738280261832/posts/2FXDCz8x93s

Thanks

-- 
Raghav Sood
http://www.androidactivist.org/ - Author
http://www.appaholics.in/ - Founder

-- 
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

[android-developers] Re: How to draw pixels?

2011-12-04 Thread Vincent
Yes, that is what I want. Just don't know how to "feed it the binary
data". I am quite new to android, could you give me some detailed
hints?

On Dec 4, 6:19 pm, Doug  wrote:
> Sounds like you just need to create your own subclass of View, feed it
> the binary data to draw as that data becomes available, and put your
> logic below into the onDraw method using the drawing primitive of the
> Canvas object it receives.
>
> Doug
>
> On Dec 3, 6:30 pm, Vincent  wrote:
>
>
>
>
>
>
>
> > Thanks for replying, I think I didn't describe my needs clearly.
> > What I want are:
> > 1. Use 30 bytes to represent one line
> > 2. One byte has 8 bits, each bit to represent one pixel.
> > 3. So one line has 240 (30x8) pixels.
> > 4. If a bit's value is 0, set a pixel to black
> > 5. If 1, set a pixel to white
> > 6. I have 120 lines to draw.
> > 7. I need to update each line very often.
>
> > So, not if one bit is 0, then draw a black line.
>
> > And for expanding the encoding, could you give any hint?
>
> > Thank you.
>
> > On Dec 4, 12:28 pm, James Black  wrote:
>
> > > You will need to expand the encoding you have and then it would seem the
> > > best approach is to have a white background, then just draw a line 
> > > (http://stackoverflow.com/questions/3616676/how-to-draw-a-line-in-android)
> > > for the black lines, so, you would need to find the start of the current
> > > line segment, see how many pixels in that segment, then draw the line, 
> > > then
> > > skip over the white ones (that would be like drawing a white line) and 
> > > draw
> > > the next black line segment.
>
> > > On Sat, Dec 3, 2011 at 7:34 PM, Vincent  wrote:
> > > > Hi,
>
> > > > I want to draw an image from bytes. E.g. I have a byte "0010",  a
> > > > black pixel for a 0, a white pixel for a 1, then I need draw an 8
> > > > pixels line "black white white white white black white black white" on
> > > > the screen.
>
> > > > I have about 3000 bytes (30 bytes per line)to draw an image, and I
> > > > need to update the image frequently.
>
> > > > Could you give any suggestion? Is Bitmap.createBitmap from colors
> > > > array applicable?
>
> > > > Android 3.2
>
> > > > --
> > > > 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
>
> > > --
> > > "I know that you believe you understand what you think I said, but I'm not
> > > sure you realize that what you heard is not what I meant."
> > > - Robert McCloskey

-- 
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