[android-developers] Re: Mp3 file read problem in Real device (G1)

2009-03-18 Thread jayesh

Hello andrioders,

After working for few hours, i over come problem of not getting mp3
file from SDCARD of G1 device.

instead of passing Path as static String as /sdcard, i pass
android.os.Environment.getExternalStorageDirectory().getPath();

above line will give a "/sdcard", but make sure that ur Sdcard has
same path, with no directories in it,

At present my Sdcard as "Music" Folder, that the real cause of
problem, it was not been able to find a mp3 file in root directory of /
sdcard,

Hence in end i pass android.os.Environment.getExternalStorageDirectory
().getPath()  + File.seperator + "Music";

And now it is working..


Keep d Spirit Up,
Jayesh

On Mar 18, 3:36 pm, Dave Sparks  wrote:
> Just in case there is any confusion, your APK is not going to contain
> the MP3 files that were loaded on the virtual SD card in the emulator.
>
> If you want to play MP3's on the device's SD card, you need to install
> them there, either by copying them from your workstation, downloading
> them from the Internet, or by creating them within your program.
>
> On Mar 17, 10:49 pm, "jayesh.thadani" 
> wrote:
>
> > Hello friends,
>
> > I have demo music player which reads mp3 files from virtual memory
> > card of emulator
>
> > I pass path something like this "/sdcard" and its working fine, at a
> > time of reading MP3 from virtual memory card of emulator.
>
> > But when this .apk is installed on real device G1, application is not
> > been able to find any MP3 files from memory card of G1 device,
>
> > Can any one suggest for this issue on real device G1, or can provide a
> > code on how to read files from Memory card of G1.
>
> > Thanks,
> >Jayesh
--~--~-~--~~~---~--~~
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: Delete SMS messages from SIM card

2009-04-02 Thread jayesh

Hi Mark,

Did u get solution of your problem?

On Mar 25, 2:55 am, mark.ka...@gmail.com wrote:
>   Anyone, anyone? Bueller?  ...   I'll answer my own question, I'll
> try using the uri content://sms/sim
>
> On Mar 20, 1:14 pm, mark.ka...@gmail.com wrote:
>
> >   That is programmaticallydeletemessages from the SIM card...
>
> > On Mar 20, 12:58 pm, Mark K  wrote:
>
> > > Anyone know how todeleteSMSmessages from the SIM card? Thanks!
>
> > >  Mark- Hide quoted text -
>
> > - Show quoted text -
--~--~-~--~~~---~--~~
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: alternative to sms manager

2009-04-02 Thread jayesh

Hi Sree,

SMS client will take that SMS, but you can just delete that SMS from
SMS client, and allow your application to catch that sms and put that
in your application,

I know this is bit round of work, but i dont have any other option for
this,

Other thing you can implement is that you can have broadcast receiver
in your application for delete functinality from SMS client,

Hope you got the clue from this,

"Keep d spirit up"
Jayesh

On Apr 2, 5:47 pm, sree  wrote:
> Hi
>
> I want to send a message to only specific application in other device
> but i dont want SMS client to pick that.
> How is it possible?
>
> Thanks
> Sree
--~--~-~--~~~---~--~~
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 display a local file in the browser?

2009-09-16 Thread Jayesh



On Sep 9, 4:13 am, Megha Joshi  wrote:
> local file access from the browser will be available in one of the upcoming
> sdk releases. thanks!
>

I just looked into 1.6 SDK docs. Nothing in WebView's interface shows
that it will be able to load local files. Did I look at wrong place?
Or 1.6 also doesn't have this support?

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: app gives layout errors only on Sprint HTC Hero devices

2009-10-29 Thread Jayesh



On Oct 21, 10:24 pm, Streets Of Boston 
wrote:
> That's why i put 'official' in quotes :-)
>
> One should not manipulate windows/views in any other thread than the
> main UI-thread (e.g. textView.setText(...) or imageView.setImageBitmap
> (...), hiding/showing views, etc.). If you do this in a background
> thread, then you may get exceptions or other weird behavior.
>
> If 'inflating a view' falls under the 'manipulating windows/views'
> category then one should not inflate views inside any other thread by
> the main UI-thread.
>

You are right. I finally got a report yesterday from one of the users
that a modified apk that does view inflating in GUI thread, doesn't
give this problem. I have released the fix accordingly and got one
more user confirming that it's working for him now.

So thanks for the advice. Inflating view in a thread other than GUI
thread, indeed seems to be unsupported, even if it doesn't throw any
explicit exception deterministically.

