Monday, April 30, 2012

Re: [android-developers] Timer in Android

I would create a remote service for the timer, and query it, since it would run independently from the activity.

On Apr 30, 2012 8:16 PM, "Mai Al-Ammar" <mai.alammar@gmail.com> wrote:
Hello every one, 

I have a simple question about timer in Android, How can I know if the timer is stopped or not? 
I have an if statement which see if some condition is satisfied, then it will stop the timer by :
if(timerTask != null)
timerTask.cancel();
I want to check after calling the timer if the timer is stopped or not?

Please help me

thanks in advance

--
Mai A. Al-Ammar
Teacher Assistant
Imam Mohammad bin Saud Islamic University
College of Computer Science

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

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

3akarat.com - شقق للايجار بمرسى مطروح

إعلان جديد من عقارات دوت كوم تفاصيل الأعلان : تفاصيل الإعلان . . .

عقارات دوت كوم
----------------------------------------------------------------------------------------

Re: executing raw sql

On Mon, Apr 30, 2012 at 6:26 PM, Dennis Lee Bieber
<wlfraed@ix.netcom.com> wrote:
> On Mon, 30 Apr 2012 15:29:08 -0600, Larry Martell
> <larry.martell@gmail.com> declaimed the following in
> gmane.comp.python.django.user:
>
>>
>> But in django I am doing this:
>>
>> from django.db import connection
>> cursor = connection.cursor()
>> cursor.execute(sql)
>>
>> and it's getting the error, so that would mean that the sql isn't
>> getting executed for some reason. I'll have to investigate that
>> avenue.
>
>        You still haven't show us what "sql" contains... Given your three
> statements I'd expect to get an error message since "sql" itself is
> undefined.

I figured out the problem. I had %s in my sql, and they was getting
treated as a format specifier. When I built the sql I did put in '%%',
but I had to put in 4 '%%%%' for it to work.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

[Rails] Getting Years, Months and days from a day of born

I want to know if you a plugin or script that i can obtain the following
results:


day of born: 21/09/87
results: 24 years, 7 months, 20 days(moreless)

i know it should be a residual calculation but i am wondering if you
know or have seen a way through this.


Regards,

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

GWT Serialization error with HTML String content

Using GWT 2.4. I'm trying to track down the root cause of this...not
sure if I'm doing something wrong or this is a bug someplace.

30 Apr 2012 13:54:48,953 ERROR AtmosphereHandler []: Failed to
deserialize message
com.google.gwt.user.client.rpc.SerializationException: Too few tokens
in RPC request
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.extract(ServerSerializationStreamReader.java:
809)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deserializeStringTable(ServerSerializationStreamReader.java:
735)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.prepareToRead(ServerSerializationStreamReader.java:
449)
at
org.atmosphere.gwt.server.AtmosphereGwtHandler.deserialize(AtmosphereGwtHandler.java:
283)
at
ipt.tas.chatdashboard.ui.gwt.server.AtmosphereHandler.deserialize(AtmosphereHandler.java:
68)
at
org.atmosphere.gwt.server.AtmosphereGwtHandler.doServerMessage(AtmosphereGwtHandler.java:
237)
at
org.atmosphere.gwt.server.AtmosphereGwtHandler.onRequest(AtmosphereGwtHandler.java:
183)
at
org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:
217)
at
org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:
166)
at
org.atmosphere.container.JettyCometSupport.service(JettyCometSupport.java:
99)
at
org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:
1162)
at
org.atmosphere.cpr.AtmosphereServlet.doPost(AtmosphereServlet.java:
293)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:
362)
at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:
216)
at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:
181)
at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:
729)
at
org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
152)
at
org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java:
49)
at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
152)
at org.mortbay.jetty.Server.handle(Server.java:324)
at
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:
505)
at org.mortbay.jetty.HttpConnection
$RequestHandler.content(HttpConnection.java:843)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:647)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:
211)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:
380)
at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:
395)
at org.mortbay.thread.QueuedThreadPool
$PoolThread.run(QueuedThreadPool.java:488)
Caused by: java.lang.IndexOutOfBoundsException: Index: 11, Size: 11
at java.util.ArrayList.rangeCheck(ArrayList.java:604)
at java.util.ArrayList.get(ArrayList.java:382)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.extract(ServerSerializationStreamReader.java:
807)
... 30 more

This happens when I send the following HTML as a string to the
Atmosphere comet framework but that framework just seems to pass this
to GWT's ClientSerializationStreamWriter &
ServerSerializationStreamReader. Here is the string that fails:
<div style="font-family: Arial; font-size: 10pt;"><div
class="chatline" style="text-indent:-10px; margin-left:10px;"><span
class="timestamp-self" style="color:#FF0000;">(Apr 30 2012 15:11:33) </
span><span class="from-self" style="color:#FF0000;">tom: </span><span
class="message">a</span></div>
</div>

But this string works fine with same method:
<div style="font-family: Arial; font-size: 10pt;"></div>

What's going on here? Is there some known restrictions sending HTML
with GWT serialization? How to fix this?

-Dave


--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

