Gregorian Calendar Bug - HTC One A9

Hi, by relating to this post: stackoverflow/questions/34847697/dateformat-produce-wrong-year
I have the same bug in my phone, how do I fix this problem(I want to access and edit android stock code)?
public Date(int year, int month, int day { GregorianCalendar cal = new GregorianCalendar(false); cal.set(1900 + year, month, day); milliseconds = cal.getTimeInMillis();}
By editing it with this code:
public Date(int year, int month, int day){GregorianCalendar cal = new GregorianCalendar(false); cal.set(year, month, day); milliseconds = cal.getTimeInMillis();}
I know how to programming. I just want to reed the code of my android 7.0 device HTC a9u and edit the "190" that add some years in the date that is been shown in my device. Rom is stock but the phone is bought in eu and was a sample in a big market.
p.s. actually my phone display only the date 2012.
Best regards,
Simone

Related

[Q] Default Email app using Hotmail + Exchange + Push, loading html emails

Hello XDA, this is my 1st post, and I'm quite confused about where is should go, so please move it and tell me where if its not in the right forums.
Basically, I'd like to get the default email app in android to load my html emails from hotmail, using exchange and push, because it doesn't do it currently. According to this thread, http://forum.xda-developers.com/showthread.php?t=813920&page=2, it seems to be all about how the email app handles syncing when it sees the EAS version of the hotmail server, since iphone can do it.
I don't feel like using another app, and the stock one being open source, I'd like to try to work it out. Sadly, my object oriented skills died as soon as the teacher started to talk about heritage and polymorphism, and I ended up failing that java class. I therefore need some help with this endeavor.
this is the source code of the email app
http://android.git.kernel.org/?p=platform/packages/apps/Email.git;a=summary
and the specific parts of this problem of the java file we're looking at are in the exchange folder
Eas.java
http://hi-android.info/src/com/android/exchange/Eas.java.html
Code:
// For EAS 12, we use HTML, so we want a larger size than in EAS 2.5
public static final String EAS12_TRUNCATION_SIZE = "200000";
// For EAS 2.5, truncation is a code; the largest is "7", which is 100k
public static final String EAS2_5_TRUNCATION_SIZE = "7";
EasSyncService.java
http://hi-android.info/src/com/android/exchange/EasSyncService.java.html
Code:
if (mProtocolVersionDouble >= Eas.SUPPORTED_PROTOCOL_EX2007_DOUBLE) {
s.start(Tags.BASE_BODY_PREFERENCE)
// HTML for email; plain text for everything else
.data(Tags.BASE_TYPE, (className.equals("Email") ? Eas.BODY_PREFERENCE_HTML
: Eas.BODY_PREFERENCE_TEXT))
.data(Tags.BASE_TRUNCATION_SIZE, Eas.EAS12_TRUNCATION_SIZE)
.end();
} else {
s.data(Tags.SYNC_TRUNCATION, Eas.EAS2_5_TRUNCATION_SIZE);
}
So, umm, we could either do something like
Code:
// For EAS 2.5, truncation is a code; the largest is "7", which is 100k
public static final String EAS2_5_TRUNCATION_SIZE = "2000000"
or change the boolean condition of the eas version
Code:
if (mProtocolVersionDouble >= Eas.SUPPORTED_PROTOCOL_EX2007_DOUBLE || mProtocolVersionDouble <= Eas.SUPPORTED_PROTOCOL_EX2007_DOUBLE) {
s.start(Tags.BASE_BODY_PREFERENCE)
// HTML for email; plain text for everything else
.data(Tags.BASE_TYPE, (className.equals("Email") ? Eas.BODY_PREFERENCE_HTML
: Eas.BODY_PREFERENCE_TEXT))
.data(Tags.BASE_TRUNCATION_SIZE, Eas.EAS12_TRUNCATION_SIZE)
.end();
} else {
s.data(Tags.SYNC_TRUNCATION, Eas.EAS2_5_TRUNCATION_SIZE);
}
or any other combination
I'd like to know if this is the right way to proceed or if I'm a completely lost noob. I don't know have any clue about EAS other than what was said on the other thread. And apparently the API of EAS2.5 is impossible to get.
thanks in advance

PopupWindow getHeight() and getWidth()

I hope this is the correct spot to post this.
OK, so I am starting to get a hang of building Android apps, well at least as much a programmer can after a few days - I am proud of what I have learned so far.
Anyways, I want to force login on the main activity - this I am doing by fetching a SharedPrefernece and than checking if that piece of information is null and than getting a PopupWindow which holds the "login" fields and options.
This PopupWindow has a Flipper inside, which is fine and I got working fine when the certain options are choosen.
I am having problems displaying this PopupWindow to just be the size of the content (wrap_content) as when I set the PopupWindow.setAtLocation()
Now, here is what I have been trying to do to get the size of the popup - as mentioned a few times on here:
Code:
popup.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED);
final PopupWindow pw = new PopupWindow(popup,popup.getMeasuredHeight(),popup.getMeasuredWidth(), true);
Note that popup is the inflator of the actual layout of the Popup, pw is the actual PopupWindow object.
Now, I want to get the actual size of just the popup window (so that way it isn't streched out over the page, but rather just in the center looking like a normal popup should.
Also, with the ViewFlipper. I want it to update the size of the popup when it switch pages (so the page should be sizing up and down per page) is there a way to make this work as well? I tried pw.update() but that didn't work out very well.
BUMP, anyone have any clue what I'm talking about?
Sorry
I believe only one of the devs can help you on this one
Well, I figured it out so far with the PopupWindow.
Code:
LayoutInflater inflater = (LayoutInflater) PartyCentral.this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
final View popup = inflater.inflate(R.layout.login, (ViewGroup) findViewById(R.id.login));
final PopupWindow pw = new PopupWindow(popup, 0, 0, true);
pw.setAnimationStyle(android.R.anim.fade_in);
/** AFTER MAIN VIEW IS LOADED **/
popup.measure(View.MeasureSpec.makeMeasureSpec(findViewById(R.id.main).getWidth(), View.MeasureSpec.AT_MOST), View.MeasureSpec.UNSPECIFIED);
pw.setWidth(popup.getMeasuredWidth());
pw.setHeight(popup.getMeasuredHeight());
pw.showAtLocation(findViewById(R.id.main), Gravity.CENTER, 0, 0);
I hope this solves everyone's problems with PopupWindow!
Also, I am still trying to work on updating the height of a ViewFlipper when it changes.

Gear 2 SDK released

So Gear2 SDK has been released ..
http://tizenindonesia.blogspot.com/2014/03/samsung-rilis-tizen-sdk-for-wearable.html#.Uyci2NxdVzg
Could someone have a look for me how it is to make watchfaces with this thing...
@OpenMind_NL @motive or anyone else..
Please report back to me ....
Thank you in advance...
Martin Founder GearFaces.com
Jeshter2000 said:
So Gear2 SDK has been released ..
http://tizenindonesia.blogspot.com/2014/03/samsung-rilis-tizen-sdk-for-wearable.html#.Uyci2NxdVzg
Could someone have a look for me how it is to make watchfaces with this thing...
@OpenMind_NL @motiive or anyone else..
Please report back to me ....
Thank you in advance...
Martin Founder GearFaces.com
Click to expand...
Click to collapse
I don't talk or read Indonesian very well :cyclops: , but I downloaded the SDK andI noticed it is for Tizen OS and not Android.
Also, when I try to install the SDK (Windows7, 64bit) I get a message:
Cannot start Tizen SDK for Wearable Install Manager.
Cannot find repository. Please check you repository. (http://)
Did not try the Mac installer or the SDK image yet. Maybe later.
Jeshter2000 said:
So Gear2 SDK has been released ..
http://tizenindonesia.blogspot.com/2014/03/samsung-rilis-tizen-sdk-for-wearable.html#.Uyci2NxdVzg
Could someone have a look for me how it is to make watchfaces with this thing...
@OpenMind_NL @motive or anyone else..
Please report back to me ....
Thank you in advance...
Martin Founder GearFaces.com
Click to expand...
Click to collapse
I'll give a look soon.
Sent from my SAMSUNG-SM-N900A using XDA Premium HD app
Ok thanks boys!!
@OpenMind_NL and @motive this is in HTML 5, everything is possible I've been told on MWC...
Edit Im installing now
/*global window, document, tizen, setTimeout */
/*jslint plusplus: true*/
var canvas, context, clockRadius;
window.requestAnimationFrame = window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame ||
function (callback) {
'use strict';
window.setTimeout(callback, 1000 / 60);
};
function renderDots() {
'use strict';
var dx = 0,
dy = 0,
i = 1,
angle = null;
context.save();
//Assigns the clock creation location in the middle of the canvas
context.translate(canvas.width / 2, canvas.height / 2);
//Assign the style of the number which will be applied to the clock plate
context.beginPath();
context.fillStyle = '#999999';
//Create 4 dots in a circle
for (i = 1; i <= 4; i++) {
angle = (i - 3) * (Math.PI * 2) / 4;
dx = clockRadius * 0.9 * Math.cos(angle);
dy = clockRadius * 0.9 * Math.sin(angle);
context.arc(dx, dy, 3, 0, 2 * Math.PI, false);
context.fill();
}
context.closePath();
//Render center dot
context.beginPath();
context.fillStyle = '#ff9000';
context.strokeStyle = '#fff';
context.lineWidth = 4;
context.arc(0, 0, 7, 0, 2 * Math.PI, false);
context.fill();
context.stroke();
context.closePath();
}
function renderNeedle(angle, radius) {
'use strict';
context.save();
context.rotate(angle);
context.beginPath();
context.lineWidth = 4;
context.strokeStyle = '#fff';
context.moveTo(6, 0);
context.lineTo(radius, 0);
context.closePath();
context.stroke();
context.closePath();
context.restore();
}
function renderHourNeedle(hour) {
'use strict';
var angle = null,
radius = null;
angle = (hour - 3) * (Math.PI * 2) / 12;
radius = clockRadius * 0.55;
renderNeedle(angle, radius);
}
function renderMinuteNeedle(minute) {
'use strict';
var angle = null,
radius = null;
angle = (minute - 15) * (Math.PI * 2) / 60;
radius = clockRadius * 0.75;
renderNeedle(angle, radius);
}
function watch() {
'use strict';
//Import the current time
//noinspection JSUnusedAssignment
var date = new Date(),
hours = date.getHours(),
minutes = date.getMinutes(),
seconds = date.getSeconds(),
hour = hours + minutes / 60,
minute = minutes + seconds / 60,
nextMove = 1000 - date.getMilliseconds();
//Erase the previous time
context.clearRect(0, 0, context.canvas.width, context.canvas.height);
renderDots();
renderHourNeedle(hour);
renderMinuteNeedle(minute);
context.restore();
setTimeout(function () {
window.requestAnimationFrame(watch);
}, nextMove);
}
window.onload = function () {
'use strict';
canvas = document.querySelector('canvas');
context = canvas.getContext('2d');
clockRadius = document.width / 2;
//Assigns the area that will use Canvas
canvas.width = document.width;
canvas.height = canvas.width;
//add eventListener for tizenhwkey
window.addEventListener('tizenhwkey', function (e) {
if (e.keyName == 'back') {
tizen.application.getCurrentApplication().exit();
}
});
window.requestAnimationFrame(watch);
};
This is a peace of code from a Sample clock LOL
Sent from my SM-N9005 using XDA Premium 4 mobile app
OpenMind_NL said:
Also, when I try to install the SDK (Windows7, 64bit) I get a message:
Cannot start Tizen SDK for Wearable Install Manager.
Cannot find repository. Please check you repository.
Click to expand...
Click to collapse
I'm having the same issue. No luck so far.
Strange I managed to get it installed
Sent from my SM-N9005 using XDA Premium 4 mobile app
Jeshter what you've pasted there is a HTML5 JS script...
The widgets on the net gear 2 are meant to be HTML5 rumor has it... You will 100% undoubtedly be able to make clock faces.. no problem at all.
No more XML tho... you will have alot more freedom also with CSS. I can hardly wait to get my grubby hands on a gear 2 to tear it down.
Think of it as a OS level zooper widget.. going to be epic.
Code:
//add eventListener for tizenhwkey
window.addEventListener('tizenhwkey', function (e) {
if (e.keyName == 'back') {
tizen.application.getCurrentApplication().exit();
}
});
That bit gets me excited !! Listening for hardware keys from HTML5.. epic.
"tizen.application." must be the prefix for a whole bunch of application specific variables/commands..
OmG OmG sooo cool!
Sent from my SM-N9005 using XDA Premium 4 mobile app
while we should be happy that SDK is already out, it's a terrible news for Gear 1 owners. it only proves that Gear was abandoned shortly after release.
hurdlejade said:
while we should be happy that SDK is already out, it's a terrible news for Gear 1 owners. it only proves that Gear was abandoned shortly after release.
Click to expand...
Click to collapse
This is not true!
Gear one will recieve Tizen aswell my friend..
Jeshter2000 said:
This is not true!
Gear one will recieve Tizen aswell my friend..
Click to expand...
Click to collapse
Care to elaborate?
raiu said:
Care to elaborate?
Click to expand...
Click to collapse
This was all over the news http://www.droid-life.com/2014/02/25/galaxy-gear-update-to-tizen/
But this will happen when the other Watches are available, not sooner....
Jeshter2000 said:
This was all over the news http://www.droid-life.com/2014/02/25/galaxy-gear-update-to-tizen/
But this will happen when the other Watches are available, not sooner....
Click to expand...
Click to collapse
I thought all that was just speculation.
raiu said:
I thought all that was just speculation.
Click to expand...
Click to collapse
No this will happen, only not sooner that the other watches will be available. I think May or even later ...
I just got confimation that they have start building new ROMS they are at XXABNC1 with building....
Jeshter2000 said:
No this will happen, only not sooner that the other watches will be available. I think May or even later ...
I just got confimation that they have start building new ROMS they are at XXABNC1 with building....
Click to expand...
Click to collapse
that doesn't make me any happier at all. i don't want to give up on my all android functionality. noone knows how fluid and how easy it will be to create apps for tizen. i want to stick to android. i don't want to downgrade my gear to tizen.
hurdlejade said:
that doesn't make me any happier at all. i don't want to give up on my all android functionality. noone knows how fluid and how easy it will be to create apps for tizen. i want to stick to android. i don't want to downgrade my gear to tizen.
Click to expand...
Click to collapse
I can Tell you that creating APPS for Tizen will be a lot easier than for android. Simply for the Fact that its HTML 5 and CSS like websitedeveloping.
So in mather of fact every webdesigner/developer could mak apps.
And trust me there are a lot of those people...
Martin
Ps : I think it is a good thing as there is an SDK available so there will be a lot more apps for this thing...
Jeshter2000 said:
I can Tell you that creating APPS for Tizen will be a lot easier than for android. Simply for the Fact that its HTML 5 and CSS like websitedeveloping.
So in mather of fact every webdesigner/developer could mak apps.
And trust me there are a lot of those people...
Martin
Ps : I think it is a good thing as there is an SDK available so there will be a lot more apps for this thing...
Click to expand...
Click to collapse
i heard a lot of good things about 'programming' in html5/css.. but i just don't find it realistic that suddenly, or within a reasonable amount of time - like few months - the developers of the apps i'm using will suddenly switch to tizen.
i will definetly wait few months before changing my OS to Tizen.
i just dont like samsung policy. their updates are constantly broken, and you can't simply do downgrade.
but it's the same with major windows software.. to properly use my Logitech devices, i have to use version from 2012, as any other version released after that has more glitches..
hurdlejade said:
but it's the same with major windows software.. to properly use my Logitech devices, i have to use version from 2012, as any other version released after that has more glitches..
Click to expand...
Click to collapse
this is due Logitech right not updating their drivers.....
This is going to be epic. Going to study up on css and html5.
Sent from my SAMSUNG-SM-N900A using XDA Premium HD app

Heads Up! Possible Malware pre-installed on these devices!

According to Linux Journal, these BNTV450 devices have ADUPS Android Malware.
ref: linuxjournal.com/content/adups-android-malware-infects-barnes-noble (sorry account too new to embed link)
EDIT (12 Jan 2017): An OTA update may have removed threat: androidcentral.com/update-50-nook-tablet-removes-factory-malware-you-still-shouldnt-buy-it
But, is still 100% vulnerable to CVE-2015-6616 or the Stagefright exploit...
Allegedly they are releasing, (or maybe have released in this latest update?) a patch to remove ADUPS. Can anyone with the latest OTA confirm?
Source: https://nakedsecurity.sophos.com/20...d-to-neutralise-adups-fear-says-barnes-noble/
So according to the Android Central article posted by koickxda, it says you still shouldn't buy these. And even though B&N claims that the ADUPS malware has been taken care of, and blah blah blah, I'm still concerned.
Would the malware be completely gone if we flashed a custom ROM? Could we remove ADUPS completely with root access? But, alas, we have neither of those, so that won't lead anywhere. I thought about returning the Nook in the wake of the adapter recall (they accept refunds until the end of February). But I called them, and they confirmed that I would receive a refund in the same way I paid. Which means B&N gift cards. And that isn't helpful if I want to get a Fire Tablet 7" instead.
But besides, there's no LineageOS build for the Fire 7. Nor is there for TWRP. So that might not be a good option either. I don't want FireOS, and I certainly don't want lockscreen ads. (*Ahem,* "Special Offers")
What do you guys think? Is it really a big deal? Is it critical enough that I should I get a refund and (and fork out more money) buy a Samsung Galaxy Nook instead? Like, my info is already on the device, and was probably sent to Chinese servers already, if it was going to. Not that I'm OK with that, but I don't know what to do.
A bit late, but now that we have root access (from this thread) I took a deep look at the software of this device (I was cleaning off all the Nook junk). On my tablet, there was no trace of ADUPS, and there appeared to be a package ("com.emdoor.cleaner") whose job was clearly to remove this. I'll let the disassembled code from it do the talking:
Code:
package com.emdoor.cleaner;
import android.app.Service;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.IBinder;
public class CleanService extends Service {
public IBinder onBind(Intent intent) {
return null;
}
public void onCreate() {
super.onCreate();
}
public int onStartCommand(Intent intent, int flags, int startId) {
try {
PackageManager pm = getPackageManager();
pm.deletePackage("com.adups.fota", new PackageDeleteObserver(), 0);
pm.deletePackage("com.adups.fota.sysoper", new PackageDeleteObserver(), 0);
} catch (Exception ex) {
ex.printStackTrace();
}
return super.onStartCommand(intent, flags, startId);
}
}

Where should my thread go?

So, this is basically a question about where i should best find my solution in this forum, im making an app (just for learning purposes) and wanted to know where i should post about that question as well. This app should only open a website in WebView, and i got that far, now i want to announce something on the website that is excluded with some CSS maybe display: none; for example.
How do i do that? I have been looking for a way to modify the CSS (This announcement is all about the app) contained in a div with a class and an id to make it easier to make that connection. (I own the website and got full control over the files on the server side.)
Bare with me, this is the first time developing anything for android ^^ Thanks!
EDIT: Just because i wrote here i found something interesting in this subject, unfortunatly it's getting late here so ill have to come back tomorrow morning an fill you in. ^^ any suggestions are still appreciated.
So i found this:
public class MyWebClient extends WebViewClient {
@override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
@override
public void onPageFinished(WebView view, String url) {
view.loadUrl("document.getElementsByClassName('someClass').style.display = 'none'");
}
}
.........
final MyWebClient myWebViewClient = new MyWebClient();
mWebView.setWebViewClient(myWebViewClient);
to probably do what i asked for. any suggestions?

Categories

Resources