> I'm just saying: try to do the inflate in the main UI-thread and check
> if this solves the problem for HTC Heros. If so, your particular
> problem is fixed.
>
> On Oct 21, 11:34 am, Jayesh Salvi  wrote:
>
> > --
> > Jayesh...
>
> > read more »
>
> > On Wed, Oct 21, 2009 at 7:39 PM, Streets Of Boston
> > wrote:
>
> > > I still would try to inflate your view inside your main gui-thread and
> > > not in a seperate background thread.
>
> > > The fact that it works on other phones does not guarantee it works on
> > > all phones, if inflating views on non-gui threads is 'officially' not
> > > supported.
>
> > Could you elaborate on how it is 'officially' not supported?
>
> > I know that a particular exception is thrown if the framework finds that a
> > different thread is trying to manipulate widgets in view hierarchy.(I hit it
> > yesterday elsewhere in the code, and it is not the same as this error). I
> > haven't found any documentation in this matter, that mentions what is
> > supported/forbidden practice in this matter. Did I miss something?
>
> > > Who knows, it may fix it (if you already haven't tried it). :-)
> > > But i may be wrong...
>
> > > On Oct 20, 11:57 pm, Jayesh Salvi  wrote:
> > > > Thanks Shane and Amir for confirming the doubts.
> > > > It's frustrating that all I can say to users is to wait until Sprint/HTC
> > > > issues firmware update, then hopefully the problem will be fixed. The
> > > users
> > > > are willing to test if I have any fix, but I can't find root cause even
> > > > after looking inside the android code, let alone a fix/workaround.
>
> > > > Does anyone know if Sprint or HTC have any channels to report 
> > > > complaints?
> > > > Are there any means to know when they will issue next firmware update?
>
> > > > IIUC Sprint HTC Hero is "with Google" branded phone. I would have 
> > > > assumed
> > > it
> > > > would be the one with most conformance to Android platform; one that has
> > > > passed all test suites required to qualify for the "with Google" logo.
> > > Yet
> > > > we see these anomalies. :(
>
> > > > --
> > > > Jayesh
>
> > > > On Mon, Oct 19, 2009 at 1:15 PM, Amir Alagic  wrote:
>
> > > > > I saw somwhere else that one developer also has problems only with HTC
> > > > > Hero (Sprint) ...
>
> > > > > On Oct 18, 9:48 am, Shane  wrote:
> > > > > > We are having problems only with HTC Hero phones as well.  Our issue
> > > > > > is different that yours but it is very disappointing to see not all
> > > > > > phones handle the SDK the same.
>
> > >http://groups.google.com/group/android-developers/browse_thread/threa...
>
> > > > > > I suspect this is just going to get worse as more branded android
> > > > > > experiences get released by manufacturers.  G
>
> > > > > > On Oct 12, 9:46 pm, Jayesh Salvi  wrote:
>
> > > > > > > I tried to look into the android framework code
> > > > > > > (link<
> > > > >http://www.google.com/codesearch/p?hl=en&sa=N&cd=1&ct=rc#uX1GffpyOZk/.
> > > ..
> > > > > > > android.view.InflateException Error inflating class
> > > > > > > java.lang.reflect.Constructor&l=458>). The topmost frame refers to
> > >

[android-developers] Re: Device Seeding Program for Top Android Market Developers

2010-03-02 Thread Jayesh
Got the email. But my country of residence is not included in the list
(India). Anyone in the same situation?

On Mar 3, 7:49 am, Corollary Computing 
wrote:
> Hey everybody,
>
> First off, congrats on qualifying. We rock.
>
> Second, we don't know yet which phone we'll get, but... I DO know
> people will want to switch. I've set up a forum where we can trade
> info...http://www.evoiceusa.com/forum.php. For verification, you'll
> have to send an email from your developer email address to android at
> evoiceusa.com with the app that qualifies you and your desired user
> name. If it all checks out I'll approve you... and hopefully we can
> all get the free phone we want :)
>
> On Mar 2, 6:38 pm, kelly  wrote:
>
>
>
> > I signed up as soon as I knew it was legit. Google, thanks very much!
>
> > On Mar 2, 7:14 pm, Seni Sangrujee  wrote:
>
> > > On Mar 2, 5:04 pm, mscwd01  wrote:
>
> > > > Can I get an idea of how many people have submitted their details?
>
> > > I submitted my info.  The signup form is similar to what they used for
> > > the Android Developer Lab 
> > > registration:https://sites.google.com/site/androiddevlabs/register
>
> > > -seni- Hide quoted text -
>
> > - Show quoted text -

-- 
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: Widget Unresponsive after Opening/Closing

2009-07-05 Thread Jayesh

I had the same problem. Jeff's solution worked for me.

Thanks!

On Jun 17, 1:27 am, Jeff Sharkey  wrote:
> Are you sending a full RemoteViews update each time?  (The AppWidget
> framework only keeps the last RemoteViews sent, and reapplies it when
> needed, such as after a screen rotation.)
>
> For example, if you only set the PendingIntent once, and have a second
> RemoteViews update that doesn't include it, the PendingIntent will be
> lost when the screen is rotated.
>
> j
>
> On Tue, Jun 16, 2009 at 10:16 AM, d2dadd wrote:
>
> > I have a widget button that responds to user's clicks. My design is to
> > assign the click event handler to calling a service in OnUpdate. It
> > works fine when first created, but it stops responding after user has
> > opened and closed the keyboard. How to fix this?
> > Many thanks.
>
> --
> Jeff Sharkey
> jshar...@android.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: Keep app from restarting when touching icon from Home screen

2011-07-08 Thread jayesh
Even I am facing same problem..Do you got any fix?

-- 
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: Input transport and input dispatcher error on 2.3

2012-08-16 Thread Jayesh
I am also facing similar problem;
Device: Galaxy S3, Samsung Rugby, Samsung skyrocket

Scenario: Random; while navigating from one activity to other.
 

08-01 14:04:34.122: E/InputTransport(6669): channel '42eb8978 
xx.xx.xx.xx/com.xxx.XXActivity (client)' consumer ~ Error -1 pinning ashmem fd 
70.
08-01 14:04:34.122: W/InputQueue-JNI(6669): channel '42eb8978 
xx.xx.xx.xx/com.xxx.XXActivity (client)' ~ Failed to consume input event.  
status=-2147483648
08-01 14:04:34.132: E/InputTransport(6669): channel '42eb8978 
xx.xx.xx.xx/com.xxx.XXActivity (client)' consumer ~ Error -1 pinning ashmem fd 
70.
08-01 14:04:34.132: W/InputQueue-JNI(6669): channel '42eb8978 
xx.xx.xx.xx/com.xxx.XXActivity (client)' ~ Failed to consume input event.  
status=-2147483648
08-01 14:04:34.142: E/InputTransport(6669): channel '42eb8978 
xx.xx.xx.xx/com.xxx.XXActivity (client)' consumer ~ Error -1 pinning ashmem fd 
70.
08-01 14:04:34.142: W/InputQueue-JNI(6669): channel '42eb8978 
xx.xx.xx.xx/com.xxx.XXActivity (client)' ~ Failed to consume input event.  
status=-2147483648
08-01 14:04:34.152: E/InputTransport(6669): channel '42eb8978 
xx.xx.xx.xx/com.xxx.XXActivity (client)' consumer ~ Error -1 pinning ashmem fd 
70.
08-01 14:04:34.152: W/InputQueue-JNI(6669): channel '42eb8978 
xx.xx.xx.xx/com.xxx.XXActivity (client)' ~ Failed to consume input event.  
status=-2147483648


On Monday, 23 May 2011 09:11:12 UTC+5:30, wang  wrote:
> Hi,
> 
> 
> 
> I run into many applications in the Android 2.3, but when every time I
> 
> perform to a certain program, the following error sometimes occurs:
> 
> 
> 
> 05-20 16:43:57.714 E/InputTransport(  102): channel '40540858
> 
> com.android.test/com.abdroid.test.Test1 (server)' publisher ~ Error -1
> 
> pinning ashmem fd 0.
> 
> 
> 
> 
> 
> 05-20 16:43:57.714 E/InputDispatcher(  102): channel '40540858
> 
> com.android.test/com.abdroid.test.Test1 (server)' ~ Could not publish
> 
> key event, status=-2147483648
> 
> 
> 
> 
> 
> 05-20 16:43:57.714 E/InputDispatcher(  102): channel '40540858
> 
> com.android.test/com.abdroid.test.Test1 (server)' ~ Channel is
> 
> unrecoverably broken and will be disposed!
> 
> 
> 
> 
> 
> Can tell me in what circumstances would cause such a result?

-- 
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] Screen distortion issue

2012-08-16 Thread Jayesh
Hi,
After performing extensive user operation e.g. navigating through various 
activities, buttons and menu.
The issue, screen distortion, is random and seldom. It can be observed any 
where  on screen when you touch it. But later moving to other activity app 
behaves normally.
Device: Samsung skyrocket 
Android version: 2.3 and ICS


Following log observed for every touch event which produce screen 
distortion;


07-18 11:37:15.624: ERROR/msm8660.gralloc(19102): cannot flush handle 
0x6530d0 (offs=821000 len=177000)
07-18 11:37:15.644: ERROR/msm8660.gralloc(19102): cannot flush handle 
0x6530d0 (offs=821000 len=177000)
07-18 11:37:15.684: ERROR/msm8660.gralloc(19102): cannot flush handle 
0x6530d0 (offs=821000 len=177000)
07-18 11:37:15.724: ERROR/msm8660.gralloc(19102): cannot flush handle 
0x6530d0 (offs=821000 len=177000)
07-18 11:37:15.724: INFO/PowerManagerService(307): Light Animator Finished 
curIntValue=119
07-18 11:37:15.754: ERROR/msm8660.gralloc(19102): cannot flush handle 
0x6530d0 (offs=821000 len=177000)
07-18 11:37:15.784: INFO/InputReader(307): dispatchTouch::touch event's 
action is 1, pending(waiting finished signal)=0
07-18 11:37:15.784: INFO/InputDispatcher(307): Delivering touch to current 
input target: action: 1, channel '405820a8 
com..x.xxx/com..xx.xxx.MainTabActivity (server)'
07-18 11:37:15.794: ERROR/msm8660.gralloc(19102): cannot flush handle 
0x6530d0 (offs=821000 len=177000)
07-18 11:37:15.814: ERROR/msm8660.gralloc(19102): cannot flush handle 
0x6530d0 (offs=821000 len=177000)
07-18 11:37:15.854: ERROR/msm8660.gralloc(19102): cannot flush handle 
0x6530d0 (offs=821000 len=177000)
07-18 11:37:15.884: ERROR/msm8660.gralloc(19102): cannot flush handle 
0x6530d0 (offs=821000 len=177000)
07-18 11:37:15.914: ERROR/msm8660.gralloc(19102): cannot flush handle 
0x6530d0 (offs=821000 len=177000)
07-18 11:37:15.944: ERROR/msm8660.gralloc(19102): cannot flush handle 
0x6530d0 (offs=821000 len=177000)
07-18 11:37:15.974: ERROR/msm8660.gralloc(19102): cannot flush handle 
0x6530d0 (offs=821000 len=177000)
07-18 11:37:16.004: ERROR/msm8660.gralloc(19102): cannot flush handle 
0x6530d0 (offs=821000 len=177000)
07-18 11:37:16.044: ERROR/msm8660.gralloc(19102): cannot flush handle 
0x6530d0 (offs=821000 len=177000)
07-18 11:37:16.074: ERROR/msm8660.gralloc(19102): cannot flush handle 
0x6530d0 (offs=821000 len=177000)
07-18 11:37:16.104: ERROR/msm8660.gralloc(19102): cannot flush handle 
0x6530d0 (offs=821000 len=177000)
07-18 11:37:16.154: ERROR/msm8660.gralloc(19102): cannot flush handle 
0x6530d0 (offs=821000 len=177000)