[android-developers] Is showing dialog from a dialog possible?

Is showing dialog from a dialog possible? (Not an activity that gets styled as a dialog.)

-Agus.

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

Re: executing raw sql

On Mon, 30 Apr 2012 15:29:08 -0600, Larry Martell
<larry.martell@gmail.com> declaimed the following in
gmane.comp.python.django.user:

>
> But in django I am doing this:
>
> from django.db import connection
> cursor = connection.cursor()
> cursor.execute(sql)
>
> and it's getting the error, so that would mean that the sql isn't
> getting executed for some reason. I'll have to investigate that
> avenue.

You still haven't show us what "sql" contains... Given your three
statements I'd expect to get an error message since "sql" itself is
undefined.

--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: [android-developers] Re: Canvas performance for games

I second the OpenGL route.  It's pretty much the only thing that'll give you the performance you want.  You may also want to check:

On Mon, Apr 30, 2012 at 4:54 PM, Adam Ratana <adam.ratana@gmail.com> wrote:
I think going with OpenGL is likely your best bet here.  Further in the book he will have the OpenGL implementation of the same.  There is also the excellent graphic library by the same, libgdx which you might also consider using.  Another place to look is the replica island source - a fully implemented 2d game, and also look for the "sprite method test" which compares different methods of drawing sprites.

You can indeed choose to only render parts of the screen that you consider dirty, which can also help with your performance, but likely you should be able to get the performance you want with just openGL, a texture atlas and drawing it all at once.



On Sunday, April 29, 2012 12:00:45 PM UTC-4, realh wrote:
I'm new to Android and Java, learning by porting a game I wrote years
ago <http://bombz.sourceforge.net>. Based on the book "Beginning Android
Games" by Mario Zechner, I'm using the technique of creating a fixed size
android.graphics.Bitmap (640x480) in RGB_565 format, rendering the game
tile by tile to its canvas with drawBitmap(bmp, srcRect, dstRect, 0),
then blitting the 640x480 bitmap to a SurfaceView's canvas, also using
drawBitmap().  AIUI drawBitmap() will scale if necessary, but I've only
tested with 1:1 scaling on an 800x480 device, leaving a gap on the side.
All the above is done in a separate thread, using a SurfaceHolder.

It's too slow, even without the debugger attached. The test device is a
ZTE Blade. The original ran at 50fps and looked nice and smooth. I'll
probably run the Android version a bit slower to compensate for
controller difficulties, but I'd like to keep the same amount of
movement per frame. I could halve the framerate and double the movement
per frame, but I think I'd struggle to reach even 20fps, and dropping
the rate further would make it unpleasantly jerky.

I've added some basic profiling and got some average times:

Game logic: < 1ms, fine, but still a lot to be implemented
Rendering the game tile by tile: 46ms, too slow
"Blit": 8ms, not too bad but would need improving to allow time for
        all the other stuff

The core of the stage that's too slow consists of rendering tiles. Each
tile is 32x32 pixels and the game world is made up of 20x15 of them.
There's one source pixmap, also RGB_565, containing all the tiles, and
the correct 32x32 portion for each tile is obtained by the srcRect.

I don't think I could significantly improve the logic of the loop that
does the tile rendering, but I could change the paradigm so that I only
render the tiles that have changed between frames. However, the draw the
whole world on each frame technique is nice and simple and used to work
even back in the days of Acorn computers with <100MHz ARMs, and I want
to progress to writing 4 way scrolling games, where the whole screen has
to be updated every frame. And even in this one I sometimes have to
update a whole load of tiles at once when there's a big explosion chain.

So I think it's just too slow to use Canvases and Bitmaps this way. Is
the answer to my problem to use OpenGL?

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



--
~ Jeremiah:9:23-24
Android 2D MMORPG: http://solrpg.com/http://www.youtube.com/user/revoltingx

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

[android-developers] Timer in Android

Hello every one, 

I have a simple question about timer in Android, How can I know if the timer is stopped or not? 
I have an if statement which see if some condition is satisfied, then it will stop the timer by :
if(timerTask != null)
timerTask.cancel();
I want to check after calling the timer if the timer is stopped or not?

Please help me

thanks in advance

--
Mai A. Al-Ammar
Teacher Assistant
Imam Mohammad bin Saud Islamic University
College of Computer Science

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

Re: RequestFactory and Value Proxy for Objectify Key problem

For anyone else that passes this way looking for the cause of the AssertionError: Incorrect size: 2 in AutoBeanCodexImpl$CoderCreator.getCoder()...

I had an AutoBean with an ArrayList<AnotherAutoBean>.  I changed it to be just List<AnotherAutoBean> and it fixed the problem.

Cheers,
Pete

On Friday, July 8, 2011 9:58:24 AM UTC+10, Phil C wrote:
I am trying to convert our application to use RequestFactory (GWT 2.3
using all com.google.web.bindery.requestfactory.shared references).  I
am running into issues when trying to use an entity proxy for the
objectify key class.

