[APP] Android L Calculator

Search This thread

DonSolo

Senior Member
May 3, 2010
787
175
Warren,MI
Are we really sitting here debating a mathematical equation? You guys need to GO TO BED!!

I love the calculator but it lags so bad when opening and swiping. I'm not using ART right now so that may be the issue. However, I don't think Dalvik RT would make it lag THAT much.
 

projectvomit

Senior Member
Jul 8, 2009
119
33
Bolivar
Are we really sitting here debating a mathematical equation? You guys need to GO TO BED!!

I love the calculator but it lags so bad when opening and swiping. I'm not using ART right now so that may be the issue. However, I don't think Dalvik RT would make it lag THAT much.

I'm using art and there is still a lag.

Sent from my Nexus 5 using XDA Premium 4 mobile app
 

TheArc

Inactive Recognized Themer
Jan 1, 2012
2,512
2,122
26
Auckland
The reason it lags is because of this (possible) assumption. The application needs full network access in order to work. Which means the dev probably just created a linked web app.

How this works? You create an app with no actionbar and remove the controls. In the code direct the app to a URL with WebView and give it internet permissions in your Manifest.

Outcome - You get an app the automatically redirects to a URL that was in the code, in other means. The URL for the Polymer Calculator example.

Anyways, its still nice though.
 
Last edited:

aooga

Senior Member
Feb 19, 2011
3,263
972
California
The reason it lags is because of this (possible) assumptions. It needs full network access. Which means the dev probably just created a linked web app.

How this works? You create an app with no actionbar and remove the controls. In the code direct the app to a URL with webView and give it internet permissions.

Outcome - you get an app the automatically redirects to a URL.

Anyways, its still nice though.

You're 100% right. This is literally a web view with a hidden action bar.
 

tracerit

Senior Member
Jan 7, 2008
1,212
129
Orange County, CA
nice looking calculator but i'm still disappointed that no one has created a simple looking calculator app that shows a history of the last 2-3 calculations without having to press some sort of "history" button.
 

DAN13L8

New member
Nov 7, 2013
1
0
It's an Webview app....

It's not possible to install the with the new material design on 4.x.x. That's because the API that they used for the Original Calculator app does not support android versions under L (5.0). Even if you edit in Build.prop...
 

meechieballer

Senior Member
Jan 26, 2012
127
16
31
Philadelphia
The reason it lags is because of this (possible) assumptions. It needs full network access. Which means the dev probably just created a linked web app.

How this works? You create an app with no actionbar and remove the controls. In the code direct the app to a URL with webView and give it internet permissions.

Outcome - you get an app the automatically redirects to a URL.

Anyways, its still nice though.

you are a Genius:highfive:
 

JovieBrett

Senior Member
Dec 17, 2012
821
308
Manila
Hey @virjog thanks alot for this!
Btw, how'd you converted the polymer based web app into an .apk? can you provide some details/tut on how to do that if it does not bothers you? just for our project on school, hehe thank you!

EDIT
Oh ok so this is supposedly a webview app, hearing more details would be nice. Thanks!
 

TheArc

Inactive Recognized Themer
Jan 1, 2012
2,512
2,122
26
Auckland
Hey @virjog thanks alot for this!
Btw, how'd you converted the polymer based web app into an .apk? can you provide some details/tut on how to do that if it does not bothers you? just for our project on school, hehe thank you!

EDIT
Oh ok so this is supposedly a webview app, hearing more details would be nice. Thanks!
All you have to do is create a WebView application. To achieve this you can do it by pressing a button or doing something. But I believe you want to load a page right away like the guy has done for this Calculator.

First you'll need to prepare a layout with the WebView element. Make sure the WebView fills the whole parent. Then give it an appropriate id. Something like - @+id/WebView or whatever you wish.

Next you will need to go into the code and add the following.

Import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView; *

public class WebViewActivity extends Activity { * private WebView webView; * public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.webView); * webView = (WebView) findViewById(R.id.webView); webView.getSettings().setJavaScriptEnabled(true); webView.loadUrl("yourwebsite.com"); * } * }

And it should automatically load your website.
 
  • Like
Reactions: JovieBrett

JovieBrett

Senior Member
Dec 17, 2012
821
308
Manila
All you have to do is create a WebView application. To achieve this you can do it by pressing a button or doing something. But I believe you want to load a page right away like the guy has done for this Calculator.

First you'll need to prepare a layout with the WebView element. Make sure the WebView fills the whole parent. Then give it an appropriate id. Something like - @+id/WebView or whatever you wish.

Next you will need to go into the code and add the following.

Import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView; *

public class WebViewActivity extends Activity { * private WebView webView; * public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.webView); * webView = (WebView) findViewById(R.id.webView); webView.getSettings().setJavaScriptEnabled(true); webView.loadUrl("yourwebsite.com"); * } * }

And it should automatically load your website.

Thank you for this really great info! Truly appreciated it!
 

Top Liked Posts

  • There are no posts matching your filters.
  • 22
    Hey guys,

    I managed to convert the demo calculator on the Polymer Project website into an .apk so we can use the material design calculator on our phone.

    Let me know what you guys think.

    Here are some screenshots:

    xFIh0D2.png


    t7Y1iip.png


    I44XNys.png
    4
    Results seems incorrect.

    50+10%+10 shows 50

    Correct answer is 65

    Sent from my Nexus 5 using XDA Free mobile app

    Garbage in Garbage out
    go back to school sonny :p
    3
    The reason it lags is because of this (possible) assumption. The application needs full network access in order to work. Which means the dev probably just created a linked web app.

    How this works? You create an app with no actionbar and remove the controls. In the code direct the app to a URL with WebView and give it internet permissions in your Manifest.

    Outcome - You get an app the automatically redirects to a URL that was in the code, in other means. The URL for the Polymer Calculator example.

    Anyways, its still nice though.
    2
    Results seems incorrect.

    50+10%+10 shows 50

    Correct answer is 65

    Sent from my Nexus 5 using XDA Free mobile app
    2
    What the hell is 50+10%? 10% of what? That doesn't make any sense.

    I was just testing the calculator.

    This is the first thing came to my head. Calculation makes perfect sense,

    10% of 50 is 5

    So it’s 50 + 5 + 10

    Don’t think this calculator can handle percentage.






    Garbage in Garbage out
    go back to school sonny :p

    Your comment has no value what so ever. Waste of digital space. Don’t think it’s me who needs to go back to school.

    Sent from my Nexus 5 using XDA Free mobile app