-- 
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: Hmm... at last ADC2 is out of our way ... tell about your app and experience

2009-09-02 Thread Jayesh Salvi
Hi,
My entry to ADC2 is: "ReaderScope" - A Google Reader client. (Lifestyle
category)

It lets you read news online/offline, while syncing your actions
(star/share/unread) on the way. It comes with sharing options over SMS,
email, Twitter, Digg, Del.icio.us.
You can schedule periodic downloads. You can also do smart customizations to
save battery or network traffic.

The app is available right now at following places:

Android market: market://search/?q=pname:com.altcanvas.readerscope
Slideme: http://slideme.org/application/readerscope
AndAppStore: http://andappstore.com/AndroidApplications/apps/193797

App website: http://www.altcanvas.com/android/readerscope

The 1.0 version available at above places is exactly the same as submitted
to ADC2. And it's completely FREE.

Give it a try!

Jayesh


On Wed, Sep 2, 2009 at 11:20 PM, jgilfelt  wrote:

>
> My ADC2 entry:
>
> App: Location Scout
> Category: Travel
> Website: http://getlocationscout.com
> Description: A location based application that helps you discover
> nearby movie filming locations.
> Developer: Jeff Gilfelt
>
> I use IMDb as the data source and the Google Maps API geocoding
> service + a custom JSON REST API which I have built on Google App
> Engine. This was my first experience developing for Android. The app
> was built in my spare time over the course of a few weeks. It is now
> available free on the Android Market. I am currently porting it to
> iPhone.
>
> >
>

--~--~-~--~~~---~--~~
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] layout upgrade causing crash