@ProxyFor(Key.class)
public interface KeyProxy<T extends EntityProxy> extends ValueProxy{
        long getId();
        String getKindClassName();
        String getName();
        KeyProxy<?> getParent();
        <V extends EntityProxy> KeyProxy<V> getRoot();
}

the entity class then has a reference to the key like this

public interface BarProxy{
  Key<BarProxy> getKey();
}

we end up with an error like

java.lang.AssertionError: Incorrect size: 2
    at com.google.web.bindery.autobean.shared.impl.AutoBeanCodexImpl
$CoderCreator.getCoder(AutoBeanCodexImpl.java:124)
    at com.google.web.bindery.autobean.shared.impl.AutoBeanCodexImpl
$PropertyCoderCreator.maybeCreateCoder(AutoBeanCodexImpl.java:354)
    at com.google.web.bindery.autobean.shared.impl.AutoBeanCodexImpl
$PropertyCoderCreator.visitReferenceProperty(AutoBeanCodexImpl.java:
341)
    at

when looking at it in the deubugger, there appear to be 2 coders.  The
first is for BarProxy, and the second is for the Key.

Any help appreciated.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/Q-tnuKALCgwJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

[android-developers] Re: Canvas performance for games

I think going with OpenGL is likely your best bet here.  Further in the book he will have the OpenGL implementation of the same.  There is also the excellent graphic library by the same, libgdx which you might also consider using.  Another place to look is the replica island source - a fully implemented 2d game, and also look for the "sprite method test" which compares different methods of drawing sprites.

You can indeed choose to only render parts of the screen that you consider dirty, which can also help with your performance, but likely you should be able to get the performance you want with just openGL, a texture atlas and drawing it all at once.



On Sunday, April 29, 2012 12:00:45 PM UTC-4, realh wrote:
I'm new to Android and Java, learning by porting a game I wrote years
ago <http://bombz.sourceforge.net>. Based on the book "Beginning Android
Games" by Mario Zechner, I'm using the technique of creating a fixed size
android.graphics.Bitmap (640x480) in RGB_565 format, rendering the game
tile by tile to its canvas with drawBitmap(bmp, srcRect, dstRect, 0),
then blitting the 640x480 bitmap to a SurfaceView's canvas, also using
drawBitmap().  AIUI drawBitmap() will scale if necessary, but I've only
tested with 1:1 scaling on an 800x480 device, leaving a gap on the side.
All the above is done in a separate thread, using a SurfaceHolder.

It's too slow, even without the debugger attached. The test device is a
ZTE Blade. The original ran at 50fps and looked nice and smooth. I'll
probably run the Android version a bit slower to compensate for
controller difficulties, but I'd like to keep the same amount of
movement per frame. I could halve the framerate and double the movement
per frame, but I think I'd struggle to reach even 20fps, and dropping
the rate further would make it unpleasantly jerky.

I've added some basic profiling and got some average times:

Game logic: < 1ms, fine, but still a lot to be implemented
Rendering the game tile by tile: 46ms, too slow
"Blit": 8ms, not too bad but would need improving to allow time for
        all the other stuff

The core of the stage that's too slow consists of rendering tiles. Each
tile is 32x32 pixels and the game world is made up of 20x15 of them.
There's one source pixmap, also RGB_565, containing all the tiles, and
the correct 32x32 portion for each tile is obtained by the srcRect.

I don't think I could significantly improve the logic of the loop that
does the tile rendering, but I could change the paradigm so that I only
render the tiles that have changed between frames. However, the draw the
whole world on each frame technique is nice and simple and used to work
even back in the days of Acorn computers with <100MHz ARMs, and I want
to progress to writing 4 way scrolling games, where the whole screen has
to be updated every frame. And even in this one I sometimes have to
update a whole load of tiles at once when there's a big explosion chain.

So I think it's just too slow to use Canvases and Bitmaps this way. Is
the answer to my problem to use OpenGL?

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

Chicago openings?

Does anyone have a Chicago opening for an end-to-end web developer using Python and Django?

--
Christos Jonathan Hayward
Jonathan Hayward, an Orthodox Christian author.

Amazon  Author Bio  Books  Email • Facebook • Google Plus Kindle • LinkedIn • Twitter • Web • What's New?

I invite you to visit my "theology, literature, and other creative works" site. See a random page!

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

[Rails] Flot won't Plot

I'm playing around with FLOT with Ruby and I'm having a hard time
passing the code to javascript; I know my javascript isn't reading the
data correctly from Ruby. I need some syntax help.

Ruby Code:

o={};
o= {'label' => "A", 'data' => @example.collect{|x|
[Time.utc(x.date).to_i, x.num]}}
render :text => o.to_json


I have successfully rendered the output as such:

{"label":"A","data":[[1281225600,1.31],[1281225600,1.31],[1281225600,1.25]]}

The HTML outputs this data only.




My javascript is as follows:


var obj = jQuery.parseJSON(text);
var options = {
lines: { show: true },
points: { show: true },
xaxis: { mode: "time", timeformat: "%m/%d/%y", minTickSize: [1,
"day"]}};

var data = obj;
$.plot(placeholder,[data],options);
}


