Intermediate: How to Integrate Location Kit into Hotel booking application - Huawei P30 Pro Themes, Apps, and Mods

Introduction
This article is based on Multiple HMS services application. I have created Hotel Booking application using HMS Kits. We need mobile app for reservation hotels when we are traveling from one place to another place.
In this article, I am going to implement HMS Location Kit & Shared Preferences.
View attachment 5230279
Flutter setup
Refer this URL to setup Flutter.
Software Requirements
1. Android Studio 3.X
2. JDK 1.8 and later
3. SDK Platform 19 and later
4. Gradle 4.6 and later
Steps to integrate service
1. We need to register as a developer account in AppGallery Connect.
2. Create an app by referring to Creating a Project and Creating an App in the Project
3. Set the data storage location based on current location.
4. Enabling Required Services: Location Kit.
5. Generating a Signing Certificate Fingerprint.
6. Configuring the Signing Certificate Fingerprint.
7. Get your agconnect-services.json file to the app root directory.
Important: While adding app, the package name you enter should be the same as your Flutter project’s package name.
Note: Before you download agconnect-services.json file, make sure the required kits are enabled.
Development Process
Create Application in Android Studio.
1. Create Flutter project.
2. App level gradle dependencies. Choose inside project Android > app > build.gradle.
Code:
apply plugin: 'com.android.application'
apply plugin: 'com.huawei.agconnect'
Root level gradle dependencies
Code:
maven {url 'https://developer.huawei.com/repo/'}
classpath 'com.huawei.agconnect:agcp:1.4.1.300'
Add the below permissions in Android Manifest file.
Code:
<manifest xlmns:android...>
...
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<uses-permission android:name="android.permission.ACTIVITY_RECOGNITION" />
<uses-permission android:name="com.huawei.hms.permission.ACTIVITY_RECOGNITION" />
<application ...
</manifest>
3. Refer below URL for cross-platform plugins. Download required plugins.
https://developer.huawei.com/consum...y-V1/flutter-sdk-download-0000001050304074-V1
4. After completing all the steps above, you need to add the required kits’ Flutter plugins as dependencies to pubspec.yaml file. You can find all the plugins in pub.dev with the latest versions.
Code:
dependencies:
flutter:
sdk: flutter
shared_preferences: ^0.5.12+4
bottom_navy_bar: ^5.6.0
cupertino_icons: ^1.0.0
provider: ^4.3.3
huawei_location:
path: ../huawei_location/
flutter:
uses-material-design: true
assets:
- assets/images/
5. After adding them, run flutter pub get command. Now all the plugins are ready to use.
6. Open main.dart file to create UI and business logics.
Location kit
HUAWEI Location Kit assists developers in enabling their apps to get quick and accurate user locations and expand global positioning capabilities using GPS, Wi-Fi, and base station locations.
Fused location: Provides a set of simple and easy-to-use APIs for you to quickly obtain the device location based on the GPS, Wi-Fi, and base station location data.
Activity identification: Identifies user motion status through the acceleration sensor, cellular network information, and magnetometer, helping you adjust your app based on user behaviour.
Geofence: Allows you to set an interested area through an API so that your app can receive a notification when a specified action (such as leaving, entering, or lingering in the area) occurs.
Integration
Permissions
First of all we need permissions to access location and physical data.
Create a PermissionHandler instance,add initState() for initialize.
Code:
final PermissionHandler permissionHandler;
@override
void initState() {
permissionHandler = PermissionHandler(); super.initState();
}
Check Permissions
We need to check device has permission or not using hasLocationPermission() method.
Code:
void hasPermission() async {
try {
final bool status = await permissionHandler.hasLocationPermission();
if(status == true){
showToast("Has permission: $status");
}else{
requestPermission();
}
} on PlatformException catch (e) {
showToast(e.toString());
}
}
If device don’t have permission,then request for Permission to use requestLocationPermission() method.
Code:
void requestPermission() async {
try {
final bool status = await permissionHandler.requestLocationPermission();
showToast("Is permission granted");
} on PlatformException catch (e) {
showToast(e.toString());
}
}
Fused Location
Create FusedLocationPrvoiderClient instance using the init() method and use the instance to call location APIs.
Code:
final FusedLocationProviderClient locationService
@override
void initState() {
locationService = FusedLocationProviderClient(); super.initState();
}
getLastLocation()
Code:
void getLastLocation() async {
try {
Location location = await locationService.getLastLocation();
setState(() {
lastlocation = location.toString();
print("print: " + lastlocation);
});
} catch (e) {
setState(() {
print("error: " + e.toString());
});
}
}
getLastLocationWithAddress()
Create LocationRequest instance and set required parameters.
Code:
final LocationRequest locationRequest;
locationRequest = LocationRequest()
..needAddress = true
..interval = 5000;
void _getLastLocationWithAddress() async {
try {
HWLocation location =
await locationService.getLastLocationWithAddress(locationRequest);
setState(() {
String street = location.street;
String city = location.city;
String countryname = location.countryName;
currentAddress = '$street' + ',' + '$city' + ' , ' + '$countryname';
print("res: $location");
});
showToast(currentAddress);
} on PlatformException catch (e) {
showToast(e.toString());
}
}
Location Update using Call back
Create LocationCallback instance and create callback functions in initstate().
Code:
LocationCallback locationCallback;
@override
void initState() {
locationCallback = LocationCallback(
onLocationResult: _onCallbackResult,
onLocationAvailability: _onCallbackResult,
);
super.initState();
}
void requestLocationUpdatesCallback() async {
if (_callbackId == null) {
try {
final int callbackId = await locationService.requestLocationUpdatesExCb(
locationRequest, locationCallback);
_callbackId = callbackId;
} on PlatformException catch (e) {
showToast(e.toString());
}
} else {
showToast("Already requested location updates.");
}
}
void onCallbackResult(result) {
print(result.toString());
showToast(result.toString());
}
I have created Helper class to store user login information in locally using shared Preferences class.
Code:
class StorageUtil {
static StorageUtil _storageUtil;
static SharedPreferences _preferences;
static Future<StorageUtil> getInstance() async {
if (_storageUtil == null) {
var secureStorage = StorageUtil._();
await secureStorage._init();
_storageUtil = secureStorage;
}
return _storageUtil;
}
StorageUtil._();
Future _init() async {
_preferences = await SharedPreferences.getInstance();
}
// get string
static String getString(String key) {
if (_preferences == null) return null;
String result = _preferences.getString(key) ?? null;
print('result,$result');
return result;
}
// put string
static Future<void> putString(String key, String value) {
if (_preferences == null) return null;
print('result $value');
return _preferences.setString(key, value);
}
}
Result
View attachment 5230281
Tips & Tricks
1. Download latest HMS Flutter plugin.
2. To work with mock location we need to add permissions in Manifest.XML.
3. Whenever you updated plugins, click on pug get.
Conclusion
We implemented simple hotel booking application using Location kit in this article. We have learned how to get Lastlocation, getLocationWithAddress and how to use callback method, in flutter how to store data into Shared Preferences in applications.
Thank you for reading and if you have enjoyed this article, I would suggest you to implement this and provide your experience.
Reference
Location Kit URL
Shared Preferences URL
Read full article