2009-09-03 Thread Jayesh Salvi
Hi,
In that app I am developing (
http://www.cyrket.com/package/com.altcanvas.readerscope), I updated the
layout file in the latest version - I changed the order of some Views and
changed a LinearLayout to RelativeLayout. I heard from users and also
verified myself that a regular upgrade from old version to the new version
causes a crash. The crash is because of a ClassCastException for a
LinearLayout. I do see this kind of error during development - what I do is,
I do a clean build and then upgrade and it solves the problem. But that
doesn't seem to be the case here.

Is this happening because the upgrade doesn't wipe out old layout files?

After searching for the issue, I came across the warning about unusually
deep and/or broad hierarchies (
http://android-developers.blogspot.com/2009/04/future-proofing-your-apps.html).
My layout is not much deeper (max depth 5), but it is wider (total elements
more than 30). Do you think that has anything to do with this? However note
that a clean install of the latest version doesn't cause any problem, only
the upgrade from previous version leads to the layout related crash.

Has anyone else faced problem like this?

Please let me know.

Thanks,
Jayesh

--~--~-~--~~~---~--~~
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] relocating webview cache using softlinks

2009-09-23 Thread Jayesh Salvi
Hi,

I am using webview in my app. WebView stores the downloaded pages in a cache
at /data/data//cache/webviewCache/ . I didn't find any way to
make webview store its cache elsewhere, on SDCard for instance. But given
the large amount of webview cache that my app tends to accumulate over time,
I need to relocate this cache on SDCard.

I came up with a solution, that works well in my emulator. But I would like
your opinion about whether it violates any Android practices.

I came across many tricks that people try manually to relocate app's cache
storage to SDCard. They create a directory on SDcard and create a softlink
to it inside the app's package directory. Of course this is done manually
and needs root access.

I tried to do the same thing, but programmatically and only inside my app's
package directory. Since android (or IIUC Java for that matter) doesn't
support creating soft links. So I used java.lang.Runtime to workaround that
restriction. Essentially I use following three routines to move my
webviewCache back-n-forth between the phone and SDCard.

[code]

String WEBVIEWCACHE_SD_DIR = "/sdcard/readerscope/webviewCache";
String WEBVIEWCACHE_PHONE_DIR =
"/data/data/com.altcanvas.readerscope/cache/webviewCache";

public static void makeDir(String abspath)
throws ReaderScopeException
{
try {
Runtime.getRuntime().exec(new String[] {"mkdir", abspath });
} catch(java.io.IOException ioe) {
throw new ReaderScopeException(ioe.toString());
}
}

public static void createSoftLink()
throws ReaderScopeException
{
try {
Runtime.getRuntime().exec(new String[] {"ln", "-s",
WEBVIEWCACHE_SD_DIR, WEBVIEWCACHE_PHONE_DIR });
} catch(java.io.IOException ioe) {
throw new ReaderScopeException(ioe.toString());
}
}

public static void deleteSoftLink()
throws ReaderScopeException
{
try {
Runtime.getRuntime().exec(new String[] {
"rm", WEBVIEWCACHE_PHONE_DIR });
} catch(java.io.IOException ioe) {
throw new ReaderScopeException(ioe.toString());
}
}

[/code]

This scheme works in my 1.5 emulator. My questions are:

Will this hit any problem on a non-rooted phone?
Will this offend any (present/future) SecurityManagers that are monitoring
filesystem access?
Is it a bad practice to use absolute paths (even for directories that are
well within your package dir structure)? If so why?

Are there any plans to provide an API to customize WebView's cache location?
(Given that WebView's cache is perfectly local to the app and separate from
Browser cache, this shouldn't pose any security risks, I suppose).

Please let me know, what do you think.

Thanks,
Jayesh

--~--~-~--~~~---~--~~
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: relocating webview cache using softlinks

2009-09-23 Thread Jayesh Salvi
On Wed, Sep 23, 2009 at 7:00 PM, Mark Murphy wrote:

>
> > But given
> > the large amount of webview cache that my app tends to accumulate over
> > time,
> > I need to relocate this cache on SDCard.
>
> Why not just call clearCache() periodically?
>

No, I don't want to loose the cache. In fact, ReaderScope is a Google Reader
client that caches the news web pages in the background using webview. This
allows the user to access these webpages offline later on.


>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com
> Android App Developer Books: http://commonsware.com/books.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: relocating webview cache using softlinks

2009-09-23 Thread Jayesh Salvi
On Wed, Sep 23, 2009 at 7:53 PM, Mark Murphy wrote:

>
> >> Why not just call clearCache() periodically?
> >>
> >
> > No, I don't want to loose the cache. In fact, ReaderScope is a Google
> > Reader
> > client that caches the news web pages in the background using webview.
> > This
> > allows the user to access these webpages offline later on.
>
> And what happens when you fill up their SD card with your cache?
>
> Why aren't you caching the data yourself, so you can control the location,
> size, and retention policies of the cache? Conversely, why are you
> electing to have those functions -- which are essential to the operation
> of your product -- be delegated to a component (WebView's cache) over
> which you have no real control?
>

Yeah, that's another approach. I just tried not to duplicate any
functionality that was already available in the platform.

Now, ideally, you could create your own CacheManager and WebViewDatabase
> refinements, so you could leverage 90% of the existing logic and only
> change what is needed to fit your business needs. Alas, I see no evidence
> that you can replace the CacheManager/WebViewDatabase used by a WebView.
>

So far WebView does most of the stuff that my business logic requires,
except for the custom location for cache. It would have been great if
WebView and other objects in webkit family were extendible, to allow this
kind of customizations. I will have to dig more to see if something like
this can be possible.

Thanks,
Jayesh

--~--~-~--~~~---~--~~
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: relocating webview cache using softlinks

2009-10-05 Thread Jayesh Salvi
>
>
> Why aren't you caching the data yourself, so you can control the location,
> size, and retention policies of the cache? Conversely, why are you
> electing to have those functions -- which are essential to the operation
> of your product -- be delegated to a component (WebView's cache) over
> which you have no real control?
>

Now that I have implemented a new caching mechanism for ReaderScope that is
independent of WebView, the added control looks like a big advantage.

Thanks for the advice.

Jayesh

--~--~-~--~~~---~--~~
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] app gives layout errors only on Sprint HTC Hero devices

2009-10-11 Thread Jayesh Salvi
Hi,
In past couple of days, users of my app have sent crash reports indicating
errors in layout inflation.

"android.view.InflateException: Binary XML file line #27: Error inflating
class java.lang.reflect.Constructor"

After some investigation I found out that all four of them were using the
new Sprint HTC Hero devices. This error hasn't been reported on any other
device/ROM nor could I repro it in the emulator.

>From searching around, I figured this is the kind of error that one gets if
layout is too big or too wide. Although my layout is very well within the
limits that Android framework puts, I split it further and asked the users
to test. However, even with this fix the users are seeing similar crash
while inflating the layout.

Has anyone else had same experience with the new Hero devices?

Any suggestions on how I can proceed to fix/workaround the issue - given
that I don't have access to any such device?

Following is the detailed stack trace of the crash:

android.view.InflateException: Binary XML file line #27: Error inflating
class java.lang.reflect.Constructor

android.view.LayoutInflater.createView(LayoutInflater.java:512)

com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:562)
android.view.LayoutInflater.rInflate(LayoutInflater.java:617)
android.view.LayoutInflater.rInflate(LayoutInflater.java:620)
android.view.LayoutInflater.rInflate(LayoutInflater.java:620)
android.view.LayoutInflater.inflate(LayoutInflater.java:407)
android.view.LayoutInflater.inflate(LayoutInflater.java:320)
android.view.LayoutInflater.inflate(LayoutInflater.java:276)



<-- application specific stack frames -->
Thanks,
--
Jayesh

--~--~-~--~~~---~--~~
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: app gives layout errors only on Sprint HTC Hero devices

2009-10-11 Thread Jayesh Salvi
--
Jayesh


On Mon, Oct 12, 2009 at 1:10 AM, Mark Murphy wrote:

>
> Jayesh Salvi wrote:
> > Hi,
> >
> > In past couple of days, users of my app have sent crash reports
> > indicating errors in layout inflation.
> >
> > "android.view.InflateException: Binary XML file line #27: Error
> > inflating class java.lang.reflect.Constructor"
> >
> > After some investigation I found out that all four of them were using
> > the new Sprint HTC Hero devices. This error hasn't been reported on any
> > other device/ROM nor could I repro it in the emulator.
> >
> > From searching around, I figured this is the kind of error that one gets
> > if layout is too big or too wide. Although my layout is very well within
> > the limits that Android framework puts, I split it further and asked the
> > users to test. However, even with this fix the users are seeing similar
> > crash while inflating the layout.
> >
> > Has anyone else had same experience with the new Hero devices?
> >
> > Any suggestions on how I can proceed to fix/workaround the issue - given
> > that I don't have access to any such device?
> >
> > Following is the detailed stack trace of the crash:
> >
> > android.view.InflateException: Binary XML file line #27: Error inflating
> > class java.lang.reflect.Constructor
> >
> > android.view.LayoutInflater.createView(LayoutInflater.java:512)
> >
> >
> com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
> >
> android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:562)
> > android.view.LayoutInflater.rInflate(LayoutInflater.java:617)
> > android.view.LayoutInflater.rInflate(LayoutInflater.java:620)
> > android.view.LayoutInflater.rInflate(LayoutInflater.java:620)
> > android.view.LayoutInflater.inflate(LayoutInflater.java:407)
> > android.view.LayoutInflater.inflate(LayoutInflater.java:320)
> > android.view.LayoutInflater.inflate(LayoutInflater.java:276)
> >
> > 
> >
> > <-- application specific stack frames -->
>
> Ummm...what's at line #27 of the layout?
>
>
If it helps, I am attaching the xml layout file. Line 27 is:
27.  



> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com | http://twitter.com/commonsguy
>
> Need Android talent? Ask on HADO! http://wiki.andmob.org/hado
>
> >
>

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


http://schemas.android.com/apk/res/android";
android:id="@+id/delcsview"
android:orientation="vertical"
android:paddingLeft="52dip"
android:layout_width="fill_parent"
android:layout_height="wrap_content">


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









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











[android-developers] Re: app gives layout errors only on Sprint HTC Hero devices

2009-10-11 Thread Jayesh Salvi
--
Jayesh


On Mon, Oct 12, 2009 at 1:11 AM, Romain Guy  wrote:

>
> Hi,
>
> The stack trace you showed is not useful. This is the top of the
> exception chain, which means this exception was caused by something
> else. Please show the "application specific stack frames" you removed.
>

The complete stack trace is:

- Cause -

android.view.InflateException: Binary XML file line #27: Error inflating
class java.lang.reflect.Constructor

android.view.LayoutInflater.createView(LayoutInflater.java:512)

com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:562)
android.view.LayoutInflater.rInflate(LayoutInflater.java:617)
android.view.LayoutInflater.rInflate(LayoutInflater.java:620)
android.view.LayoutInflater.rInflate(LayoutInflater.java:620)
android.view.LayoutInflater.inflate(LayoutInflater.java:407)
android.view.LayoutInflater.inflate(LayoutInflater.java:320)
android.view.LayoutInflater.inflate(LayoutInflater.java:276)
com.altcanvas.readerscope.ItemDetails.(ItemDetails.java:145)
com.altcanvas.readerscope.ItemDetails.getInstance(ItemDetails.java:566)

com.altcanvas.readerscope.ReaderTask.doInBackground(ReaderTask.java:1027)
com.altcanvas.readerscope.ReaderTask.doInBackground(ReaderTask.java:21)
com.altcanvas.readerscope.UserTask$2.call(UserTask.java:187)
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:256)
java.util.concurrent.FutureTask.run(FutureTask.java:122)

java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:648)

java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:673)
java.lang.Thread.run(Thread.java:1058)
---

The code around line 145 in ItemDetails.java is:

144.widerContainer = new LinearLayout(app);

145.widerContainer.addView((LinearLayout) inflater

146..inflate(R.layout.delcs,null), layoutFW);

147.widerContainer.addView((LinearLayout) inflater

148..inflate(R.layout.digg,null), layoutFW);