I think the jQuery.parseJSON(text); isn't working. Any suggestions will
be helpful.

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Re: [help] Server Config: django + uwsgi + nginx

I am not entirely sure what you mean by that. If you mean the nginx equivalent of Apache VirtualHosts then the nginx wiki explains it quite nicely http://wiki.nginx.org/ServerBlockExample. Is that what you meant?

Karl Sutt


On Mon, Apr 30, 2012 at 7:04 PM, easypie <program.py@gmail.com> wrote:
does your configuration allow for running multiple sites?


On Sunday, April 29, 2012 12:01:27 PM UTC-7, Karl Sutt wrote:
Here is my uWSGI command and nginx.conf contents:


I've used it for a Flask application, but I've just tested it and it works for a Django project as well. Note that wsgi.py file in the uwsgi command is the Python file that Django generates when you first create a project, there is no need to change it.

Good luck!

Karl Sutt


On Sun, Apr 29, 2012 at 6:49 PM, easypie <program.py@gmail.com> wrote:
I have this file that was created for me by one of the users in django's irc channel. I edited to have the right information inserted but I"m not sure what I'm doing wrong to not make it work. I've spent some time trying to understand each line by searching the web. There's still a thing or two that's missing from the puzzle. Maybe it's the server config that has a flaw or the way I went about it. I haven't done a fresh install of uwsgi and nginx yet. However, please take a look to see if there's an error or solution that could work. Thanks.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/2rekHP0I6V0J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/sMsRN5iG9NQJ.

To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: [android-developers] problem with access to a database file

http://lmgtfy.com/?q=android+database+tutorial

Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware


On Mon, Apr 30, 2012 at 4:12 PM, Tareq Al-Ma'mari <tariq.mamari@gmail.com> wrote:
Hi ,

How can I use and access a database file (.db) ?
I've tried many ways but nothing works , 
the problem is when I try to open a database file the application crashed , 
so I've tried to check if the database file is exist :

File database = context.getDatabasePath("maindb.db");
database.exists(); // false
database.getPath(); // this gives me the path data/data/MY_Package/databases/maindb.db
database.isFile() ; // false

//////
this is my open command
if(database.exists())
{
myDb=SQLiteDatabase.openDatabase(DB_NAME, null, SQLiteDatabase.NO_LOCALIZED_COLLATORS);
}

please I need help , I'm so tired ,
I've been searching for a long time

yours,
Tareq
 

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

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

[android-developers] Mount SDK

HEY people, is there an option that i can mount\unmount SDK card to
input in my app? Thanks for helping

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

Re: Cakephp SSN Encryption

#1 http://bakery.cakephp.org/articles/jmillerdesign/2011/12/29/cipher_plugin_behavior
#2 http://www.pentaho.com/download/



On Mon, Apr 30, 2012 at 4:46 PM, Steven Scaffidi <sscaff1@gmail.com> wrote:
Hi - I'm looking for information on how to encrypt data in Cakephp. My
employer had a client management system built in Microsoft Access, and
I recently took that application and put it on a web-based space built
in cake. I need to now two things:

#1 How can I encrypt social security numbers from new clients coming
into the system? I'm encrypting passwords right now, but I'm not sure
how to do social security numbers.

#2 How do I take social security numbers that are currently listed in
Microsoft Access with no encryption and put them into the MySQL
database encrypted?

Thanks for the help,

Steven

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
 
 
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

[Rails] Re: parentheses vs braces

Leandro Facchinetti wrote in post #1058817:
> It's Ruby. If the last argument in a function call is a hash, you can
> omit
> the braces.

I think technically it has to do with ambiguity. It doesn't really have
anything do with it being the last argument, but rather omitting the
braces anywhere else in the argument list would cause ambiguity.
Although, that's really just semantics.

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Re: [android-developers] Fitting image to a screen

One point here: the assumption I'm making is that this is for a
wallpaper.

On Mon, Apr 30, 2012 at 03:46:37PM -0600, Justin Anderson wrote:
> >
> > And if you're about to question that, I got this directly from Dianne
> > Hackborn in a thread I
> > started over a year ago (maybe two...I'm not even sure now).
> >
> Do you happen to have a link to said thread?

If I did, don't you think I'd be able to say how long ago it was? ;-}
But given the source of the information---direct from one of THE
Android developers (as in, the platform itself), I think it's safe to
say that you're nuts if you don't listen to what she said.

> I have done image scaling before and have never run into this... My
> constraints were slightly different though... I simply scaled the image
> so that it was as large as possible while maintaining the aspect
> ration.

Yeah, and I tried all of that stuff, too....and no matter what, it kept
getting stretched off-screen when you set it as wallpaper.