@XDARoni
Spoiler: I guess I'm missing the question part?
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}

Related

WP7 FTP+HTTP Client public library - need testers

Hi Friends.
I did some attempts to make working WP7 FTP(+HTTP) library. It may allow to endpoint applications to list, upload and download ANY files (include binaries etc.) from FTP or HTTP servers.
The simpliest way is to use web service. I have got working one, but based on closed code hacked, then it is possible for my internal use only, not for public presentation. Second problem is web services unstability.
Second way is native code, allowed by RootProject or custom ROM. First I tried MFC Internet+FTP classes. But WinInet functions are disabled or not present in WP7 core (or I do not know only, how to allowe them).
Then I have got public multiplatform source FTPClient library, based on native sockets management, and did (very small) changes in it to be usable at unlocked WP7. Library is working now. But, only simple native test application is finished and I have no free time now.
If you somebody want to participate, write here or send me PM. I will send FTP account to site, containing full source code and FTP test subsite too.
It is needed:
1. To repair SIZE command. On some servers library gets code 550 SIZE is not allowed in ASCII mode (library changes mode in download time only).
2. To make better, WM/WP consistent interface.
3. To make managed wrapper (we will do it to w.i.n.c.o's wNativeCom library and as Phone Commander plugin, but WP7DllImport wrapper is needed too).
4. To make automatical tests or to test all functions manually.
5. To refactorize all project by used code opensource licence.
Martin7Pro said:
Second way is native code, allowed by RootProject or custom ROM. First I tried MFC Internet+FTP classes. But WinInet functions are disabled or not present in WP7 core (or I do not know only, how to allowe them).
Click to expand...
Click to collapse
WININET is working and internally used by MS apps.
ultrashot said:
WININET is working and internally used by MS apps.
Click to expand...
Click to collapse
Thanks for info. I thought that it must be used. But, when I use WinInet CE6 API, I have got error "This function is not supported on this system". What I must do to use InternetConnect() etc? Thanks, M.
Martin7Pro said:
Thanks for info. I thinked it must be used. But, when I use WinInet CE6 API, I have got error "This function is not supported on this system". What I must do to use InternetConnect() etc? Thanks, M.
Click to expand...
Click to collapse
I don't know what you use and from where do you get this error - it mustn't happen if you use APIs directly.
ultrashot said:
I don't know what you use and from where do you get this error - it mustn't happen if you use APIs directly
Click to expand...
Click to collapse
Code:
HINTERNET hInternetConnect;
HINTERNET hOpen = InternetOpen (L"FTP",
INTERNET_OPEN_TYPE_PRECONFIG,
NULL, NULL, 0); /// This function works OK.
if ( !hOpen )
{
AfxMessageBox(L"Failed to open WinInet");
}
else
{
hInternetConnect =
InternetConnect(hOpen,
m_URL,
INTERNET_DEFAULT_FTP_PORT,
m_Username,
m_Password,
INTERNET_SERVICE_FTP,
INTERNET_FLAG_PASSIVE,
0); /// This function returns error.
if( hInternetConnect ){
AfxMessageBox(L"Internet Connect succeded");
/*
if(FtpGetFile(hInternetConnect, m_Filename_Remote, m_Filename_Local, 0, 0, FTP_TRANSFER_TYPE_BINARY, 0))
{
}
else{
AfxMessageBox(L"Get File Failed");
return false;
}
*/
InternetCloseHandle(hInternetConnect);
}
else
{
CString csError = ErrorString(GetLastError());
TRACE(csError);
AfxMessageBox(csError);
return false;
}
InternetCloseHandle(hOpen);
}
returns:
This function is not supported on this system. Error code : 78
And another, bigger problem:
When I uncomment FtpGetFile part, application is compiled and deployed OK. But after starting it does nothing, it does not want to start totally. I do not understand, how can the unused portion of the code affect the behavior of the application starts.
Socket library does not do anything similar.
Microsoft!!!
http://support.microsoft.com/kb/2735592
But patch is developed for ARM >=5 only and licensed to PB customers.
Finished - test binaries
Hi friends. There are binaries for testing. Predefined values download nice picture from our Czech glamour atelier to your "Storage card" device directory, but you can try much other servers, directories and accounts. All directory contents may be downloaded to your :Storage card" directory, no selecting is possible in example. I mean there will problems after firewalls etc., post your feedback. WinInet really does not work on WP7 for FTP servers, there is used little changed class from D. J. Bernstein and codeproject. If anybody know, how to export STL templates from dll, help me. Use "Exit" button for appclosing instead WP7 usual "Esc".
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Edit: There is actual version (without licencing conflict probably).
Managed wrapper will be added later (by wNativeCom probably). XAP istallable example for non-developers in deeper future.
Code is totally thread unsafe, after validation I will use http://forum.xda-developers.com/showthread.php?t=2208647 for it.
You can try unfinished Silverlight version:
http://wp7ftp.howto.cz/XDA/FTPClientExample.xap ... will be updated. EDIT: Xap 1.1 version is available from April 5th.
http://wp7ftp.howto.cz/XDA/FtpClientLibrary.dll ... this native library is needed in your device "\Windows\" directory (download and transport it to place). EDIT: If it not works on any device, try to delete \Windows\FtpClientLibrary.dll and install xap 1.1 version only.
Preliminary results:
1. Native FTP library works well.
2. Managed/Native callbacks synchronisation works well. (Thanks to MS idiots I must code all desktop like functionality again). There is a most important part for mechanism studying.
3. Silwerlight for WP7 is the most stupid and bugged Microsoft feature.
Simple app description:
Type Host, User, Pass and Remote (dir) values. You can stay predefined for testing. Tap to "Connect". You can see result in scrollable block on the bottom. If unsuccess, check your internet connection and typed strings, try again. If success, tap to second empty line under "Remote" (thanks to normal multiselectbox WP7 absention). Check wanted file names and tap do bottom cross (is it normal in ListPicker to have two crosses???). Tap to "Download". It is all. You can tap to "Disc.", change remote path or server values and tap to "Connect" again. First empty line under "Remote" contains remote directories list, but I am too busy to finish any logical directory tracing with bugged and unlogical Silverlight Toolkit features.
Known bug: Edit: Solved in 1.1 version. If deadlock occures still (unavailable FTP response), app restart (or phone reboot) helps you. Do you know anybody, if SL TextBox has limited capacity and how to bind string list to ListPicker?
Attention: "Connect" again after successfull previous connect and without disconnect = possible memory leaking!
Note: It is FTP. Must wait for all directives any seconds. If unsuccess, try the same again. This is normal FTP beahiour by mobile connection.
If anybody want, libraries are opensource and you can download them from the same FTP, which is used as predefined example values, or equal http http://wp7ftp.howto.cz/XDA/. You all have full FTP access, do not change anything important, upload relevant patches only! Managed part (Visual Studio 2010 for WP) is usable along by FTPClientUIDebugManagedWrappers.sln solution. I want to add FTP as plugin to Phone Commander only, I mean two-pane UI is the best solution of the FTP client. But, standalone FTP client can be usable too, when somebody Silverlight experienced will repair listControls behaviour there (all n/m callbacks are prepared, UI finishing is necessary only). Download only is finished in native library, upload will repaired in next versions.
Version 1.3
Uploaded FTPClient v 1.3 (the newest version is allways on http://wp7ftp.howto.cz/XDA/FTPClientExample.xap) solves ListPicker issues. Instead Remote Directories ListPicker is used totally wrong, but functioning global strings listbox, I am too busy to solve SL toolkit bugs now.
Known bug: Native library losts connection sometime and does not inform main application about it. You will see empty directories list from non-empty directories in this case. Application (or sometime device) reset helps you.
Known restriction: Server must be typed by name alias, not by IP address. I do not know why still, it will probably repaired in future versions.
Version 1.4
V 1.4:
Repaired file unselect after directory changing.
Showed "./././.." instead ".." as "Up" directory for better tapping.
Response TextBox content is rounded to 1000 characters. Is it a known TextBox bug to show any first characters only?

WP7 Shell, Console, Batch files interpreter

Hi Friends.
Standard Cmd.exe seems not working on WP7 probably by any restrictions, then we need own solution. There is a simple WP7 console (paied!!!), but this is childer game only, not a real working tool (some connection features from it are so usable).
There is one BIG problem on CE based systems - Shell context absention, especially Current Directory concept miss. Rainer Keuchel's CELib and Console solves it by ENVIRONMENT registry key, common for every console instance. Desktop Windows / POSIX systems concept of many unique shell contexts is very hard implementable here.There is not problem to make new context in registry - this can be unique key, contain all included processes IDs, environment structure and especially current directory path. But, somebody must release this context, when all processes finish. It can not be user applications dependent, any kernel "garbage collector" must be implemented for it. And, how to refer context to launched process? What do you mean about it - is better simple one context shell then nothing, or long work on multicontext solution?
Another problem is popen and pipes absention on WP7 system. I finished very simple solution last weak, based on stdout to file redirecting, which Microsoft forgets in WP7 API from WM6 one. Then we can make simply dedicated applications (dir.exe, set.exe, copy.exe, delete.exe etc.) in \Windows directory, callable by standard ShellExecuteEx, enrolling ouptut do stdout by printf etc. But, is it good solution? Have you got anybody real pipes working on WP7?
Working console appplication with bath files interpreter give us big possibilities for on-device attempts and programming, simple installators/deinstallators building, WP7 Perl, HaRET, Linux, WM, WinRT, WP8 wrappers working etc. It is not problem now to runs anything in kernel mode on WP7. Are you somebody able to cooperate include native coding? We can make real operating system from Microsoft fart bag named WP7.
Martin7Pro said:
Hi Friends.
Standard Cmd.exe seems not working on WP7 probably by any restrictions, then we need own solution. There is a simple WP7 console (paied!!!), but this is childer game only, not a real working tool (some connection features from it are so usable).
There is one BIG problem on CE based systems - Shell context absention, especially Current Directory concept miss. Rainer Keuchel's CELib and Console solves it by ENVIRONMENT registry key, common for every console instance. Desktop Windows / POSIX systems concept of many unique shell contexts is very hard implementable here.There is not problem to make new context in registry - this can be unique key, contain all included processes IDs, environment structure and especially current directory path. But, somebody must release this context, when all processes finish. It can not be user applications dependent, any kernel "garbage collector" must be implemented for it. And, how to refer context to launched process? What do you mean about it - is better simple one context shell then nothing, or long work on multicontext solution?
Another problem is popen and pipes absention on WP7 system. I finished very simple solution last weak, based on stdout to file redirecting, which Microsoft forgets in WP7 API from WM6 one. Then we can make simply dedicated applications (dir.exe, set.exe, copy.exe, delete.exe etc.) in \Windows directory, callable by standard ShellExecuteEx, enrolling ouptut do stdout by printf etc. But, is it good solution? Have you got anybody real pipes working on WP7?
Working console appplication with bath files interpreter give us big possibilities for on-device attempts and programming, simple installators/deinstallators building, WP7 Perl, HaRET, Linux, WM, WinRT, WP8 wrappers working etc. It is not problem now to runs anything in kernel mode on WP7. Are you somebody able to cooperate include native coding? We can make real operating system from Microsoft fart bag named WP7.
Click to expand...
Click to collapse
Pocket CMD from CE7 ARMv7 works fine via telnet. Tested on my Samsung Omnia 7 and Jaxbot's Samsung Focus. You can see it in action in this screenshot: http://windowsphonehacker.com/articles/all_in_a_days_work-03-03-13
Do I have to rename the zip tp xap and install normally?
No. If you don't know how to install it you probably don't need it as it creates a huge security risk on your phone.
Hmm... , interesting. The same exe in other configuratin I tested on my phones in the past with result : "Too much console ones work immediatelly, close any and try again".
Do you know (or is possible to code) telnet WP7 client, functioning on the same IP as server? Especially with hardware keyboard support?
Martin7Pro said:
Hmm... , interesting. The same exe in other configuratin I tested on my phones in the past with result : "Too much console ones work immediatelly, close any and try again".
Do you know (or is possible to code) telnet WP7 client, functioning on the same IP as server? Especially with hardware keyboard support?
Click to expand...
Click to collapse
Silverlight apps can not connect to localhost, it has been blocked.
Simple batch line interpreter
I tried cmd.exe batch and arguments calling, but it seems does not working for me. Then I will try own attempt.
Single batch line interpreter (*.bat files interpreting precursor):
SHLine.cpp
PHP:
// SHLine.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
//#include <atlstr.h>
/*CString*/
#ifdef _DEBUG
#pragma comment (lib, "libcmtd.lib")
#else
#pragma comment (lib, "libcmt.lib")
#endif
/*CString*/
#include <list>
using namespace std;
typedef list<CString> StringList;
#define SEE_MASK_NOASYNC (0x00000100)
CString ErrorString(DWORD err)
{
CString Error;
try
{
LPTSTR s;
if (::FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
NULL, err, 0, (LPTSTR)&s, 0, NULL) == 0)
{
Error.AppendFormat(TEXT("Error code : %X"), err);
} /* failed */
else
{ /* success */
LPTSTR p = _tcschr(s, _T('\r'));
if(p != NULL)
{ /* lose CRLF */
*p = _T('\0');
} /* lose CRLF */
Error = s;
::LocalFree(s);
} /* success */
return Error;
}
catch (...)
{
Error.AppendFormat(TEXT("Error code : %X"), err);
return Error;
}
}
HRESULT ShellExecuteWait(const wchar_t * file, const wchar_t * args, long lTimeout)
{
TRACE(L"ShellExecuteWait file=%s, args=%s, long lTimeout=%X\n", file, args, lTimeout);
try
{
SHELLEXECUTEINFO lpExecInfo;
memset(&lpExecInfo, 0, sizeof(SHELLEXECUTEINFO));
lpExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
lpExecInfo.lpFile = file;
lpExecInfo.lpParameters = args;
lpExecInfo.lpDirectory = _T("");
lpExecInfo.lpVerb = _T("open");
lpExecInfo.nShow = SW_MINIMIZE;
lpExecInfo.fMask = 0;
lpExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS | SEE_MASK_NOASYNC;// | SEE_MASK_FLAG_DDEWAIT;//0; lpExecInfo.hwnd = NULL;
lpExecInfo.hInstApp = NULL;//AfxGetInstanceHandle();
if(!ShellExecuteEx(&lpExecInfo))
{
DWORD err = GetLastError();
TRACE(L"ShellExecuteEx Error %d %s\n", err, ErrorString(err));
/// Sleep(100);
return (HRESULT)err;//ERROR_SUCCESS;
}
if (lpExecInfo.hProcess > 0)
{
TRACE(L"ShellExecuteEx WaitForSingleObject hProcess=%X\n", lpExecInfo.hProcess);
DWORD res = ::WaitForSingleObject(lpExecInfo.hProcess, lTimeout/*INFINITE*/);//5000);
TRACE(L"WaitForSingleObject lTimeout=%X, res=%X\n", lTimeout, res);
/// Sleep(100);
if (lTimeout != INFINITE && res != WAIT_OBJECT_0)
{
TerminateProcess(lpExecInfo.hProcess, 0);
TRACE(L"TerminateProcess;\n");
}
CloseHandle(lpExecInfo.hProcess);
}
TRACE(L"return ERROR_SUCCESS;\n");
return ERROR_SUCCESS;
}
catch (...)
{
DWORD err = 0x80070000 | GetLastError();
MessageBox(NULL, ErrorString(err), _T("ShellExecuteWait Error"), MB_OK);
return ERROR_SUCCESS;//(HRESULT)err;
}
}
StringList GetPathList(StringList & slPathList)
{
slPathList.clear();
slPathList.push_front(L"Program Files"); // Only for testing. HKCU\Environment PATH value will splitted instead;
slPathList.push_front(L"My Documents");
return slPathList;
}
CString GetCurrentDirectory(CString & csCurDir)
{
csCurDir = L"Program Files\\SHLine"; // Only for testing. HKCU\Environment CurrentDirectory value will readed instead;
return csCurDir;
}
bool FileExists(const wchar_t * file)
{
WIN32_FIND_DATA FindFileData;
HANDLE hFile = ::FindFirstFile(file, &FindFileData) ;
bool bFound = (hFile && (hFile != INVALID_HANDLE_VALUE));
if(bFound)
{
::FindClose(hFile);
}
return bFound;
}
int _tmain(int argc, _TCHAR* argv[])
{
TRACE(L"_tmain(int argc=%d);\n", argc);
if (argc > 1 && argv[1])
{
CString csRunPath = argv[1];
CString csRunArgs = L"";
if (argc > 2 && argv[2])
{
csRunArgs = argv[2];
for (int i = 3; i <= argc; i++)
{
if (argv[i])
{
csRunArgs = csRunArgs + L" " + argv[i];
}
}
}
CString csCurDir;
GetCurrentDirectory(csCurDir);
HRESULT hRes = ERROR_FILE_NOT_FOUND;
CString csFN = L"\\"+csCurDir+L"\\"+csRunPath/*.GetString()*/;
if (FileExists(csFN))
{
hRes = ShellExecuteWait(csFN, csRunArgs/*.GetString()*/, 60000);
}
if (hRes == ERROR_FILE_NOT_FOUND)
{
csFN = L"\\"+csRunPath;
CString csWin = L"\\Windows\\"+csRunPath;
if (FileExists(csFN) || FileExists(csWin))
{
hRes = ShellExecuteWait(csFN, csRunArgs, 60000); // Full path specified or file is known for CE Shell (included to \\Windows\ directory)
}
if (hRes == ERROR_FILE_NOT_FOUND)
{
StringList slPathList;
GetPathList(slPathList);
DWORD dwPath = 0;
for (StringList::iterator itPath = slPathList.begin(); itPath != slPathList.end(); ++itPath)
{
csFN = L"\\"+*itPath+L"\\"+csRunPath;
if (FileExists(csFN))
{
hRes = ShellExecuteWait(csFN, csRunArgs, 60000);
}
}
}
}
TRACE(L"_tmain returns 0x%X;\n", hRes);
return hRes;
}
TRACE(L"_tmain returns E_INVALIDARG;\n");
return E_INVALIDARG;
}
This interpret will be uploaded to \Windows directory to be used by any appplication. One can be batch files interpreter (call this shell with all lines as paramters), or do any controlling (lines can contain controlling directives as cycles etc.). The .bat extension registering is soluted by CE standard way on unlocked phones.
CD.exe, DIR.exe, ..., etc programs will add standard shell functionality. Output (directories listing etc.) will soluted by stdout file forwarding.
In this way one only shell interpreting application (one current directory only) will allowed immeditelly. Better something then nothing.
EDIT:
I have got batch interpreter working. But, very strange behaviour occures:
1. AygShell does not add exe extension automatically. Then I copied "copy.exe" to "\Windows\copy" etc. It works well. But, it does not work for "start" directive! Start is necessary for Iexplore and other "uncloseable" applications launching to prevent interpreter hanging up. It is interesting too "start.exe" (or "start") everytime renames automatically to "Start" with upcased first letter. Probably "\Windows\Start.html" causes this system behaviour.
2. std::list iterating for multi batch lines interpreting crashes everytime, when lauchched application contains any messagebox. Iterating replacing by numerous cyclus soles it. Unbelievable...
I will publish XAP as soon as. Any filemanager can be used for batch lauching after instllation. I recommend Phone Commander, which is able not only launch, but also edit *.bat files.
Non XAP preliminary beta for testers
1. Copy included files to \Windows directory.
2. Apply registry changes by Batch.reg (can be did automatically from Phone Commander etc.).
3. Try tap to Example.bat from any filemanager (Phone Commander, WP7 Root Tools, wPhoExplorer etc.).
4. Make your own scripts (you can use also automatical shell creating function from Phone Commander menu, rename *.sh file to *.bat and edit it's content by Phone Commander "View" edit function by pencil icon).
"start" and "copy" directives only are implemented still. "copy" is implemented with source and destionation parameters only (copies everytime), switches will added in future versions.
start "filename" [params] = nonblocking shell starting
"filename" [params] (without "start") = blocking shell starting, it waits to application closing (danger for iexplore and any other "uncloseable" applications, use "start" instead). It blocks NonDDE shell directives, DDE (pword.exe, other Office applications, etc.) are nonblocking everytime by principle.
"copy" directive + *.reg files interpreter can be used for simple installator creating for your native applications.
The same principle will used for universal scheduler (for example "switch on wifi every monday morning, switch off ringing and wifi tethering every friday evening" etc.).
"SHLine" part is offered for all console application creators (it interprets one batch line). Use stdout file redirect and ShellExecuteEx(...,L"SHLine.exe",User console input line,...);
jessenic said:
Pocket CMD from CE7 ARMv7 works fine via telnet. Tested on my Samsung Omnia 7 and Jaxbot's Samsung Focus. You can see it in action in this screenshot: http://windowsphonehacker.com/articles/all_in_a_days_work-03-03-13
Click to expand...
Click to collapse
Thanks for a tip. There is working on device Telnet xap screenshot:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Xap release will published, when I solute HaRET and Pocket CMD listing switch.
XAP is released.
Download from HaRET WP7 thread.
Console Big Update - try Ping, IPConfig, NetStat, WLanUtils etc.
New Console7 version can offer to you many usable utilities, as cgacutil, etcha, ipconfig, ipconfig6, ipv6, kbdtest, msmqadm, ndisconfig, net, netlogctl, netstat, ping, rnaapp, route, services, shell, tracert, upnpreg and wlantool. With simply user interface you can write commands (or batch or Mort scripts) with big possibilities as on desktop Windows.
Console7 is not so dangerous as HaRET, but you still keep in mind that it can also destroy your operating system and possibly device ...
1. Install XAP.
2. Enable it by Root Manager.
3. Tap to Upeer screen part, tap to Menu button, slide menu left and select "Install pocketcmd shell etc."
4. Wait to reboot.
5. Wait to automatical Console7 start.
6. Type commands in bottom textbox and send it by Enter key. HELP command is available.
7. Try standard commands. Use help , help cmd commands to see full list.
8. Try additional features. Use help, for example:
ipconfig /?
Also copy, delete, etcha. ipconfig, ipconfig6, ipv6, kbdtest, launchuri, md, messagebox, msmqadm, ndisconfig, net, netlogctl, netstat, ping, reboot, regimport, rnaapp, route, services, shell, start, startback, tracert, upnpreg, wlantool directives are offered, some with help by /?.
9. Try Batch and Mort script making by PhoneCommander editor. Batch files (*.bat) are registered authomatically by Console7 installing. MortScripts installator will available as soon as.
10. When you want to risc device Hard Reset, try also "install haret and kernel driver".
11. Try HaRET/Shell switching by yellow buttons.
Remember: PocketCMD using is relatively safe (when you will not delete any system files or directories), but HaRET may be very danger still! Use both on your own risc.

I successfully built a CWM with english for P6(But i have some problem)

I can move up and down with the volume keys,But I can not use the power button controls the Enter key。So it just can move up and down but can't Confirm each command. I think the key values of this CWM is wrong.Everyone who can help me to build a CWM for P6 with correct key values and I will be very thank you.
Pictures:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
You need to modify recovery_ui.c before compiling CWM to alter KEY Mapping. Don't forget to define the below in your BoardConfig.mk beforehand.
Just swap out "KEY_MENU" for "KEY_POWER" within "recovery_ui.c"...
BoardConfig.mk:
Code:
BOARD_CUSTOM_RECOVERY_KEYMAPPING := ../../device/[B]*INSERT-MANUFACTURE-NAME[/B]/[B]*INSERT-DEVICE-NAME/recovery_ui.c[/B]
The only issue then you'll have is binding a back key map since as you know we're short a few keys, failing that build a Touch CWM recovery since this issue is addressed.
Bravo on getting a successful and bootable CWM build. Hats off to you sir.
can you help me to build a recovery Binaries.
zhenaguo said:
can you help me to build a recovery Binaries.
Click to expand...
Click to collapse
Another case is this, in BoardConfig.mk
Code:
BOARD_HAS_NO_SELECT_BUTTON := true
If you builded the cwm with their web builder, probably this is the error
can you help me to build a recovery binary.
zhenaguo said:
can you help me to build a recovery binary.
Click to expand...
Click to collapse
I can, but stickman89 know a lot more than me
Post here or pm, i'll try to help you
many thanks . i will pm to you and give you the files
zhenaguo said:
many thanks . i will pm to you and give you the files
Click to expand...
Click to collapse
I still need to complete the repo sync (i'm aroun 90%), pm it to stickman too, he already got all the enviroment set up
Either modify the existing "default_recovery_ui.c" located at [SOURCE FOLDER]/bootable/recovery/ and add the below: (Replace any existing entries if defined, do not remove unrelated entries otherwise)
Code:
int device_handle_key(int key_code, int visible) {
if (visible) {
switch (key_code) {
case KEY_DOWN:
case KEY_VOLUMEDOWN:
return HIGHLIGHT_DOWN;
case KEY_UP:
case KEY_VOLUMEUP:
return HIGHLIGHT_UP;
case KEY_ENTER:
case KEY_POWER:
return SELECT_ITEM;
}
}
return NO_ACTION;
}
for device reset after power button being pressed 5 times add the following to the same file on a new line and below the above entry:
Code:
int device_reboot_now(volatile char* key_pressed, int key_code) {
// Reboot if the power key is pressed five times in a row, with
// no other keys in between.
static int presses = 0;
if (key_code == KEY_POWER) { // power button
++presses;
return presses == 5;
} else {
presses = 0;
return 0;
}
}
or define your own recovery_ui.c via BoardConfig.mk and setup your own. Obviously were missing a return/back key so perhaps building against Touch Recovery is a better idea.
...For now the above should suffice.
Stickman89 said:
Either modify the existing "default_recovery_ui.c" located at [SOURCE FOLDER]/bootable/recovery/ and add the below: (Replace any existing entries if defined, do not remove unrelated entries otherwise)
Code:
int device_handle_key(int key_code, int visible) {
if (visible) {
switch (key_code) {
case KEY_DOWN:
case KEY_VOLUMEDOWN:
return HIGHLIGHT_DOWN;
case KEY_UP:
case KEY_VOLUMEUP:
return HIGHLIGHT_UP;
case KEY_ENTER:
case KEY_POWER:
return SELECT_ITEM;
}
}
return NO_ACTION;
}
for device reset after power button being pressed 5 times add the following to the same file on a new line and below the above entry:
Code:
int device_reboot_now(volatile char* key_pressed, int key_code) {
// Reboot if the power key is pressed five times in a row, with
// no other keys in between.
static int presses = 0;
if (key_code == KEY_POWER) { // power button
++presses;
return presses == 5;
} else {
presses = 0;
return 0;
}
}
or define your own recovery_ui.c via BoardConfig.mk and setup your own. Obviously were missing a return/back key so perhaps building against Touch Recovery is a better idea.
...For now the above should suffice.
Click to expand...
Click to collapse
I have upload the kernel and recovery.fstab to mediafire disk.There are two versions.one i named Kernel1_international_version.The others i named kernel2_Chinese_version.I am sure that each recovery.fstab of them is correct written.So,please help to to build a recovery binary for them.or you can post to someone who can do this work.I will be very thank you.Here is the link:
1.http://www.mediafire.com/download/r3zpk2cq5efv8dx/Kernel1_international_version.zip
2.http://www.mediafire.com/?eydeecerp7dzy7d
Your .fstab looks fine for international version
This **** repo still syncing
zhenaguo said:
I have upload the kernel and recovery.fstab to mediafire disk.There are two versions.one i named Kernel1_international_version.The others i named kernel2_Chinese_version.I am sure that each recovery.fstab of them is correct written.So,please help to to build a recovery binary for them.or you can post to someone who can do this work.I will be very thank you.Here is the link:
1.http://www.mediafire.com/download/r3zpk2cq5efv8dx/Kernel1_international_version.zip
2.http://www.mediafire.com/?eydeecerp7dzy7d
Click to expand...
Click to collapse
How on earth did you flash CWM Recovery without Huawei signing it?
We need to know the procedure you used and any other modifications to CWM source you specifically made in order to get this booting on our device.
Your environment is clearly working, would make more sense if you made these changes. The method
S34Qu4K3 gave in terms of a simple one line fix to BoardConfig.mk will allow CWM selection or alternatively use my method which required a bit more interaction.
I bet that's the Honor 2 CWM (or a huawei dev ;D)
What about CWM builder? Touch recovery should work right? I know, that the power button issue is in the non touch recovery provided by the builder
Zhenaguo add this line to your BoardConfig.mk: (as suggested by S34Qu4K3)
Code:
BOARD_HAS_NO_SELECT_BUTTON := true
It's that simple. If that doesn't work provide me with the following file: /bootable/recovery/default_recovery_ui.c and I'll make the required modifications for our button mapping.
Without knowing how you bypassed encryption to flash said recovery our efforts won't be at all effective.
Since your able to successfully build a bootable CWM you may as well make the above simple modification.
zhenaguo, Hello previously encountered the same problem as you, but was able to resolve it on U9510E, the machine with the same architecture. if you can help it, you would appreciate your help on my phone
Sorry for the off topic but do you think that we 'll be able to use it or as a base for the ascend mate?
ollden said:
Sorry for the off topic but do you think that we 'll be able to use it or as a base for the ascend mate?
Click to expand...
Click to collapse
i guess so. in my U9510 this apk working.

[Help] Notifications & Toasts don't work

So, I'm writing my very first module and everything works except notification/toast creation. I don't know why.
The best I've managed is ONE toast but never again. I haven't even managed a single notification. What could I be doing wrong?
What drives me crazy is that the thread runs without error. I get my XposedBridge.log()'s just fine. I even throttled the reporting to no faster than every 5 seconds.
I've tried running the following from my thread. I've tried running it on the MainLooper (WTF Google, why can't you do something like Swing?)
Code:
// INSIDE my worker thread run
Application app = AndroidAppHelper.currentApplication();
mNotifyManager = (NotificationManager) app.getSystemService(Context.NOTIFICATION_SERVICE);
mBuilder = new NotificationCompat.Builder(app);
mBuilder.setContentTitle("File Thinger")
.setContentText("Thinging in progress")
//.setSmallIcon(R.drawable.download)
;
Code:
//------------
// INSIDE my worker thread reporting code
//Handler handler = new Handler(Looper.getMainLooper());
//handler.post(new Runnable() {
// public void run() {
if (!TextUtils.isEmpty(message)) {
if (toast != null) {
toast.cancel(); //dismiss current toast if visible
toast.setText(message);
} else {
toast = Toast.makeText(app, message, duration);
}
toast.show();
}
// }
//});
mBuilder.setProgress(me, mp, false);
mNotifyManager.notify(notificationId, mBuilder.build());
XposedBridge.log(cp + "% (" + mp + " / " + me + ")");
For added funzies, I'm working in NoxPlayer with Android 5.
I got Toast working. I put everything in the runnable. No idea why notifications aren't working.

General [CLOSED] AOSP support -- working AOSP12 built from source.

Here is a build of AOSP12r14
This is SD1A.210817.037
{Mod edit: Link removed}
Run flash-base.sh from the corresponding factory image to update bootloader and radio if you like.
Use "fastboot update" to install.
Very minor changes from pure AOSP;
1) selinux is permissive because I haven't got around to fixing a glitch.
2) Dialer/Messaging/Contacts have selective picks from lineageos for dark mode.
3) Dialer includes automatic call recording per the following;
Code:
From 945c17eabfdf9f108b26eda3d54266c0a2255234 Mon Sep 17 00:00:00 2001
Date: Mon, 8 Nov 2021 14:17:51 -0500
Subject: [PATCH] Automatic call recording
Change-Id: Icdb26fa6729e6a13dc6190a42dc75453900a6345
---
.../dialer/app/res/values/cm_strings.xml | 2 ++
.../dialer/app/res/xml/sound_settings.xml | 5 ++++
.../dialer/callrecord/res/values/config.xml | 4 +--
.../android/incallui/CallButtonPresenter.java | 30 +++++++++++++++++--
4 files changed, 37 insertions(+), 4 deletions(-)
diff --git a/java/com/android/dialer/app/res/values/cm_strings.xml b/java/com/android/dialer/app/res/values/cm_strings.xml
index 1dcdb2b81..3f7602d44 100644
--- a/java/com/android/dialer/app/res/values/cm_strings.xml
+++ b/java/com/android/dialer/app/res/values/cm_strings.xml
@@ -38,6 +38,8 @@
<string name="call_recording_format">Audio format</string>
<string name="wb_amr_format" translatable="false">AMR-WB</string>
<string name="aac_format" translatable="false">AAC</string>
+ <string name="auto_call_recording_title">Auto call recording</string>
+ <string name="auto_call_recording_key" translatable="false">auto_call_recording</string>
<string name="call_via">Call via</string>
<string name="call_via_dialog_title">Call via\u2026</string>
diff --git a/java/com/android/dialer/app/res/xml/sound_settings.xml b/java/com/android/dialer/app/res/xml/sound_settings.xml
index aa025874f..d31ea9e5c 100644
--- a/java/com/android/dialer/app/res/xml/sound_settings.xml
+++ b/java/com/android/dialer/app/res/xml/sound_settings.xml
@@ -83,6 +83,11 @@
android:entryValues="@array/call_recording_encoder_values"
android:defaultValue="0" />
+ <SwitchPreference
+ android:defaultValue="false"
+ android:key="@string/auto_call_recording_key"
+ android:title="@string/auto_call_recording_title"/>
+
</PreferenceCategory>
</PreferenceScreen>
diff --git a/java/com/android/dialer/callrecord/res/values/config.xml b/java/com/android/dialer/callrecord/res/values/config.xml
index 7aabd6cac..2832c87bc 100644
--- a/java/com/android/dialer/callrecord/res/values/config.xml
+++ b/java/com/android/dialer/callrecord/res/values/config.xml
@@ -16,8 +16,8 @@
-->
<resources>
- <bool name="call_recording_enabled">false</bool>
+ <bool name="call_recording_enabled">true</bool>
<!-- 1 (MIC) for microphone audio source (default)
4 (VOICE_CALL) if supported by device for voice call uplink + downlink audio source -->
- <integer name="call_recording_audio_source">1</integer>
+ <integer name="call_recording_audio_source">4</integer>
</resources>
diff --git a/java/com/android/incallui/CallButtonPresenter.java b/java/com/android/incallui/CallButtonPresenter.java
index 0fa833edd..175fe7cc2 100644
--- a/java/com/android/incallui/CallButtonPresenter.java
+++ b/java/com/android/incallui/CallButtonPresenter.java
@@ -21,6 +21,7 @@ import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.os.Bundle;
+import android.os.Handler;
import android.os.Trace;
import android.preference.PreferenceManager;
import android.support.v4.app.Fragment;
@@ -74,6 +75,7 @@ public class CallButtonPresenter
private DialerCall call;
private boolean isInCallButtonUiReady;
private PhoneAccountHandle otherAccount;
+ private boolean isRecording = false;
private CallRecorder.RecordingProgressListener recordingProgressListener =
new CallRecorder.RecordingProgressListener() {
@@ -114,6 +116,11 @@ public class CallButtonPresenter
CallRecorder recorder = CallRecorder.getInstance();
recorder.addRecordingProgressListener(recordingProgressListener);
+ if(recorder.isRecording()){
+ inCallButtonUi.setCallRecordingState(true);
+ } else {
+ inCallButtonUi.setCallRecordingState(false);
+ }
// Update the buttons state immediately for the current call
onStateChange(InCallState.NO_CALLS, inCallPresenter.getInCallState(), CallList.getInstance());
@@ -144,6 +151,8 @@ public class CallButtonPresenter
@Override
public void onStateChange(InCallState oldState, InCallState newState, CallList callList) {
Trace.beginSection("CallButtonPresenter.onStateChange");
+ CallRecorder recorder = CallRecorder.getInstance();
+ boolean isEnabled = PreferenceManager.getDefaultSharedPreferences(context).getBoolean(context.getString(R.string.auto_call_recording_key), false);
if (call != null) {
call.removeListener(this);
}
@@ -152,6 +161,16 @@ public class CallButtonPresenter
} else if (newState == InCallState.INCALL) {
call = callList.getActiveOrBackgroundCall();
+ if (!isRecording && isEnabled && call != null) {
+ isRecording = true;
+ new Handler().postDelayed(new Runnable() {
+ @Override
+ public void run() {
+ callRecordClicked(true);
+ }
+ }, 500);
+ }
+
// When connected to voice mail, automatically shows the dialpad.
// (On previous releases we showed it when in-call shows up, before waiting for
// OUTGOING. We may want to do that once we start showing "Voice mail" label on
@@ -167,6 +186,9 @@ public class CallButtonPresenter
}
call = callList.getIncomingCall();
} else {
+ if (isEnabled && recorder.isRecording()) {
+ recorder.finishRecording();
+ }
call = null;
}
@@ -337,6 +359,7 @@ public class CallButtonPresenter
public void callRecordClicked(boolean checked) {
CallRecorder recorder = CallRecorder.getInstance();
if (checked) {
+ /*
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean warningPresented = prefs.getBoolean(KEY_RECORDING_WARNING_PRESENTED, false);
if (!warningPresented) {
@@ -354,6 +377,10 @@ public class CallButtonPresenter
} else {
startCallRecordingOrAskForPermission();
}
+ */
+ if(!recorder.isRecording()) {
+ startCallRecordingOrAskForPermission();
+ }
} else {
if (recorder.isRecording()) {
recorder.finishRecording();
@@ -566,8 +593,7 @@ public class CallButtonPresenter
&& call.getState() != DialerCallState.CONNECTING;
final CallRecorder recorder = CallRecorder.getInstance();
- final boolean showCallRecordOption = recorder.canRecordInCurrentCountry()
- && !isVideo && call.getState() == DialerCallState.ACTIVE;
+ final boolean showCallRecordOption = !isVideo && call.getState() == DialerCallState.ACTIVE;
otherAccount = TelecomUtil.getOtherAccount(getContext(), call.getAccountHandle());
boolean showSwapSim =
--
2.27.0
Its happening.
refs/heads/android12-d1-s4-release - device/google/gs101 - Git at Google
refs/heads/android12-d1-s4-release - device/google/raviole - Git at Google
refs/heads/android12-d1-s4-release - device/google/raviole-kernel - Git at Google
refs/heads/android-gs-raviole-5.10-android12-d1 - kernel/gs - Git at Google
etc.
Apparently "raviole" is what you get when you cross a "raven" with an "oriole"
96carboard said:
Its happening.
refs/heads/android12-d1-s4-release - device/google/gs101 - Git at Google
refs/heads/android12-d1-s4-release - device/google/raviole - Git at Google
refs/heads/android12-d1-s4-release - device/google/raviole-kernel - Git at Google
refs/heads/android-gs-raviole-5.10-android12-d1 - kernel/gs - Git at Google
etc.
Apparently "raviole" is what you get when you cross a "raven" with an "oriole"
Click to expand...
Click to collapse
Let the games begin....
Now its tagged android-12.0.0_r4
That means it should be sync/buildable now.
Nope, not yet, soon. Apparently the balance of r4 isn't available yet.
Pixel has had very poor aftermarket custom ROM support since the beginning.
Most devs just aren't interested in it. Would be nice if that changes with the 6 series but I won't get my hopes up.
CZ Eddie said:
Pixel has had very poor aftermarket custom ROM support since the beginning.
Most devs just aren't interested in it. Would be nice if that changes with the 6 series but I won't get my hopes up.
Click to expand...
Click to collapse
What are you talking about? ONLY Nexus/Pixel is supported by AOSP.
96carboard said:
What are you talking about? ONLY Nexus/Pixel is supported by AOSP.
Click to expand...
Click to collapse
I don't understand your response.
I've been flashing custom ROM's since the Samsung Skyrocket and while development has generally fallen off a cliff since those days, there are some phones with more active support and Pixel has not been one of the leaders in this regard.
Go look at OnePlus forums and compare custom (not customized stock) ROM quantity to any of the Pixel phone forums.
CZ Eddie said:
I don't understand your response.
I've been flashing custom ROM's since the Samsung Skyrocket and while development has generally fallen off a cliff since those days, there are some phones with more active support and Pixel has not been one of the leaders in this regard.
Go look at OnePlus forums and compare custom (not customized stock) ROM quantity to any of the Pixel phone forums.
Click to expand...
Click to collapse
That's not support, that's broken crap made by people who are so pissed off with the LACK of support that they do it themselves. Kind-of.
Nexus/Pixel are *ACTUALLY* supported in AOSP. You don't need broken hacker projects to make them work. You repo init, repo sync, lunch, make, install.
EDIT: This is AOSP - https://android.googlesource.com/?format=HTML
If your device isn't in there, then its not supported.
The primary reason you buy a Nexus/Pixel is *BECAUSE* it is supported in there and doesn't depend on hacks.
r4 is now all up, time to sync and build from source!
96carboard said:
r4 is now all up, time to sync and build from source!
Click to expand...
Click to collapse
i'm seeing r4 - r7 or am i just dumb?
plasticarmyman said:
i'm seeing r4 - r7 or am i just dumb?
Click to expand...
Click to collapse
There are 4 factory system images available. Maybe they correspond.
Interesting, there seem to be 3 variations. Regular, 64-bit only, and pKVM. The second wont run 32bit code and will therefore create compatibility problems. The last... protected kernel based virtual machine... no idea what the implication is.
I wish I could justify a high end SSD for my build server. Been just sitting here for several minutes waiting for lunch just to spit out the build menu.
And of course, what comes up is aosp_slider-userdebug and aosp_whitefin-userdebug. So... the bootloader version says "slider-1.0-7753224".
The build files for slider don't correspond to what's on the filesystem.
Going to try....
```lunch aosp_raven-userdebug```
And mustn't forget the propblobs.... https://developers.google.com/android/drivers
This looks familiar... BUILD_ID=SD1A.210817.019.C4
Note that its r7 I'm building.
Made it past the first stage of build, now its actually compiling stuff.
[ 3% 4357/125906] build ..... etc.
Hopefully when I look in the morning it will be built and working and not a broken mess.
So, it built and it installed and it sort-of works.
When I put in the sim card, it did a bunch of strange reboot and wipes, but eventually booted. Checked the logs and it was going crazy with a couple of selinux denials;
[ 38.787756] type=1400 audit(1635512778.460:87): avc: denied { read } for comm="pool-3-thread-1" name="ubject_r:vendor_rild_prop:s0" dev="tmpfs" ino=326 scontext=u:rlatform_app:s0:c512,c768 tcontext=ubject_r:vendor_rild_prop:s0 tclass=file permissive=0 app=com.shannon.imsservice
[ 38.788763] type=1107 audit(1635512778.464:88): uid=0 auid=4294967295 ses=4294967295 subj=u:r:init:s0 msg='avc: denied { set } for property=persist.vendor.radio.call_waiting_for_sync_0 pid=4573 uid=10086 gid=10086 scontext=u:rlatform_app:s0:c512,c768 tcontext=ubject_r:vendor_rild_prop:s0 tclass=property_service permissive=0'
Setting it to permissive briefly (i.e. # setenforce 0) lets it do what it has to do.
Not too bad for a first try!
Download: <removed, out of date. See first post.>
UPDATE!!!
Here's a vendor_boot.img (fastboot flash vendor_boot vendor_boot.img) that sets selinux to permissive:
<removed, out of date. See first post.>
That pretty much makes it all work. Obviously making it enforce is better, but this at least is usable now.
Sweet! I think this phone will get alot of love. The hardware is great. The price is right. This will be a great year or so. Until I get antsy and get the Pixel 7 Pro
Since I have AOSP running nicely on this phone, I've started really liking it (really hated it with all the google [bloat|spy]ware. Previously was using a Nexus 6 over Pixel 2XL because of its width. I was a little worried because this phone isn't quite as wide as the N6, but turns out its close enough that I can't really tell the difference.
Really working well.
The only issue I'm having is that the wide angle camera isn't available, which I think is because no camera software I've been able to find has been able to send a zoom level of 0.7 to the hal. The hal switches dynamically between the normal and telephoto based on zoom level.
I think i might try doing aosp (i dont know where to start, but ill try fastboot flash), but have you tried the GrapheneOS camera app? (https://github.com/GrapheneOS/Camera) I have tried the one from here (
https://twitter.com/i/web/status/1454715561368227843) and it works, but i am not sure about on AOSP.
I've just found out that you can flash aosp from flash.android.com
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
AlexDalas said:
I've just found out that you can flash aosp from flash.android.comView attachment 5445805
Click to expand...
Click to collapse
dont think this is AOSP.
tids2k said:
dont think this is AOSP.
Click to expand...
Click to collapse
I am not sure if it is AOSP (think it is, but can never be so sure), but it doesn't have gapps so it's doable for me
edit: i am getting micro g working hopefully

Categories

Resources