>
> On Sun, Oct 11, 2009 at 12:34 PM, Jayesh Salvi 
> wrote:
> > Hi,
> > In past couple of days, users of my app have sent crash reports
> indicating
> > errors in layout inflation.
> > "android.view.InflateException: Binary XML file line #27: Error inflating
> > class java.lang.reflect.Constructor"
> > After some investigation I found out that all four of them were using the
> > new Sprint HTC Hero devices. This error hasn't been reported on any other
> > device/ROM nor could I repro it in the emulator.
> > From searching around, I figured this is the kind of error that one gets
> if
> > layout is too big or too wide. Although my layout is very well within the
> > limits that Android framework puts, I split it further and asked the
> users
> > to test. However, even with this fix the users are seeing similar crash
> > while inflating the layout.
> > Has anyone else had same experience with the new Hero devices?
> > Any suggestions on how I can proceed to fix/workaround the issue - given
> > that I don't have access to any such device?
> > Following is the detailed stack trace of the crash:
> >
> > android.view.InflateException: Binary XML file line #27: Error inflating
> > class java.lang.reflect.Constructor
> >
> > android.view.LayoutInflater.createView(LayoutInflater.java:512)
> >
> >
> com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
> >
> android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:562)
> > android.view.LayoutInflater.rInflate(LayoutInflater.java:617)
> > android.view.LayoutInflater.rInflate(LayoutInflater.java:620)
> > android.view.LayoutInflater.rInflate(LayoutInflater.java:620)
> > android.view.LayoutInflater.inflate(LayoutInflater.java:407)
> > android.view.LayoutInflater.inflate(LayoutInflater.java:320)
> > android.view.LayoutInflater.inflate(LayoutInflater.java:276)
> >
> > 
> >
> > <-- application specific stack frames -->
> >
> > Thanks,
> > --
> > Jayesh
> >
> > >
> >
>
>
>
> --
> Romain Guy
> Android framework engineer
> romain...@android.com
>
> Note: please don't send private questions to me, as I don't have time
> to provide private support.  All such questions should be posted on
> public forums, where I and others can see and answer them
>
> >
>

--~--~-~--~~~---~--~~
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: app gives layout errors only on Sprint HTC Hero devices

2009-10-12 Thread Jayesh Salvi
--
Jayesh


On Mon, Oct 12, 2009 at 7:49 PM, Streets Of Boston
wrote:

>
> I might be mistaken,
> But this part of the stack-trace worries me a bit:
>
>android.view.LayoutInflater.inflate(LayoutInflater.java:276)
>com.altcanvas.readerscope.ItemDetails.(ItemDetails.java:
> 145)
>com.altcanvas.readerscope.ItemDetails.getInstance(ItemDetails.java:
> 566)
>com.altcanvas.readerscope.ReaderTask.doInBackground
> (ReaderTask.java:1027)
>
> Are you inflating a view in a background-thread and not in the main
> gui-thread?
> But then again, your code works on other Android phones
>

Yes that's true. The layout is inflated in background thread, but is made
part of the root hierarchy (setContentView) only in the GUI thread.

This doesn't give any problem on emulator or any other phones.


>
> On Oct 12, 12:02 am, Jayesh Salvi  wrote:
> > --
> > Jayesh
> >
> > On Mon, Oct 12, 2009 at 1:11 AM, Romain Guy 
> wrote:
> >
> > > Hi,
> >
> > > The stack trace you showed is not useful. This is the top of the
> > > exception chain, which means this exception was caused by something
> > > else. Please show the "application specific stack frames" you removed.
> >
> > The complete stack trace is:
> >
> > - Cause -
> >
> > android.view.InflateException: Binary XML file line #27: Error inflating
> > class java.lang.reflect.Constructor
> >
> > android.view.LayoutInflater.createView(LayoutInflater.java:512)
> >
> >
> com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayo­utInflater.java:56)
> >
> android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:562)
> > android.view.LayoutInflater.rInflate(LayoutInflater.java:617)
> > android.view.LayoutInflater.rInflate(LayoutInflater.java:620)
> > android.view.LayoutInflater.rInflate(LayoutInflater.java:620)
> > android.view.LayoutInflater.inflate(LayoutInflater.java:407)
> > android.view.LayoutInflater.inflate(LayoutInflater.java:320)
> > android.view.LayoutInflater.inflate(LayoutInflater.java:276)
> > com.altcanvas.readerscope.ItemDetails.(ItemDetails.java:145)
> >
> com.altcanvas.readerscope.ItemDetails.getInstance(ItemDetails.java:566)
> >
> > com.altcanvas.readerscope.ReaderTask.doInBackground(ReaderTask.java:1027)
> >
> com.altcanvas.readerscope.ReaderTask.doInBackground(ReaderTask.java:21)
> > com.altcanvas.readerscope.UserTask$2.call(UserTask.java:187)
> > java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:256)
> > java.util.concurrent.FutureTask.run(FutureTask.java:122)
> >
> >
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.j­ava:648)
> >
> >
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:­673)
> > java.lang.Thread.run(Thread.java:1058)
> > ---
> >
> > The code around line 145 in ItemDetails.java is:
> >
> > 144.    widerContainer = new LinearLayout(app);
> >
> > 145.widerContainer.addView((LinearLayout) inflater
> >
> > 146..inflate(R.layout.delcs,null), layoutFW);
> >
> > 147.widerContainer.addView((LinearLayout) inflater
> >
> > 148..inflate(R.layout.digg,null), layoutFW);
> >
> >
> >
> >
> >
> > > On Sun, Oct 11, 2009 at 12:34 PM, Jayesh Salvi 
> > > wrote:
> > > > Hi,
> > > > In past couple of days, users of my app have sent crash reports
> > > indicating
> > > > errors in layout inflation.
> > > > "android.view.InflateException: Binary XML file line #27: Error
> inflating
> > > > class java.lang.reflect.Constructor"
> > > > After some investigation I found out that all four of them were using
> the
> > > > new Sprint HTC Hero devices. This error hasn't been reported on any
> other
> > > > device/ROM nor could I repro it in the emulator.
> > > > From searching around, I figured this is the kind of error that one
> gets
> > > if
> > > > layout is too big or too wide. Although my layout is very well within
> the
> > > > limits that Android framework puts, I split it further and asked the
> > > users
> > > > to test. However, even with this fix the users are seeing similar
> crash
> > > > while inflating the layout.
> > > > Has anyone else had same experience with the new Hero devices?
> > > > Any suggestions

[android-developers] Re: app gives layout errors only on Sprint HTC Hero devices

2009-10-12 Thread Jayesh Salvi
I tried to look into the android framework code
(link<http://www.google.com/codesearch/p?hl=en&sa=N&cd=1&ct=rc#uX1GffpyOZk/core/java/android/view/LayoutInflater.java&q=lang:java
android.view.InflateException Error inflating class
java.lang.reflect.Constructor&l=458>). The topmost frame refers to a 'throw'
statement(line 512) that is inside a catch of a lower level exception. I
can't tell what part of the createView() function throws that lower level
exception.
I also tried to search around for the error string "Error inflating class
java.lang.reflect.Constructor", but couldn't found one with a similar stack
trace. (There are known crashes with this error message caused inside
android.preference.* package, but mine is a simple widget layout and not
preferences, as you might have seen in the XML file I attached earlier.)

I now have 9 reports of this crash and all of them are confirmed to be using
Sprint HTC Hero devices. This problem hasn't been reported on any other
phone. Is it fair to assume that it's a problem in that particular ROM? If
that's so, then what options do I have to resolve this issue - should I wait
helplessly for HTC/Sprint's next update?

Any suggestions are appreciated.

Thanks.
--
Jayesh


On Mon, Oct 12, 2009 at 8:34 PM, Jayesh Salvi  wrote:

>
> --
> Jayesh
>
>
> On Mon, Oct 12, 2009 at 7:49 PM, Streets Of Boston <
> flyingdutc...@gmail.com> wrote:
>
>>
>> I might be mistaken,
>> But this part of the stack-trace worries me a bit:
>>
>>android.view.LayoutInflater.inflate(LayoutInflater.java:276)
>>com.altcanvas.readerscope.ItemDetails.(ItemDetails.java:
>> 145)
>>com.altcanvas.readerscope.ItemDetails.getInstance(ItemDetails.java:
>> 566)
>>com.altcanvas.readerscope.ReaderTask.doInBackground
>> (ReaderTask.java:1027)
>>
>> Are you inflating a view in a background-thread and not in the main
>> gui-thread?
>> But then again, your code works on other Android phones
>>
>
> Yes that's true. The layout is inflated in background thread, but is made
> part of the root hierarchy (setContentView) only in the GUI thread.
>
> This doesn't give any problem on emulator or any other phones.
>
>
>>
>> On Oct 12, 12:02 am, Jayesh Salvi  wrote:
>> > --
>> > Jayesh
>> >
>> > On Mon, Oct 12, 2009 at 1:11 AM, Romain Guy 
>> wrote:
>> >
>> > > Hi,
>> >
>> > > The stack trace you showed is not useful. This is the top of the
>> > > exception chain, which means this exception was caused by something
>> > > else. Please show the "application specific stack frames" you removed.
>> >
>> > The complete stack trace is:
>> >
>> > - Cause -
>> >
>> > android.view.InflateException: Binary XML file line #27: Error inflating
>> > class java.lang.reflect.Constructor
>> >
>> > android.view.LayoutInflater.createView(LayoutInflater.java:512)
>> >
>> >
>> com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayo­utInflater.java:56)
>> >
>> android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:562)
>> > android.view.LayoutInflater.rInflate(LayoutInflater.java:617)
>> > android.view.LayoutInflater.rInflate(LayoutInflater.java:620)
>> > android.view.LayoutInflater.rInflate(LayoutInflater.java:620)
>> > android.view.LayoutInflater.inflate(LayoutInflater.java:407)
>> > android.view.LayoutInflater.inflate(LayoutInflater.java:320)
>> > android.view.LayoutInflater.inflate(LayoutInflater.java:276)
>> > com.altcanvas.readerscope.ItemDetails.(ItemDetails.java:145)
>> >
>> com.altcanvas.readerscope.ItemDetails.getInstance(ItemDetails.java:566)
>> >
>> >
>> com.altcanvas.readerscope.ReaderTask.doInBackground(ReaderTask.java:1027)
>> >
>> com.altcanvas.readerscope.ReaderTask.doInBackground(ReaderTask.java:21)
>> > com.altcanvas.readerscope.UserTask$2.call(UserTask.java:187)
>> > java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:256)
>> > java.util.concurrent.FutureTask.run(FutureTask.java:122)
>> >
>> >
>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.j­ava:648)
>> >
>> >
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:­673)
>> > java.lang.Thread.run(Thread.java:1058)
>> > ---
>> >
>> > The code around line 145 in

[android-developers] Re: app gives layout errors only on Sprint HTC Hero devices

2009-10-20 Thread Jayesh Salvi
Thanks Shane and Amir for confirming the doubts.
It's frustrating that all I can say to users is to wait until Sprint/HTC
issues firmware update, then hopefully the problem will be fixed. The users
are willing to test if I have any fix, but I can't find root cause even
after looking inside the android code, let alone a fix/workaround.

Does anyone know if Sprint or HTC have any channels to report complaints?
Are there any means to know when they will issue next firmware update?