> On Mon, Apr 30, 2012 at 3:26 PM, Mohamed ElSanousi <mmurtada57@gmail.com>wrote:
> >
> > Your joking, my whole project is depending. I need to resize this bitmap
> > to fit the screen size, because I want to do calculation on the picture :(

Wait a second...is this for a wallpaper (or lwp)? Or are you just trying
to set an ImageView to full screen? If the former, no, you can't do it.
If the latter, RTFM (http://developer.android.com/guide/index.html).
That's so simple I never even considered that that's what you were
asking. And you don't need to calculate the screen size or anything to
do that. Just the right settings (in XML and maybe also in Java) for an
ImageView.

Later,
--jim

--
THE SCORE: ME: 2 CANCER: 0
73 DE N5IAL (/4) | "> There it was, right in the title bar:
spooky130u@gmail.com | > Microsoft Operations POS."
< Running FreeBSD 7.0 > |
ICBM / Hurricane: | "Never before has a TLA been so appropriately
30.44406N 86.59909W | mis-parsed." (alt.sysadmin.recovery)

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

[android-developers] problem with access to a database file

Hi ,

How can I use and access a database file (.db) ?
I've tried many ways but nothing works , 
the problem is when I try to open a database file the application crashed , 
so I've tried to check if the database file is exist :

File database = context.getDatabasePath("maindb.db");
database.exists(); // false
database.getPath(); // this gives me the path data/data/MY_Package/databases/maindb.db
database.isFile() ; // false

//////
this is my open command
if(database.exists())
{
myDb=SQLiteDatabase.openDatabase(DB_NAME, null, SQLiteDatabase.NO_LOCALIZED_COLLATORS);
}

please I need help , I'm so tired ,
I've been searching for a long time

yours,
Tareq
 

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

[android-developers] Re: Getting system's color value from string resource.



On Monday, April 30, 2012 11:58:13 AM UTC-4, Put_tiMe wrote:
I want to retrieve the system's color value from a resource string, like:

getResources().getIdentifier("android.R.style.TextAppearance_StatusBar_EventContent", "style", getPackageName());



How do I do this?

That is not quite right for it,

Are you using it for TextView?

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

[Rails] Re: Make every little piece a model.

masta Blasta wrote in post #1058719:
> I'm considering making every little piece of editable content on my site
> a model with it's own table.

Call it considered, then go build something sensible.

> So if you think of a blog post for example, the title, subject, body,
> whatever....would be a separate table. With the proper associations of
> course.

I think of a blog post (object) as having a title, subject, body,
whatever (attributes).

> The reason for this is to 1.) allow for special attributes to be
> assigned to each piece of content, 2.) to allow for each piece of
> content to be edited individually via ajax.

I'm sure there are other, simpler, ways to deal with these scenarios.

> You can think of it as making everything into a component/widget.

Not even systems based entirely on components/widgets carry this idea
all the way down to the model layer. Components/widgets are
view/controller layer concerns.

> My questions are:
> 1.) How much extra strain would this be on the database. So now instead
> of just fetching one row with the data, you would query each table
> association for the right info.

I would not expect many to consider this to be a "scalable" design.

> 2.) Does anyone have any good examples/tutorials for turning every piece
> of content on your site into an ajax editable component?

I'm not aware of any. But, there has to be a better way than what you
suggest. AJAX should not in any way dictate how the model layer persists
its data. It's the job of the controller and view to collect and arrange
the data for use by the model.

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Re: [android-developers] Fitting image to a screen

Your joking, my whole project is depending. I need to resize this bitmap to fit the screen size, because I want to do calculation on the picture :(
What kind of calculations are you doing?  You should be able to do that without having to have the image fit the screen size.

Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware


On Mon, Apr 30, 2012 at 3:46 PM, Justin Anderson <magouyaware@gmail.com> wrote:
And if you're about to question that, I got this directly from Dianne Hackborn in a thread I
started over a year ago (maybe two...I'm not even sure now).
Do you happen to have a link to said thread?  I have done image scaling before and have never run into this... My constraints were slightly different though... I simply scaled the image so that it was as large as possible while maintaining the aspect ration.


Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware


On Mon, Apr 30, 2012 at 3:26 PM, Mohamed ElSanousi <mmurtada57@gmail.com> wrote:


 Your joking, my whole project is depending. I need to resize this bitmap to fit the screen size, because I want to do calculation on the picture :(


On Tue, May 1, 2012 at 1:21 AM, Jim Graham <spooky130u@gmail.com> wrote:
On Tue, May 01, 2012 at 01:01:01AM +0400, Mohamed ElSanousi wrote:
> On Tue, May 1, 2012 at 12:16 AM, Justin Anderson <magouyaware@gmail.com>wrote:
> > On Mon, Apr 30, 2012 at 1:56 PM, Mohamed ElSanousi <mmurtada57@gmail.com>wrote:
> >
> > I want the selected picture that is passed to the new activity to fit the
> > > screen size. I want to resize the bitmap to fit the screen exactly.
> >
> > Well, then you would need some code to get the actual pixel dimensions of
> > the screen... right now you have hardcoded values of 750.  Keep in mind
> > that doing this will cause distortion of the image... It will look
> > stretched either in width or height.
>
>  Oh ok. And how will I get the actual pixel dimensions of the screen? I
>  really need your help

I hate to dissapoint you, but as I learned some time ago, you can't.  No
matter what you do, the image will always be stretched beyond the limits
of the screen.  That's just how Android does it.  And if you're about to
question that, I got this directly from Dianne Hackborn in a thread I
started over a year ago (maybe two...I'm not even sure now).

Later,
  --jim

--
THE SCORE:  ME:  2  CANCER:  0
73 DE N5IAL (/4)        | Peter da Silva:  No, try "rm -rf /"
spooky130u@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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

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


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

Re: [android-developers] Fitting image to a screen

And if you're about to question that, I got this directly from Dianne Hackborn in a thread I
started over a year ago (maybe two...I'm not even sure now).
Do you happen to have a link to said thread?  I have done image scaling before and have never run into this... My constraints were slightly different though... I simply scaled the image so that it was as large as possible while maintaining the aspect ration.

Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware


On Mon, Apr 30, 2012 at 3:26 PM, Mohamed ElSanousi <mmurtada57@gmail.com> wrote:


 Your joking, my whole project is depending. I need to resize this bitmap to fit the screen size, because I want to do calculation on the picture :(


On Tue, May 1, 2012 at 1:21 AM, Jim Graham <spooky130u@gmail.com> wrote:
On Tue, May 01, 2012 at 01:01:01AM +0400, Mohamed ElSanousi wrote:
> On Tue, May 1, 2012 at 12:16 AM, Justin Anderson <magouyaware@gmail.com>wrote:
> > On Mon, Apr 30, 2012 at 1:56 PM, Mohamed ElSanousi <mmurtada57@gmail.com>wrote:
> >
> > I want the selected picture that is passed to the new activity to fit the
> > > screen size. I want to resize the bitmap to fit the screen exactly.
> >
> > Well, then you would need some code to get the actual pixel dimensions of
> > the screen... right now you have hardcoded values of 750.  Keep in mind
> > that doing this will cause distortion of the image... It will look
> > stretched either in width or height.
>
>  Oh ok. And how will I get the actual pixel dimensions of the screen? I
>  really need your help

I hate to dissapoint you, but as I learned some time ago, you can't.  No
matter what you do, the image will always be stretched beyond the limits
of the screen.  That's just how Android does it.  And if you're about to
question that, I got this directly from Dianne Hackborn in a thread I
started over a year ago (maybe two...I'm not even sure now).

Later,
  --jim

--
THE SCORE:  ME:  2  CANCER:  0
73 DE N5IAL (/4)        | Peter da Silva:  No, try "rm -rf /"
spooky130u@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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

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

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

Cakephp SSN Encryption

Hi - I'm looking for information on how to encrypt data in Cakephp. My
employer had a client management system built in Microsoft Access, and
I recently took that application and put it on a web-based space built
in cake. I need to now two things:

#1 How can I encrypt social security numbers from new clients coming
into the system? I'm encrypting passwords right now, but I'm not sure
how to do social security numbers.

#2 How do I take social security numbers that are currently listed in
Microsoft Access with no encryption and put them into the MySQL
database encrypted?

Thanks for the help,

Steven

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

3akarat.com - عرض بيع منزل مكون من 4 طوابق

إعلان جديد من عقارات دوت كوم تفاصيل الأعلان : تفاصيل الإعلان . . .

عقارات دوت كوم
----------------------------------------------------------------------------------------

Re: executing raw sql

On Mon, Apr 30, 2012 at 2:32 PM, Larry Martell <larry.martell@gmail.com> wrote:
> On Mon, Apr 30, 2012 at 12:46 PM, Larry Martell <larry.martell@gmail.com> wrote:
>> I'm trying to execute some raw sql. I found some code that did this:
>>
>> from django.db import connection
>> cursor = connection.cursor()
>> cursor.execute(sql)
>> data = cursor.fetchall()
>>
>> But the cursor.execute(sql) is blowing up with:
>>
>> 'Cursor' object has no attribute '_last_executed'
>>
>> What is the best or proper way for me to execute my raw sql?
>
> I traced this with the debugger,  and it's blowing up in
> django/db/backends/mysql/base.py in this:
>
>    def last_executed_query(self, cursor, sql, params):
>        # With MySQLdb, cursor objects have an (undocumented) "_last_executed"
>        # attribute where the exact query sent to the database is saved.
>        # See MySQLdb/cursors.py in the source distribution.
>        return cursor._last_executed
>
> Could this have something to do with the version of django and/or mysql?
>
> I'm running django 1.5 and MySQL 5.5.19, and MySQLdb 1.2.3. I just
> tried this and that does not exist on my system:
>
> $ python
> Python 2.6.7 (r267:88850, Jan 11 2012, 06:42:34)
> [GCC 4.0.1 (Apple Inc. build 5490)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import MySQLdb
>>>> conn = MySQLdb.connect(host, user, passwd, db)
>>>> cursor = conn.cursor()
>>>> print cursor._last_executed
> Traceback (most recent call last):
>  File "<stdin>", line 1, in <module>
> AttributeError: 'Cursor' object has no attribute '_last_executed'
>>>> print cursor.__dict__
> {'_result': None, 'description': None, 'rownumber': None, 'messages':
> [], '_executed': None, 'errorhandler': <bound method
> Connection.defaulterrorhandler of <_mysql.connection open to
> 'localhost' at 889810>>, 'rowcount': -1, 'connection': <weakproxy at
> 0x62f630 to Connection at 0x889810>, 'description_flags': None,
> 'arraysize': 1, '_info': None, 'lastrowid': None, '_warnings': 0}

I've found that cursor._last_executed doesn't exist until a query has
been executed (it's not initialized to None)

But in django I am doing this:

from django.db import connection
cursor = connection.cursor()
cursor.execute(sql)

and it's getting the error, so that would mean that the sql isn't
getting executed for some reason. I'll have to investigate that
avenue.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: [android-developers] Fitting image to a screen



 Your joking, my whole project is depending. I need to resize this bitmap to fit the screen size, because I want to do calculation on the picture :(

On Tue, May 1, 2012 at 1:21 AM, Jim Graham <spooky130u@gmail.com> wrote:
On Tue, May 01, 2012 at 01:01:01AM +0400, Mohamed ElSanousi wrote:
> On Tue, May 1, 2012 at 12:16 AM, Justin Anderson <magouyaware@gmail.com>wrote:
> > On Mon, Apr 30, 2012 at 1:56 PM, Mohamed ElSanousi <mmurtada57@gmail.com>wrote:
> >
> > I want the selected picture that is passed to the new activity to fit the
> > > screen size. I want to resize the bitmap to fit the screen exactly.
> >
> > Well, then you would need some code to get the actual pixel dimensions of
> > the screen... right now you have hardcoded values of 750.  Keep in mind
> > that doing this will cause distortion of the image... It will look
> > stretched either in width or height.
>
>  Oh ok. And how will I get the actual pixel dimensions of the screen? I
>  really need your help

I hate to dissapoint you, but as I learned some time ago, you can't.  No
matter what you do, the image will always be stretched beyond the limits
of the screen.  That's just how Android does it.  And if you're about to
question that, I got this directly from Dianne Hackborn in a thread I
started over a year ago (maybe two...I'm not even sure now).

Later,
  --jim

--
THE SCORE:  ME:  2  CANCER:  0
73 DE N5IAL (/4)        | Peter da Silva:  No, try "rm -rf /"
spooky130u@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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

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

Re: Google Map interface question

This won't be exactly what you're after, but I have recently implemented something quite similar. The following (1.3 code) will allow the user to drag and drop a pin to change the lat/long of that pin on the fly.

View

The first thing you'll need is to do is add a couple of json properties when you're defining each of your markers in your view, for example:

var marker = new google.maps.Marker({
...
                callbackUrl: "http://www.yoursite.com/<controller>/<action>/<id>",
                draggable: true
});

Then you'll need to add an event listener to listen for the "dragend" event of the pin:

// Add a "dragend" event listener so that we can determine the lat/long of the drop point
google.maps.event.addListener(marker, "dragend", function() {

var position = marker.getPosition();
var _data = "latitude=" + position.lat() + "&longitude=" + position.lng();
$.ajax({
type: "POST",
url: marker.callbackUrl,
data: _data,
success: function(data) {
// Do some stuff to notify the user that the lat/long has been updated
}
});

});

Controller

In your callback action within your controller, you'll need something like this:

function <action>($id = null) {
$this->autoRender = false;

if ($this->RequestHandler->isAjax()) {

Configure::write('debug', 0);
$this->layout = 'ajax';

$data['<Model>']['id'] = $id;

// Build up the data based on the posted form values
foreach($this->params['form'] as $key => $value) {
$data['<Model>'][$key] = $value;
}
// Save the data
if (!$this-><Model>->save($data)) {
$this->log($data, 'error');
$this->log($this-><Model>->validationErrors, 'error');

$this->set('message', 'There was an error updating the location for <b>' . $<model>['<Model>']['name'] . '</b>');
$this->render('/elements/flash/error', 'ajax');
} else {
$this->set('message', 'The location for <b>' . $<model>['<Model>']['name'] . '</b> has been updated');
$this->render('/elements/flash/success', 'ajax');
}
}
}

Like I said, I know this isn't exactly what you're after, but hopefully it will be of some use to you.

On 30 Apr 2012, at 05:13, Michael Gaiser wrote:

So, I want to use Google maps on my project which makes use of a
Location model. In that model there is a longitude and latitude value.
Most of the tutorials I have looked at talk about how to place
markers on your map. What I want to do is use the map to allow people
to navigate to the location they are editing and set the longitude and
latitude based on the current center of the map giving an easy
interface for entering in such values. So it leads me to this
question: How do I get the long/lat values from the google map and
save those values to my database? Thanks.

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Re: [android-developers] Fitting image to a screen

On Tue, May 01, 2012 at 01:01:01AM +0400, Mohamed ElSanousi wrote:
> On Tue, May 1, 2012 at 12:16 AM, Justin Anderson <magouyaware@gmail.com>wrote:
> > On Mon, Apr 30, 2012 at 1:56 PM, Mohamed ElSanousi <mmurtada57@gmail.com>wrote:
> >
> > I want the selected picture that is passed to the new activity to fit the
> > > screen size. I want to resize the bitmap to fit the screen exactly.
> >
> > Well, then you would need some code to get the actual pixel dimensions of
> > the screen... right now you have hardcoded values of 750. Keep in mind
> > that doing this will cause distortion of the image... It will look
> > stretched either in width or height.
>
> Oh ok. And how will I get the actual pixel dimensions of the screen? I
> really need your help

I hate to dissapoint you, but as I learned some time ago, you can't. No
matter what you do, the image will always be stretched beyond the limits
of the screen. That's just how Android does it. And if you're about to
question that, I got this directly from Dianne Hackborn in a thread I
started over a year ago (maybe two...I'm not even sure now).

Later,
--jim

--
THE SCORE: ME: 2 CANCER: 0
73 DE N5IAL (/4) | Peter da Silva: No, try "rm -rf /"
spooky130u@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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] tracing

No, that runs fine without necessarily running it through a debugger.
You will get your output either way.

On Mon, Apr 30, 2012 at 5:11 PM, bob <bob@coolfone.comze.com> wrote:
> Should you be in Debug mode to properly use this tracing functionality?
>
>     // start tracing to "/sdcard/calc.trace"
>     Debug.startMethodTracing("calc");
>     // ...
>     // stop tracing
>     Debug.stopMethodTracing();
>
> Or, does it pretty much not matter?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en



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

Re: [android-developers] Fitting image to a screen

http://lmgtfy.com/?q=android+get+pixel+dimensions+of+screen

Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware


On Mon, Apr 30, 2012 at 3:01 PM, Mohamed ElSanousi <mmurtada57@gmail.com> wrote:


 Oh ok. And how will I get the actual pixel dimensions of the screen? I really need your help
 Thanks


On Tue, May 1, 2012 at 12:16 AM, Justin Anderson <magouyaware@gmail.com> wrote:
I want the selected picture that is passed to the new activity to fit the screen size. I want to resize the bitmap to fit the screen exactly.
Well, then you would need some code to get the actual pixel dimensions of the screen... right now you have hardcoded values of 750.  Keep in mind that doing this will cause distortion of the image... It will look stretched either in width or height.


Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware


On Mon, Apr 30, 2012 at 1:56 PM, Mohamed ElSanousi <mmurtada57@gmail.com> wrote:

 I want the selected picture that is passed to the new activity to fit the screen size. I want to resize the bitmap to fit the screen exactly.
 Thanks

On Mon, Apr 30, 2012 at 11:10 PM, Justin Anderson <magouyaware@gmail.com> wrote:
What exactly are you trying to accomplish?  You said "the returned image is stretched and doesn't fit the mobile screen size" but I don't see anywhere in your code where you are doing anything with the screen size of the device...  What exactly are you expecting and what exactly are you seeing?


Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware


On Mon, Apr 30, 2012 at 1:04 PM, Mohamed ElSanousi <mmurtada57@gmail.com> wrote:
No.


On Mon, Apr 30, 2012 at 10:53 PM, Justin Anderson <magouyaware@gmail.com> wrote:
Are you putting the Bitmap in an ImageView? 

Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware


On Mon, Apr 30, 2012 at 12:44 PM, Mohamed ElSanousi <mmurtada57@gmail.com> wrote:


 Code:
 I have this code in the Activity result, when the user hits load, it will open the gallery allow him to choose a picture. The selected pictured is passed to another activity, here is where i'm facing the problem. The picture doesn't fit the screen.
     
                        
                Uri selectedimage= data.getData();

         Uri contentUri = data.getData();          

             String[] proj = { MediaStore.Images.Media.DATA };         

             Cursor cursor = managedQuery(contentUri, proj, null, null, null);         

             int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);         

             cursor.moveToFirst();         

             String tmppath = cursor.getString(column_index);

             

         Intent intent= new Intent(this,NasalProjectionActivity.class);

         intent.putExtra("imagePath",tmppath);

           startActivity(intent);  


 Receiving Activity,

 Thats what i have on the receiving activity.

    

     Bitmap b = BitmapFactory.decodeFile(getIntent().getStringExtra("imagePath"));

        int newHe=750;

        int newWe=750;

       


        int width=b.getWidth();

        int height = b.getHeight();

        float scaleWidth = ((float) newWe) / width;

        float scaleHeight = ((float) newHe) / height;

        Matrix matrix = new Matrix();

        matrix.postScale(scaleWidth, scaleHeight);

        Bitmap resizedBitmap = Bitmap.createBitmap(b, 0, 0, width, height, matrix, false);         


Thanks alot

On Mon, Apr 30, 2012 at 7:51 PM, Justin Anderson <magouyaware@gmail.com> wrote:
What have you tried so far?  How are you loading the image?

Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware



On Mon, Apr 30, 2012 at 1:55 AM, Mohamed ElSanousi <mmurtada57@gmail.com> wrote:
Hi!!

 I'm trying to load a picture from the gallery and display, everything
works fine except that the returned image is stretched and doesn't fit
the mobile screen size? I need help, thanks alot :)

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

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

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

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

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

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

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

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

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

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


Real Estate