IIUC Sprint HTC Hero is "with Google" branded phone. I would have assumed it
would be the one with most conformance to Android platform; one that has
passed all test suites required to qualify for the "with Google" logo. Yet
we see these anomalies. :(

--
Jayesh


On Mon, Oct 19, 2009 at 1:15 PM, Amir Alagic  wrote:

>
> I saw somwhere else that one developer also has problems only with HTC
> Hero (Sprint) ...
>
>
>
> On Oct 18, 9:48 am, Shane  wrote:
> > We are having problems only with HTC Hero phones as well.  Our issue
> > is different that yours but it is very disappointing to see not all
> > phones handle the SDK the same.
> >
> > http://groups.google.com/group/android-developers/browse_thread/threa...
> >
> > I suspect this is just going to get worse as more branded android
> > experiences get released by manufacturers.  G
> >
> > On Oct 12, 9:46 pm, Jayesh Salvi  wrote:
> >
> >
> >
> > > I tried to look into the android framework code
> > > (link<
> http://www.google.com/codesearch/p?hl=en&sa=N&cd=1&ct=rc#uX1GffpyOZk/...
> > > android.view.InflateException Error inflating class
> > > java.lang.reflect.Constructor&l=458>). The topmost frame refers to a
> 'throw'
> > > statement(line 512) that is inside a catch of a lower level exception.
> I
> > > can't tell what part of the createView() function throws that lower
> level
> > > exception.
> > > I also tried to search around for the error string "Error inflating
> class
> > > java.lang.reflect.Constructor", but couldn't found one with a similar
> stack
> > > trace. (There are known crashes with this error message caused inside
> > > android.preference.* package, but mine is a simple widget layout and
> not
> > > preferences, as you might have seen in the XML file I attached
> earlier.)
> >
> > > I now have 9 reports of this crash and all of them are confirmed to be
> using
> > > Sprint HTC Hero devices. This problem hasn't been reported on any other
> > > phone. Is it fair to assume that it's a problem in that particular ROM?
> If
> > > that's so, then what options do I have to resolve this issue - should I
> wait
> > > helplessly for HTC/Sprint's next update?
> >
> > > Any suggestions are appreciated.
> >
> > > Thanks.
> > > --
> > > Jayesh
> >
> > > On Mon, Oct 12, 2009 at 8:34 PM, Jayesh Salvi 
> wrote:
> >
> > > > --
> > > > Jayesh
> >
> > > > On Mon, Oct 12, 2009 at 7:49 PM, Streets Of Boston <
> > > > flyingdutc...@gmail.com> wrote:
> >
> > > >> I might be mistaken,
> > > >> But this part of the stack-trace worries me a bit:
> >
> > > >>android.view.LayoutInflater.inflate(LayoutInflater.java:276)
> > > >>com.altcanvas.readerscope.ItemDetails.(ItemDetails.java:
> > > >> 145)
> > > >>
>  com.altcanvas.readerscope.ItemDetails.getInstance(ItemDetails.java:
> > > >> 566)
> > > >>com.altcanvas.readerscope.ReaderTask.doInBackground
> > > >> (ReaderTask.java:1027)
> >
> > > >> Are you inflating a view in a background-thread and not in the main
> > > >> gui-thread?
> > > >> But then again, your code works on other Android phones
> >
> > > > Yes that's true. The layout is inflated in background thread, but is
> made
> > > > part of the root hierarchy (setContentView) only in the GUI thread.
> >
> > > > This doesn't give any problem on emulator or any other phones.
> >
> > > >> On Oct 12, 12:02 am, Jayesh Salvi  wrote:
> > > >> > --
> > > >> > Jayesh
> >
> > > >> > On Mon, Oct 12, 2009 at 1:11 AM, Romain Guy  >
> > > >> wrote:
> >
> > > >> > > Hi,
> >
> > > >> > > The stack trace you show

[android-developers] Re: app gives layout errors only on Sprint HTC Hero devices

2009-10-21 Thread Jayesh Salvi
--
Jayesh


On Wed, Oct 21, 2009 at 7:39 PM, Streets Of Boston
wrote:

>
> I still would try to inflate your view inside your main gui-thread and
> not in a seperate background thread.
>
> The fact that it works on other phones does not guarantee it works on
> all phones, if inflating views on non-gui threads is 'officially' not
> supported.
>

Could you elaborate on how it is 'officially' not supported?

I know that a particular exception is thrown if the framework finds that a
different thread is trying to manipulate widgets in view hierarchy.(I hit it
yesterday elsewhere in the code, and it is not the same as this error). I
haven't found any documentation in this matter, that mentions what is
supported/forbidden practice in this matter. Did I miss something?


>
> Who knows, it may fix it (if you already haven't tried it). :-)
> But i may be wrong...
>
> On Oct 20, 11:57 pm, Jayesh Salvi  wrote:
> > Thanks Shane and Amir for confirming the doubts.
> > It's frustrating that all I can say to users is to wait until Sprint/HTC
> > issues firmware update, then hopefully the problem will be fixed. The
> users
> > are willing to test if I have any fix, but I can't find root cause even
> > after looking inside the android code, let alone a fix/workaround.
> >
> > Does anyone know if Sprint or HTC have any channels to report complaints?
> > Are there any means to know when they will issue next firmware update?
> >
> > IIUC Sprint HTC Hero is "with Google" branded phone. I would have assumed
> it
> > would be the one with most conformance to Android platform; one that has
> > passed all test suites required to qualify for the "with Google" logo.
> Yet
> > we see these anomalies. :(
> >
> > --
> > Jayesh
> >
> >
> >
> > On Mon, Oct 19, 2009 at 1:15 PM, Amir Alagic  wrote:
> >
> > > I saw somwhere else that one developer also has problems only with HTC
> > > Hero (Sprint) ...
> >
> > > On Oct 18, 9:48 am, Shane  wrote:
> > > > We are having problems only with HTC Hero phones as well.  Our issue
> > > > is different that yours but it is very disappointing to see not all
> > > > phones handle the SDK the same.
> >
> > > >
> http://groups.google.com/group/android-developers/browse_thread/threa...
> >
> > > > I suspect this is just going to get worse as more branded android
> > > > experiences get released by manufacturers.  G
> >
> > > > On Oct 12, 9:46 pm, Jayesh Salvi  wrote:
> >
> > > > > I tried to look into the android framework code
> > > > > (link<
> > >http://www.google.com/codesearch/p?hl=en&sa=N&cd=1&ct=rc#uX1GffpyOZk/.
> ..
> > > > > android.view.InflateException Error inflating class
> > > > > java.lang.reflect.Constructor&l=458>). The topmost frame refers to
> a
> > > 'throw'
> > > > > statement(line 512) that is inside a catch of a lower level
> exception.
> > > I
> > > > > can't tell what part of the createView() function throws that lower
> > > level
> > > > > exception.
> > > > > I also tried to search around for the error string "Error inflating
> > > class
> > > > > java.lang.reflect.Constructor", but couldn't found one with a
> similar
> > > stack
> > > > > trace. (There are known crashes with this error message caused
> inside
> > > > > android.preference.* package, but mine is a simple widget layout
> and
> > > not
> > > > > preferences, as you might have seen in the XML file I attached
> > > earlier.)
> >
> > > > > I now have 9 reports of this crash and all of them are confirmed to
> be
> > > using
> > > > > Sprint HTC Hero devices. This problem hasn't been reported on any
> other
> > > > > phone. Is it fair to assume that it's a problem in that particular
> ROM?
> > > If
> > > > > that's so, then what options do I have to resolve this issue -
> should I
> > > wait
> > > > > helplessly for HTC/Sprint's next update?
> >
> > > > > Any suggestions are appreciated.
> >
> > > > > Thanks.
> > > > > --
> > > > > Jayesh
> >
> > > > > On Mon, Oct 12, 2009 at 8:34 PM, Jayesh Salvi <
> jayeshsa...@gmail.com>
> > > wrote:
> >
> > > > > >

[android-developers] IllegalStateException after ListView's adapter has changed

2010-02-21 Thread Jayesh Salvi
Hi,

This is regarding the exception:  "java.lang.IllegalStateException: The
content of the adapter has changed but ListView did not receive a
notification." - seen on Android 1.6+

This problem has been discussed in the past [1][2][3][4], and I have
followed all the solutions suggested in those threads. However, few of my
users still hit this crash. So I did some source code lookup and have some
questions.

Here is the description of what my app is doing:

I use a ListView and populate it with an adapter. The adapter is a direct
derivative of BaseAdapter. I populate the list progressively. As the items
are downloaded from network they get added to the adapter. The fetching of
items is done in doInBackground() and when they are ready to get added to
the adapter I invoke publishProgress(), in the onProgressUpdate() method I
add new items one-by-one to the adapter. As soon as I add the item to the
adapter, I invoke notifyDataSetChanged().

I believe this is as per the best practices that Android developers have
suggested in above mentioned threads.

Despite this I get crash reports with this exception. They are rare, but not
as rare as ignorable. I myself have hit this crash on my phone/emulator only
1-2 times in last couple of months. The user reported crashes are roughly 1
to 3 per day (approx. at least 600 users use the app per day) (A minority of
users may be hitting this crash over and over again)
. This leads me to believe that my adapter update logic is mostly right, but
not full proof.

So I dug into the source code of ListView and BaseAdapter.

The exception is thrown because ListView's mItemCount doesn't match the
underlying adapter's item count. It happens in layoutChildren() [ListView.java
line 
1432<http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/java/android/widget/ListView.java;h=7c8151e65132a91aecadd2048fe205bd1c6768a9;hb=HEAD#l1431>
]

 } else if (mItemCount != mAdapter.getCount()) {
throw new IllegalStateException("The content of the adapter
has changed but "
+ "ListView did not receive a notification. Make
sure the content of "


So in order to avoid this from happening mItemCount should be updated as
soon as the adapter has changed its content. So I searched for locations in
the code where mItemCount is updated. I found two locations doing that. In
setAdapter() [ListView.java
431<http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/java/android/widget/ListView.java;h=7c8151e65132a91aecadd2048fe205bd1c6768a9;hb=HEAD#l431>]
and in onMeasure() [ListView.java
1033<http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/java/android/widget/ListView.java;h=7c8151e65132a91aecadd2048fe205bd1c6768a9;hb=HEAD#l1033>].
Consequently, if I am updating the adapter then either setAdapter() or
onMeasure() should be executed before the comparision in layoutChildren()
takes place, otherwise the exception will be thrown.

My question is, is it possible that my code in onProgressUpdate() that
appends to adapter can get executed between onMeasure() and layoutChildren()
of the ListView? AFAIU, all three of these methods (onProgressUpdate,
onMeasure, layoutChildren) run on the same GUI thread.

I call notifyDataSetChanged immediately after I add to adapter in
onProgressUpdate(). I looked into its source code. It calls methods on
DataSetObservable and DataSetObserver. I couldn't find how it could directly
lead to the updating of mItemCount of the ListView, clearly I don't know
much of the internal layout code.

Please let me know what you think. I am trying to understand this mechanism
as thoroughly as possible.

Thanks in advance.

Links:
[1]
http://www.mail-archive.com/android-developers@googlegroups.com/msg60355.html
[2]
http://www.mail-archive.com/android-developers@googlegroups.com/msg65814.html
[3]
http://groups.google.com/group/android-developers/browse_thread/thread/77722caa85f87697
[4]
http://groups.google.com/group/android-developers/browse_thread/thread/a451221261cb6a93/2ab5bea015c38437?lnk=gst&q=For+Google+about+BaseAdapter+class#2ab5bea015c38437
[5] ListView.java source code I refered to:
http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/java/android/widget/ListView.java;h=7c8151e65132a91aecadd2048fe205bd1c6768a9;hb=HEAD

--
Jayesh

-- 
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] concurrency of AsyncTasks

2009-06-26 Thread Jayesh Salvi
Hi,

I am replacing the multithreaded code in my app with the AsyncTask from 1.5.
I found that two AsyncTasks do not work concurrently. I investigated a bit
and found a workaround; I would like second opinion if my solution is right.
OR if there is a better solution.

AsyncTask allows the app to do a task on a thread other than the UI thread.
But IIUC, it only provides a single thread on which a queue of tasks is
performed. Therefore, if one of the task is to wait on some event (n/w or
sleep) then all other tasks will wait for it to finish.

To elaborate with the coding example:


public class MyTask extends AsyncTask<...>
{ ... }

// On the UI thread execute two tasks
MyTask mt1 = new MyTask().execute(args);

MyTask mt2 = new MyTask().execute(args);



In the above code both the execute calls will return immediately and free up
the UI thread; however mt1 will be executed first and mt2 will have to wait
until mt1 finishes.

Thanks to the android's open source, we can see implementation of AsyncTask.
http://google.com/codesearch/p?hl=en&sa=N&cd=2&ct=rc#uX1GffpyOZk/core/java/android/os/AsyncTask.java&q=lang:java%20AsyncTask

I copied AsyncTask.java as UserTask.java in my project and changed the value
of CORE_POOL_SIZE to 5. This makes the thread pool to use 5 threads to
multiplex the queued AsyncTasks. This indeed solved my problem. Now if mt1
blocks on a sleep; mt2 goes ahead and finishes its job.

Here are some questions for those who know more about AsyncTask
implementation:

Is this work-around right?
If yes, can the CORE_POOL_SIZE be made configurable in future, via an API
call?
Is there a solution by which multiple thread pools can be used?

Let me add that, I am aware that this is a phone and not a web server - I am
not using 10s of threads to do network I/O. However a single thread is not
sufficient for my app either.

Please let me know. Thanks in advance.

Jayesh

--~--~-~--~~~---~--~~
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: concurrency of AsyncTasks

2009-06-26 Thread Jayesh Salvi
Thanks Romain for quick response.

Jayesh

On Fri, Jun 26, 2009 at 10:54 PM, Romain Guy  wrote:

>
> Hi,
>
> It's a bug and your workaround is correct. I'll fix this right away.
>
> On Fri, Jun 26, 2009 at 9:27 AM, Jayesh Salvi
> wrote:
> > Hi,
> >
> > I am replacing the multithreaded code in my app with the AsyncTask from
> 1.5.
> > I found that two AsyncTasks do not work concurrently. I investigated a
> bit
> > and found a workaround; I would like second opinion if my solution is
> right.
> > OR if there is a better solution.
> >
> > AsyncTask allows the app to do a task on a thread other than the UI
> thread.
> > But IIUC, it only provides a single thread on which a queue of tasks is
> > performed. Therefore, if one of the task is to wait on some event (n/w or
> > sleep) then all other tasks will wait for it to finish.
> >
> > To elaborate with the coding example:
> > 
> >
> > public class MyTask extends AsyncTask<...>
> > { ... }
> >
> > // On the UI thread execute two tasks
> > MyTask mt1 = new MyTask().execute(args);
> >
> > MyTask mt2 = new MyTask().execute(args);
> >
> > 
> >
> > In the above code both the execute calls will return immediately and free
> up
> > the UI thread; however mt1 will be executed first and mt2 will have to
> wait
> > until mt1 finishes.
> >
> > Thanks to the android's open source, we can see implementation of
> AsyncTask.
> >
> http://google.com/codesearch/p?hl=en&sa=N&cd=2&ct=rc#uX1GffpyOZk/core/java/android/os/AsyncTask.java&q=lang:java%20AsyncTask
> >
> > I copied AsyncTask.java as UserTask.java in my project and changed the
> value
> > of CORE_POOL_SIZE to 5. This makes the thread pool to use 5 threads to
> > multiplex the queued AsyncTasks. This indeed solved my problem. Now if
> mt1
> > blocks on a sleep; mt2 goes ahead and finishes its job.
> >
> > Here are some questions for those who know more about AsyncTask
> > implementation:
> >
> > Is this work-around right?
> > If yes, can the CORE_POOL_SIZE be made configurable in future, via an API
> > call?
> > Is there a solution by which multiple thread pools can be used?
> >
> > Let me add that, I am aware that this is a phone and not a web server - I
> am
> > not using 10s of threads to do network I/O. However a single thread is
> not
> > sufficient for my app either.
> >
> > Please let me know. Thanks in advance.
> >
> > Jayesh
> >
> > >
> >
>
>
>
> --
> Romain Guy
> Android framework engineer
> romain...@android.com
>
> Note: please don't send private questions to me, as I don't have time
> to provide private support.  All such questions should be posted on
> public forums, where I and others can see and answer them
>
> >
>

--~--~-~--~~~---~--~~
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] autoLink text from app widget

2009-06-30 Thread Jayesh Salvi
Hi,

I have an app widget with a TextView in it. I set its android:autoLink
property to "web|map" so that the links can be clicked to launch them in
browser.

The links become clickable alright, but when I click on them an exception is
thrown while opening the browser Activity.

E/AndroidRuntime( 5923): android.util.AndroidRuntimeException: Calling
startActivity() from outside of an Activity  context requires the
FLAG_ACTIVITY_NEW_TASK flag. Is this really what you
want?
E/AndroidRuntime( 5923):at
android.app.ApplicationContext.startActivity(ApplicationContext.java:627)

E/AndroidRuntime( 5923):at
android.text.style.URLSpan.onClick(URLSpan.java:62)

E/AndroidRuntime( 5923):at
android.text.method.LinkMovementMethod.onTouchEvent(LinkMovementMethod.java:216)

E/AndroidRuntime( 5923):at
android.widget.TextView.onTouchEvent(TextView.java:6315)

E/AndroidRuntime( 5923):at
android.view.View.dispatchTouchEvent(View.java:3368)


This shows as "The process android.process.acore has stopped
unexpectedly..." on screen.

Since I am not launching the Browser activity in my code, I don't know where
I can mention the FLAG_ACTIVITY_NEW_TASK flag.

Any ideas?

Thanks in advance.

Jayesh

--~--~-~--~~~---~--~~
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] Learning Android

2013-04-29 Thread jayesh dalal
I am working PHP,RUBY ON RAILS and making one website ,I want to make as a 
app in android ,how I will start  coding in android ...suggested as a 
beginner.

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Re: SMS/MMS Default App source code into Eclipse?

2012-07-10 Thread jayesh jethava
Well... you need to include all files that are referenced If you 
don't have protobuf how do you expect the classes to use it to function ?

In your project, you should have the following packages (create them and 
add all the files to them if you don't already have them):

Your own source package with your files
com.gc.android.market.api
com.gc.android.market.api.model

And you need to include the protobuf-java-2.2.0.jar file as a library 
(don't know which IDE you are using so don't know the exact 
instructions). But, it will be something like "Build Path" where you add 
the library.

Hope it helps :).


Bistro Bot - Bistro Blurb
http://bgies.comhttp://nocrappyapps.com
http://bistroblurb.com  http://forcethetruth.com
http://ihottonight.com
---
Everything in moderation, including abstinence (paraphrased)

Every person is born with a brain... Those who use it well are the 
successful happy ones - Brad Gies

Adversity can make or break you... It's your choice... Choose wisely - Brad 
Gies

Never doubt that a small group of thoughtful, committed people can
change the world. Indeed. It is the only thing that ever has - Margaret Mead

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